vlan: kill vlan_put_tag helper
authorJiri Pirko <jiri@resnulli.us>
Wed, 19 Nov 2014 13:04:57 +0000 (14:04 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 27 Apr 2015 20:48:33 +0000 (16:48 -0400)
[ Upstream commit b4bef1b57544b18899eb15569e3bafd8d2eeeff6 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bond_main.c
drivers/net/usb/cdc_mbim.c
include/linux/if_vlan.h

index d2eadab787c55d8fc0f361755409a880d64abfb3..4a69284570151e7e55c2c374ab073ba9b5ac7df7 100644 (file)
@@ -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);
@@ -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);
 }
index df3db17ee7e61cf23380545d5e940af05459001f..26764e7667d83086f6ee2a4219419cbbbebaa861 100644 (file)
@@ -2156,12 +2156,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:
index 5ee7a1dbc023833a5907a6db48695600bb728fd9..96fc8a5bde8416a471ed4cd07e657025bc222fab 100644 (file)
@@ -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;
 }
index d69f0577a319d6875ee62352717f45bbfe447a23..2b1283245b568601038183f6312922c7736ba93b 100644 (file)
@@ -356,24 +356,6 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *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
  * @skb: skbuff to query