Commit c01a1cb6 authored by Jiri Pirko's avatar Jiri Pirko Committed by Sasha Levin

vlan: kill vlan_put_tag helper

[ Upstream commit b4bef1b5 ]

Since both tx and rx paths work with skb->vlan_tci, there's no need for
this function anymore. Switch users directly to __vlan_hwaccel_put_tag.
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent ca7c7b90
...@@ -475,12 +475,8 @@ static void rlb_update_client(struct rlb_client_info *client_info) ...@@ -475,12 +475,8 @@ static void rlb_update_client(struct rlb_client_info *client_info)
skb->dev = client_info->slave->dev; skb->dev = client_info->slave->dev;
if (client_info->vlan_id) { if (client_info->vlan_id) {
skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id); __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
if (!skb) { client_info->vlan_id);
netdev_err(client_info->slave->bond->dev,
"failed to insert VLAN tag\n");
continue;
}
} }
arp_xmit(skb); arp_xmit(skb);
...@@ -951,13 +947,8 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], ...@@ -951,13 +947,8 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
skb->priority = TC_PRIO_CONTROL; skb->priority = TC_PRIO_CONTROL;
skb->dev = slave->dev; skb->dev = slave->dev;
if (vid) { if (vid)
skb = vlan_put_tag(skb, vlan_proto, vid); __vlan_hwaccel_put_tag(skb, vlan_proto, vid);
if (!skb) {
netdev_err(slave->bond->dev, "failed to insert VLAN tag\n");
return;
}
}
dev_queue_xmit(skb); dev_queue_xmit(skb);
} }
......
...@@ -2156,12 +2156,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, ...@@ -2156,12 +2156,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
if (outer_tag->vlan_id) { if (outer_tag->vlan_id) {
netdev_dbg(slave_dev, "outer tag: proto %X vid %X\n", netdev_dbg(slave_dev, "outer tag: proto %X vid %X\n",
ntohs(outer_tag->vlan_proto), outer_tag->vlan_id); ntohs(outer_tag->vlan_proto), outer_tag->vlan_id);
skb = vlan_put_tag(skb, outer_tag->vlan_proto, __vlan_hwaccel_put_tag(skb, outer_tag->vlan_proto,
outer_tag->vlan_id); outer_tag->vlan_id);
if (!skb) {
net_err_ratelimited("failed to insert outer VLAN tag\n");
return;
}
} }
xmit: xmit:
......
...@@ -402,7 +402,7 @@ static struct sk_buff *cdc_mbim_process_dgram(struct usbnet *dev, u8 *buf, size_ ...@@ -402,7 +402,7 @@ static struct sk_buff *cdc_mbim_process_dgram(struct usbnet *dev, u8 *buf, size_
/* map MBIM session to VLAN */ /* map MBIM session to VLAN */
if (tci) if (tci)
vlan_put_tag(skb, htons(ETH_P_8021Q), tci); __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tci);
err: err:
return skb; return skb;
} }
......
...@@ -356,24 +356,6 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, ...@@ -356,24 +356,6 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
return skb; return skb;
} }
/**
* vlan_put_tag - inserts VLAN tag according to device features
* @skb: skbuff to tag
* @vlan_tci: VLAN TCI to insert
*
* Assumes skb->dev is the target that will xmit this frame.
* Returns a VLAN tagged skb.
*/
static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb,
__be16 vlan_proto, u16 vlan_tci)
{
if (vlan_hw_offload_capable(skb->dev->features, vlan_proto)) {
return __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci);
} else {
return __vlan_put_tag(skb, vlan_proto, vlan_tci);
}
}
/** /**
* __vlan_get_tag - get the VLAN ID that is part of the payload * __vlan_get_tag - get the VLAN ID that is part of the payload
* @skb: skbuff to query * @skb: skbuff to query
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment