Skip to content

Commit 6f477d4

Browse files
Veaceslav Falicodavem330
authored andcommitted
bonding: remove bond_vlan_used()
We're using it currently to verify if we have vlans before getting the tag from the skb we're about to send. It's useless because the vlan_get_tag() verifies if the skb has the tag (and returns an error if not), and we can receive tagged skbs only if we *already* have vlans. Plus, the current RCUed implementation is kind of useless anyway - the we can remove the last vlan in the moment we return from the function. So remove the only usage of it and the whole function. CC: Jay Vosburgh <[email protected]> CC: Andy Gospodarek <[email protected]> Signed-off-by: Veaceslav Falico <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c12a224 commit 6f477d4

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

drivers/net/bonding/bond_alb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,8 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
694694
client_info->ntt = 0;
695695
}
696696

697-
if (bond_vlan_used(bond)) {
698-
if (!vlan_get_tag(skb, &client_info->vlan_id))
699-
client_info->tag = 1;
700-
}
697+
if (!vlan_get_tag(skb, &client_info->vlan_id))
698+
client_info->tag = 1;
701699

702700
if (!client_info->assigned) {
703701
u32 prev_tbl_head = bond_info->rx_hashtbl_used_head;

drivers/net/bonding/bonding.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -261,24 +261,6 @@ struct bonding {
261261
#endif /* CONFIG_DEBUG_FS */
262262
};
263263

264-
/* if we hold rtnl_lock() - call vlan_uses_dev() */
265-
static inline bool bond_vlan_used(struct bonding *bond)
266-
{
267-
struct net_device *upper;
268-
struct list_head *iter;
269-
270-
rcu_read_lock();
271-
netdev_for_each_upper_dev_rcu(bond->dev, upper, iter) {
272-
if (upper->priv_flags & IFF_802_1Q_VLAN) {
273-
rcu_read_unlock();
274-
return true;
275-
}
276-
}
277-
rcu_read_unlock();
278-
279-
return false;
280-
}
281-
282264
#define bond_slave_get_rcu(dev) \
283265
((struct slave *) rcu_dereference(dev->rx_handler_data))
284266

0 commit comments

Comments
 (0)