Skip to content

Commit

Permalink
vlan: kill vlan_put_tag helper
Browse files Browse the repository at this point in the history
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: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Nov 21, 2014
1 parent b960a0a commit b4bef1b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 39 deletions.
17 changes: 4 additions & 13 deletions drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,8 @@ static void rlb_update_client(struct rlb_client_info *client_info)
skb->dev = client_info->slave->dev;

if (client_info->vlan_id) {
skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id);
if (!skb) {
netdev_err(client_info->slave->bond->dev,
"failed to insert VLAN tag\n");
continue;
}
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
client_info->vlan_id);
}

arp_xmit(skb);
Expand Down Expand Up @@ -951,13 +947,8 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
skb->priority = TC_PRIO_CONTROL;
skb->dev = slave->dev;

if (vid) {
skb = vlan_put_tag(skb, vlan_proto, vid);
if (!skb) {
netdev_err(slave->bond->dev, "failed to insert VLAN tag\n");
return;
}
}
if (vid)
__vlan_hwaccel_put_tag(skb, vlan_proto, vid);

dev_queue_xmit(skb);
}
Expand Down
8 changes: 2 additions & 6 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2159,12 +2159,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
if (outer_tag->vlan_id) {
netdev_dbg(slave_dev, "outer tag: proto %X vid %X\n",
ntohs(outer_tag->vlan_proto), outer_tag->vlan_id);
skb = vlan_put_tag(skb, outer_tag->vlan_proto,
outer_tag->vlan_id);
if (!skb) {
net_err_ratelimited("failed to insert outer VLAN tag\n");
return;
}
__vlan_hwaccel_put_tag(skb, outer_tag->vlan_proto,
outer_tag->vlan_id);
}

xmit:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/cdc_mbim.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ static struct sk_buff *cdc_mbim_process_dgram(struct usbnet *dev, u8 *buf, size_

/* map MBIM session to VLAN */
if (tci)
vlan_put_tag(skb, htons(ETH_P_8021Q), tci);
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tci);
err:
return skb;
}
Expand Down
19 changes: 0 additions & 19 deletions include/linux/if_vlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,25 +354,6 @@ static inline void __vlan_hwaccel_put_tag(struct sk_buff *skb,
skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci;
}

/**
* 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)) {
__vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci);
return skb;
} else {
return __vlan_put_tag(skb, vlan_proto, vlan_tci);
}
}

/**
* __vlan_get_tag - get the VLAN ID that is part of the payload
* @skb: skbuff to query
Expand Down

0 comments on commit b4bef1b

Please sign in to comment.