aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-02-11 02:32:18 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-02-11 02:33:14 -0500
commitf19693a17c6705e197eb24d4618060eaac1b535c (patch)
treefc39dc23297c0e6be730cb0dfd74a34d9c0b8bfd /net/core
parent23b120cdfae4f5c29da69de750d545bad719ead4 (diff)
parent100b33c8bd8a3235fd0b7948338d6cbb3db3c63d (diff)
Merge commit 'v2.6.38-rc4' into imx-for-2.6.39
Conflicts: arch/arm/mach-mxs/clock-mx28.c Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c14
-rw-r--r--net/core/ethtool.c2
-rw-r--r--net/core/rtnetlink.c8
-rw-r--r--net/core/skbuff.c9
4 files changed, 22 insertions, 11 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 54277df0f735..b6d0bf875a8e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -749,7 +749,8 @@ EXPORT_SYMBOL(dev_get_by_index);
749 * @ha: hardware address 749 * @ha: hardware address
750 * 750 *
751 * Search for an interface by MAC address. Returns NULL if the device 751 * Search for an interface by MAC address. Returns NULL if the device
752 * is not found or a pointer to the device. The caller must hold RCU 752 * is not found or a pointer to the device.
753 * The caller must hold RCU or RTNL.
753 * The returned device has not had its ref count increased 754 * The returned device has not had its ref count increased
754 * and the caller must therefore be careful about locking 755 * and the caller must therefore be careful about locking
755 * 756 *
@@ -2001,7 +2002,7 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol)
2001 2002
2002static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) 2003static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features)
2003{ 2004{
2004 if (!can_checksum_protocol(protocol, features)) { 2005 if (!can_checksum_protocol(features, protocol)) {
2005 features &= ~NETIF_F_ALL_CSUM; 2006 features &= ~NETIF_F_ALL_CSUM;
2006 features &= ~NETIF_F_SG; 2007 features &= ~NETIF_F_SG;
2007 } else if (illegal_highdma(skb->dev, skb)) { 2008 } else if (illegal_highdma(skb->dev, skb)) {
@@ -2023,13 +2024,13 @@ int netif_skb_features(struct sk_buff *skb)
2023 return harmonize_features(skb, protocol, features); 2024 return harmonize_features(skb, protocol, features);
2024 } 2025 }
2025 2026
2026 features &= skb->dev->vlan_features; 2027 features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_TX);
2027 2028
2028 if (protocol != htons(ETH_P_8021Q)) { 2029 if (protocol != htons(ETH_P_8021Q)) {
2029 return harmonize_features(skb, protocol, features); 2030 return harmonize_features(skb, protocol, features);
2030 } else { 2031 } else {
2031 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | 2032 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
2032 NETIF_F_GEN_CSUM; 2033 NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_TX;
2033 return harmonize_features(skb, protocol, features); 2034 return harmonize_features(skb, protocol, features);
2034 } 2035 }
2035} 2036}
@@ -2562,7 +2563,8 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
2562 2563
2563 map = rcu_dereference(rxqueue->rps_map); 2564 map = rcu_dereference(rxqueue->rps_map);
2564 if (map) { 2565 if (map) {
2565 if (map->len == 1) { 2566 if (map->len == 1 &&
2567 !rcu_dereference_raw(rxqueue->rps_flow_table)) {
2566 tcpu = map->cpus[0]; 2568 tcpu = map->cpus[0];
2567 if (cpu_online(tcpu)) 2569 if (cpu_online(tcpu))
2568 cpu = tcpu; 2570 cpu = tcpu;
@@ -3423,6 +3425,8 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
3423 __skb_pull(skb, skb_headlen(skb)); 3425 __skb_pull(skb, skb_headlen(skb));
3424 skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); 3426 skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb));
3425 skb->vlan_tci = 0; 3427 skb->vlan_tci = 0;
3428 skb->dev = napi->dev;
3429 skb->skb_iif = 0;
3426 3430
3427 napi->skb = skb; 3431 napi->skb = skb;
3428} 3432}
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 17741782a345..ff2302910b5e 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -817,7 +817,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
817 if (regs.len > reglen) 817 if (regs.len > reglen)
818 regs.len = reglen; 818 regs.len = reglen;
819 819
820 regbuf = vmalloc(reglen); 820 regbuf = vzalloc(reglen);
821 if (!regbuf) 821 if (!regbuf)
822 return -ENOMEM; 822 return -ENOMEM;
823 823
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index a5f7535aab5b..2d65c6bb24c1 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1121,8 +1121,7 @@ static int validate_linkmsg(struct net_device *dev, struct nlattr *tb[])
1121 return -EOPNOTSUPP; 1121 return -EOPNOTSUPP;
1122 1122
1123 if (af_ops->validate_link_af) { 1123 if (af_ops->validate_link_af) {
1124 err = af_ops->validate_link_af(dev, 1124 err = af_ops->validate_link_af(dev, af);
1125 tb[IFLA_AF_SPEC]);
1126 if (err < 0) 1125 if (err < 0)
1127 return err; 1126 return err;
1128 } 1127 }
@@ -1672,6 +1671,9 @@ replay:
1672 snprintf(ifname, IFNAMSIZ, "%s%%d", ops->kind); 1671 snprintf(ifname, IFNAMSIZ, "%s%%d", ops->kind);
1673 1672
1674 dest_net = rtnl_link_get_net(net, tb); 1673 dest_net = rtnl_link_get_net(net, tb);
1674 if (IS_ERR(dest_net))
1675 return PTR_ERR(dest_net);
1676
1675 dev = rtnl_create_link(net, dest_net, ifname, ops, tb); 1677 dev = rtnl_create_link(net, dest_net, ifname, ops, tb);
1676 1678
1677 if (IS_ERR(dev)) 1679 if (IS_ERR(dev))
@@ -1820,7 +1822,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
1820 if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) 1822 if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN))
1821 return -EPERM; 1823 return -EPERM;
1822 1824
1823 if (kind == 2 && (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { 1825 if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
1824 struct sock *rtnl; 1826 struct sock *rtnl;
1825 rtnl_dumpit_func dumpit; 1827 rtnl_dumpit_func dumpit;
1826 1828
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index d31bb36ae0dc..d883dcc78b6b 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -210,6 +210,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
210 shinfo = skb_shinfo(skb); 210 shinfo = skb_shinfo(skb);
211 memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); 211 memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));
212 atomic_set(&shinfo->dataref, 1); 212 atomic_set(&shinfo->dataref, 1);
213 kmemcheck_annotate_variable(shinfo->destructor_arg);
213 214
214 if (fclone) { 215 if (fclone) {
215 struct sk_buff *child = skb + 1; 216 struct sk_buff *child = skb + 1;
@@ -2744,8 +2745,12 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
2744 2745
2745merge: 2746merge:
2746 if (offset > headlen) { 2747 if (offset > headlen) {
2747 skbinfo->frags[0].page_offset += offset - headlen; 2748 unsigned int eat = offset - headlen;
2748 skbinfo->frags[0].size -= offset - headlen; 2749
2750 skbinfo->frags[0].page_offset += eat;
2751 skbinfo->frags[0].size -= eat;
2752 skb->data_len -= eat;
2753 skb->len -= eat;
2749 offset = headlen; 2754 offset = headlen;
2750 } 2755 }
2751 2756