diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-18 01:26:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-18 01:26:41 -0500 |
commit | ccb19d263fd1c9e34948e2158c53eacbff369344 (patch) | |
tree | 6683e55f183920dcbf3e1a5b749e7f9780c465b3 /net/core | |
parent | 6a488979f574cb4287880db2dbc8b13cee30c5be (diff) | |
parent | c3b5003b628d8e373262bee42c7260d6a799c73e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (47 commits)
tg3: Fix single-vector MSI-X code
openvswitch: Fix multipart datapath dumps.
ipv6: fix per device IP snmp counters
inetpeer: initialize ->redirect_genid in inet_getpeer()
net: fix NULL-deref in WARN() in skb_gso_segment()
net: WARN if skb_checksum_help() is called on skb requiring segmentation
caif: Remove bad WARN_ON in caif_dev
caif: Fix typo in Vendor/Product-ID for CAIF modems
bnx2x: Disable AN KR work-around for BCM57810
bnx2x: Remove AutoGrEEEn for BCM84833
bnx2x: Remove 100Mb force speed for BCM84833
bnx2x: Fix PFC setting on BCM57840
bnx2x: Fix Super-Isolate mode for BCM84833
net: fix some sparse errors
net: kill duplicate included header
net: sh-eth: Fix build error by the value which is not defined
net: Use device model to get driver name in skb_gso_segment()
bridge: BH already disabled in br_fdb_cleanup()
net: move sock_update_memcg outside of CONFIG_INET
mwl8k: Fixing Sparse ENDIAN CHECK warning
...
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 32 | ||||
-rw-r--r-- | net/core/net-sysfs.c | 2 | ||||
-rw-r--r-- | net/core/secure_seq.c | 2 |
3 files changed, 22 insertions, 14 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index f494675471a9..115dee1d985d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1887,6 +1887,23 @@ void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | |||
1887 | EXPORT_SYMBOL(skb_set_dev); | 1887 | EXPORT_SYMBOL(skb_set_dev); |
1888 | #endif /* CONFIG_NET_NS */ | 1888 | #endif /* CONFIG_NET_NS */ |
1889 | 1889 | ||
1890 | static void skb_warn_bad_offload(const struct sk_buff *skb) | ||
1891 | { | ||
1892 | static const netdev_features_t null_features = 0; | ||
1893 | struct net_device *dev = skb->dev; | ||
1894 | const char *driver = ""; | ||
1895 | |||
1896 | if (dev && dev->dev.parent) | ||
1897 | driver = dev_driver_string(dev->dev.parent); | ||
1898 | |||
1899 | WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d gso_size=%d " | ||
1900 | "gso_type=%d ip_summed=%d\n", | ||
1901 | driver, dev ? &dev->features : &null_features, | ||
1902 | skb->sk ? &skb->sk->sk_route_caps : &null_features, | ||
1903 | skb->len, skb->data_len, skb_shinfo(skb)->gso_size, | ||
1904 | skb_shinfo(skb)->gso_type, skb->ip_summed); | ||
1905 | } | ||
1906 | |||
1890 | /* | 1907 | /* |
1891 | * Invalidate hardware checksum when packet is to be mangled, and | 1908 | * Invalidate hardware checksum when packet is to be mangled, and |
1892 | * complete checksum manually on outgoing path. | 1909 | * complete checksum manually on outgoing path. |
@@ -1900,8 +1917,8 @@ int skb_checksum_help(struct sk_buff *skb) | |||
1900 | goto out_set_summed; | 1917 | goto out_set_summed; |
1901 | 1918 | ||
1902 | if (unlikely(skb_shinfo(skb)->gso_size)) { | 1919 | if (unlikely(skb_shinfo(skb)->gso_size)) { |
1903 | /* Let GSO fix up the checksum. */ | 1920 | skb_warn_bad_offload(skb); |
1904 | goto out_set_summed; | 1921 | return -EINVAL; |
1905 | } | 1922 | } |
1906 | 1923 | ||
1907 | offset = skb_checksum_start_offset(skb); | 1924 | offset = skb_checksum_start_offset(skb); |
@@ -1961,16 +1978,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, | |||
1961 | __skb_pull(skb, skb->mac_len); | 1978 | __skb_pull(skb, skb->mac_len); |
1962 | 1979 | ||
1963 | if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { | 1980 | if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { |
1964 | struct net_device *dev = skb->dev; | 1981 | skb_warn_bad_offload(skb); |
1965 | struct ethtool_drvinfo info = {}; | ||
1966 | |||
1967 | if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) | ||
1968 | dev->ethtool_ops->get_drvinfo(dev, &info); | ||
1969 | |||
1970 | WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d ip_summed=%d\n", | ||
1971 | info.driver, dev ? &dev->features : NULL, | ||
1972 | skb->sk ? &skb->sk->sk_route_caps : NULL, | ||
1973 | skb->len, skb->data_len, skb->ip_summed); | ||
1974 | 1982 | ||
1975 | if (skb_header_cloned(skb) && | 1983 | if (skb_header_cloned(skb) && |
1976 | (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) | 1984 | (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index f3dbd4f596a4..a1727cda03d7 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -929,7 +929,7 @@ static ssize_t bql_show_inflight(struct netdev_queue *queue, | |||
929 | } | 929 | } |
930 | 930 | ||
931 | static struct netdev_queue_attribute bql_inflight_attribute = | 931 | static struct netdev_queue_attribute bql_inflight_attribute = |
932 | __ATTR(inflight, S_IRUGO | S_IWUSR, bql_show_inflight, NULL); | 932 | __ATTR(inflight, S_IRUGO, bql_show_inflight, NULL); |
933 | 933 | ||
934 | #define BQL_ATTR(NAME, FIELD) \ | 934 | #define BQL_ATTR(NAME, FIELD) \ |
935 | static ssize_t bql_show_ ## NAME(struct netdev_queue *queue, \ | 935 | static ssize_t bql_show_ ## NAME(struct netdev_queue *queue, \ |
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c index 6fd44606fdd1..99b2596531bb 100644 --- a/net/core/secure_seq.c +++ b/net/core/secure_seq.c | |||
@@ -46,7 +46,7 @@ __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, | |||
46 | 46 | ||
47 | memcpy(hash, saddr, 16); | 47 | memcpy(hash, saddr, 16); |
48 | for (i = 0; i < 4; i++) | 48 | for (i = 0; i < 4; i++) |
49 | secret[i] = net_secret[i] + daddr[i]; | 49 | secret[i] = net_secret[i] + (__force u32)daddr[i]; |
50 | secret[4] = net_secret[4] + | 50 | secret[4] = net_secret[4] + |
51 | (((__force u16)sport << 16) + (__force u16)dport); | 51 | (((__force u16)sport << 16) + (__force u16)dport); |
52 | for (i = 5; i < MD5_MESSAGE_BYTES / 4; i++) | 52 | for (i = 5; i < MD5_MESSAGE_BYTES / 4; i++) |