aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2011-01-09 01:23:33 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-10 02:35:34 -0500
commit91ecb63c074d802f8cf103f1dafb4aed24d0f24c (patch)
treeb35dd6b8de64ceeeee22dad0ee8f2794a662d401 /net/core
parentfc741216db156994c554ac31c1151fe0e00d8f0e (diff)
net offloading: Convert dev_gso_segment() to use precomputed features.
This switches dev_gso_segment() to use the device features computed by the centralized routine. In doing so, it fixes a problem where it would always use dev->features, instead of those appropriate to the number of vlan tags if any are present. Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 1444ed3861a0..4cd3e84e1294 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1971,16 +1971,14 @@ static void dev_gso_skb_destructor(struct sk_buff *skb)
1971/** 1971/**
1972 * dev_gso_segment - Perform emulated hardware segmentation on skb. 1972 * dev_gso_segment - Perform emulated hardware segmentation on skb.
1973 * @skb: buffer to segment 1973 * @skb: buffer to segment
1974 * @features: device features as applicable to this skb
1974 * 1975 *
1975 * This function segments the given skb and stores the list of segments 1976 * This function segments the given skb and stores the list of segments
1976 * in skb->next. 1977 * in skb->next.
1977 */ 1978 */
1978static int dev_gso_segment(struct sk_buff *skb) 1979static int dev_gso_segment(struct sk_buff *skb, int features)
1979{ 1980{
1980 struct net_device *dev = skb->dev;
1981 struct sk_buff *segs; 1981 struct sk_buff *segs;
1982 int features = dev->features & ~(illegal_highdma(dev, skb) ?
1983 NETIF_F_SG : 0);
1984 1982
1985 segs = skb_gso_segment(skb, features); 1983 segs = skb_gso_segment(skb, features);
1986 1984
@@ -2112,7 +2110,7 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2112 } 2110 }
2113 2111
2114 if (netif_needs_gso(skb, features)) { 2112 if (netif_needs_gso(skb, features)) {
2115 if (unlikely(dev_gso_segment(skb))) 2113 if (unlikely(dev_gso_segment(skb, features)))
2116 goto out_kfree_skb; 2114 goto out_kfree_skb;
2117 if (skb->next) 2115 if (skb->next)
2118 goto gso; 2116 goto gso;