diff options
author | Jiri Pirko <jiri@resnulli.us> | 2014-11-19 16:04:59 +0300 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-04-27 23:48:34 +0300 |
commit | a67e2e88342accd49587d9bad72f6dabd7673f7c (patch) | |
tree | 00749cb39b448bc725224e0a1f11d5d45fc1a2cf /net/core | |
parent | d329729a26406301996d4ae63b3d7d489bd2f361 (diff) | |
download | linux-a67e2e88342accd49587d9bad72f6dabd7673f7c.tar.xz |
vlan: introduce *vlan_hwaccel_push_inside helpers
[ Upstream commit 5968250c868ceee680aa77395b24e6ddcae17d36 ]
Use them to push skb->vlan_tci into the payload and avoid code
duplication.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 8 | ||||
-rw-r--r-- | net/core/netpoll.c | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 8a57104a17dd..5cdbc1bd9783 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2663,12 +2663,8 @@ static struct sk_buff *validate_xmit_vlan(struct sk_buff *skb, netdev_features_t features) { if (vlan_tx_tag_present(skb) && - !vlan_hw_offload_capable(features, skb->vlan_proto)) { - skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, - vlan_tx_tag_get(skb)); - if (skb) - skb->vlan_tci = 0; - } + !vlan_hw_offload_capable(features, skb->vlan_proto)) + skb = __vlan_hwaccel_push_inside(skb); return skb; } diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 65d372384a3f..e0ad5d16c9c5 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -79,8 +79,7 @@ static int netpoll_start_xmit(struct sk_buff *skb, struct net_device *dev, if (vlan_tx_tag_present(skb) && !vlan_hw_offload_capable(features, skb->vlan_proto)) { - skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, - vlan_tx_tag_get(skb)); + skb = __vlan_hwaccel_push_inside(skb); if (unlikely(!skb)) { /* This is actually a packet drop, but we * don't want the code that calls this @@ -88,7 +87,6 @@ static int netpoll_start_xmit(struct sk_buff *skb, struct net_device *dev, */ goto out; } - skb->vlan_tci = 0; } status = netdev_start_xmit(skb, dev, txq, false); |