vlan: rename __vlan_find_dev_deep() to __vlan_find_dev_deep_rcu_rcu()
Subsystems (11)
PATCH 1/1 vlan: rename __vlan_find_dev_deep() to __vlan_find_dev_deep_rcu_rcu()
The __vlan_find_dev_deep should always called in RCU, according David's suggestion, rename to __vlan_find_dev_deep_rcu looks more reasonable.
Signed-off-by Ding Tianhong <[email protected]>
--- drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 2 +- drivers/net/usb/cdc_mbim.c | 2 +- drivers/s390/net/qeth_l3_main.c | 10 +++++----- include/linux/if_vlan.h | 4 ++-- net/8021q/vlan_core.c | 6 +++--- net/bridge/br_netfilter.c | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-)
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +1 -1
@@ -185,7 +185,7 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter,if (ether_addr_equal (dev->dev_addr, mac)) {rcu_read_lock ();if (vlan && vlan !=VLAN_VID_MASK ) { - dev =__vlan_find_dev_deep (dev,htons (ETH_P_8021Q ), vlan); + dev =__vlan_find_dev_deep_rcu (dev,htons (ETH_P_8021Q ), vlan); }else if (netif_is_bond_slave (dev)) {struct net_device *upper_dev;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 -1
@@ -4061,7 +4061,7 @@ static int update_root_dev_clip(struct net_device *dev)/* Parse all bond and vlan devices layered on top of the physical dev */ for (i =0 ; i <VLAN_N_VID ; i++) { - root_dev =__vlan_find_dev_deep (dev,htons (ETH_P_8021Q ), i); + root_dev =__vlan_find_dev_deep_rcu (dev,htons (ETH_P_8021Q ), i);if (!root_dev)continue ;
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -1
@@ -4122,7 +4122,7 @@ void qlcnic_restore_indev_addr(struct net_device *netdev, unsigned long event)rcu_read_lock ();for_each_set_bit (vid, adapter->vlans,VLAN_N_VID ) { - dev =__vlan_find_dev_deep (netdev,htons (ETH_P_8021Q ), vid); + dev =__vlan_find_dev_deep_rcu (netdev,htons (ETH_P_8021Q ), vid);if (!dev)continue ;qlcnic_config_indev_addr (adapter, dev, event);
drivers/net/usb/cdc_mbim.c +1 -1
@@ -206,7 +206,7 @@ static void do_neigh_solicit(struct usbnet *dev, u8 *buf, u16 tci)/* need to send the NA on the VLAN dev, if any */ rcu_read_lock ();if (tci) { - netdev =__vlan_find_dev_deep (dev->net,htons (ETH_P_8021Q ), + netdev =__vlan_find_dev_deep_rcu (dev->net,htons (ETH_P_8021Q ), tci);if (!netdev) {rcu_read_unlock ();
drivers/s390/net/qeth_l3_main.c +5 -5
@@ -1659,7 +1659,7 @@ static void qeth_l3_add_vlan_mc(struct qeth_card *card)for_each_set_bit (vid, card->active_vlans,VLAN_N_VID ) {struct net_device *netdev; - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);if (netdev ==NULL || !(netdev->flags &IFF_UP ))
@@ -1721,7 +1721,7 @@ static void qeth_l3_add_vlan_mc6(struct qeth_card *card)for_each_set_bit (vid, card->active_vlans,VLAN_N_VID ) {struct net_device *netdev; - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);if (netdev ==NULL || !(netdev->flags &IFF_UP ))
@@ -1766,7 +1766,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,QETH_CARD_TEXT (card,4 ,"frvaddr4" ); - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), vid); + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);if (!netdev)return ; in_dev =in_dev_get (netdev);
@@ -1796,7 +1796,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,QETH_CARD_TEXT (card,4 ,"frvaddr6" ); - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), vid); + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);if (!netdev)return ; in6_dev =in6_dev_get (netdev);
@@ -2089,7 +2089,7 @@ static int qeth_l3_verify_vlan_dev(struct net_device *dev,struct net_device *netdev;rcu_read_lock (); - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);rcu_read_unlock ();if (netdev == dev) {
include/linux/if_vlan.h +2 -2
@@ -106,7 +106,7 @@ struct vlan_pcpu_stats {#if defined(CONFIG_VLAN_8021Q ) || defined(CONFIG_VLAN_8021Q_MODULE ) -extern struct net_device *__vlan_find_dev_deep (struct net_device *real_dev, +extern struct net_device *__vlan_find_dev_deep_rcu (struct net_device *real_dev,__be16 vlan_proto,u16 vlan_id);extern struct net_device *vlan_dev_real_dev (const struct net_device *dev);extern u16 vlan_dev_vlan_id (const struct net_device *dev);
@@ -199,7 +199,7 @@ extern void vlan_vids_del_by_dev(struct net_device *dev,extern bool vlan_uses_dev (const struct net_device *dev);#else static inline struct net_device * -__vlan_find_dev_deep (struct net_device *real_dev, +__vlan_find_dev_deep_rcu (struct net_device *real_dev,__be16 vlan_proto,u16 vlan_id) {return NULL ;
net/8021q/vlan_core.c +3 -3
@@ -63,7 +63,7 @@ bool vlan_do_receive(struct sk_buff **skbp) }/* Must be invoked with rcu_read_lock. */ -struct net_device *__vlan_find_dev_deep (struct net_device *dev, +struct net_device *__vlan_find_dev_deep_rcu (struct net_device *dev,__be16 vlan_proto,u16 vlan_id) {struct vlan_info *vlan_info =rcu_dereference (dev->vlan_info);
@@ -81,13 +81,13 @@ struct net_device *__vlan_find_dev_deep(struct net_device *dev, upper_dev =netdev_master_upper_dev_get_rcu (dev);if (upper_dev) -return __vlan_find_dev_deep (upper_dev, +return __vlan_find_dev_deep_rcu (upper_dev, vlan_proto, vlan_id); }return NULL ; } -EXPORT_SYMBOL (__vlan_find_dev_deep); +EXPORT_SYMBOL (__vlan_find_dev_deep_rcu);struct net_device *vlan_dev_real_dev (const struct net_device *dev) {
net/bridge/br_netfilter.c +1 -1
@@ -535,7 +535,7 @@ static struct net_device *brnf_get_logical_dev(struct sk_buff *skb, const structif (brnf_pass_vlan_indev ==0 || !vlan_tx_tag_present (skb))return br; - vlan =__vlan_find_dev_deep (br, skb->vlan_proto, + vlan =__vlan_find_dev_deep_rcu (br, skb->vlan_proto,vlan_tx_tag_get (skb) &VLAN_VID_MASK );return vlan ? vlan : br;
Signature · 1 line
1.8.0
Quoted 5 lines · Ding Tianhong
The
__vlan_find_dev_deepshould always called in RCU, according David's suggestion, rename to__vlan_find_dev_deep_rculooks more reasonable.Signed-off-by Ding Tianhong <[email protected]>
Self Nacked, I make this patch from net repository, and could not applied to net-next, I will fix this and resend for net-next repository, sorry for the noise.
Ding
Quoted 177 lines
--- drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 2 +- drivers/net/usb/cdc_mbim.c | 2 +- drivers/s390/net/qeth_l3_main.c | 10 +++++----- include/linux/if_vlan.h | 4 ++-- net/8021q/vlan_core.c | 6 +++--- net/bridge/br_netfilter.c | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-)drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +1
-1@@ -185,7 +185,7 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter,if (ether_addr_equal (dev->dev_addr, mac)) {rcu_read_lock ();if (vlan && vlan !=VLAN_VID_MASK ) { - dev =__vlan_find_dev_deep (dev,htons (ETH_P_8021Q ), vlan); + dev =__vlan_find_dev_deep_rcu (dev,htons (ETH_P_8021Q ), vlan); }else if (netif_is_bond_slave (dev)) {struct net_device *upper_dev;drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1
-1@@ -4061,7 +4061,7 @@ static int update_root_dev_clip(struct net_device *dev)/* Parse all bond and vlan devices layered on top of the physical dev */ for (i =0 ; i <VLAN_N_VID ; i++) { - root_dev =__vlan_find_dev_deep (dev,htons (ETH_P_8021Q ), i); + root_dev =__vlan_find_dev_deep_rcu (dev,htons (ETH_P_8021Q ), i);if (!root_dev)continue ;drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1
-1@@ -4122,7 +4122,7 @@ void qlcnic_restore_indev_addr(struct net_device *netdev, unsigned long event)rcu_read_lock ();for_each_set_bit (vid, adapter->vlans,VLAN_N_VID ) { - dev =__vlan_find_dev_deep (netdev,htons (ETH_P_8021Q ), vid); + dev =__vlan_find_dev_deep_rcu (netdev,htons (ETH_P_8021Q ), vid);if (!dev)continue ;qlcnic_config_indev_addr (adapter, dev, event);drivers/net/usb/cdc_mbim.c +1
-1@@ -206,7 +206,7 @@ static void do_neigh_solicit(struct usbnet *dev, u8 *buf, u16 tci)/* need to send the NA on the VLAN dev, if any */ rcu_read_lock ();if (tci) { - netdev =__vlan_find_dev_deep (dev->net,htons (ETH_P_8021Q ), + netdev =__vlan_find_dev_deep_rcu (dev->net,htons (ETH_P_8021Q ), tci);if (!netdev) {rcu_read_unlock ();drivers/s390/net/qeth_l3_main.c +5
-5@@ -1659,7 +1659,7 @@ static void qeth_l3_add_vlan_mc(struct qeth_card *card)for_each_set_bit (vid, card->active_vlans,VLAN_N_VID ) {struct net_device *netdev; - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);if (netdev ==NULL || !(netdev->flags &IFF_UP ))@@ -1721,7 +1721,7 @@ static void qeth_l3_add_vlan_mc6(struct qeth_card *card)for_each_set_bit (vid, card->active_vlans,VLAN_N_VID ) {struct net_device *netdev; - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);if (netdev ==NULL || !(netdev->flags &IFF_UP ))@@ -1766,7 +1766,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,QETH_CARD_TEXT (card,4 ,"frvaddr4" ); - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), vid); + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);if (!netdev)return ; in_dev =in_dev_get (netdev);@@ -1796,7 +1796,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,QETH_CARD_TEXT (card,4 ,"frvaddr6" ); - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), vid); + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);if (!netdev)return ; in6_dev =in6_dev_get (netdev);@@ -2089,7 +2089,7 @@ static int qeth_l3_verify_vlan_dev(struct net_device *dev,struct net_device *netdev;rcu_read_lock (); - netdev =__vlan_find_dev_deep (card->dev,htons (ETH_P_8021Q ), + netdev =__vlan_find_dev_deep_rcu (card->dev,htons (ETH_P_8021Q ), vid);rcu_read_unlock ();if (netdev == dev) {include/linux/if_vlan.h +2
-2@@ -106,7 +106,7 @@ struct vlan_pcpu_stats {#if defined(CONFIG_VLAN_8021Q ) || defined(CONFIG_VLAN_8021Q_MODULE ) -extern struct net_device *__vlan_find_dev_deep (struct net_device *real_dev, +extern struct net_device *__vlan_find_dev_deep_rcu (struct net_device *real_dev,__be16 vlan_proto,u16 vlan_id);extern struct net_device *vlan_dev_real_dev (const struct net_device *dev);extern u16 vlan_dev_vlan_id (const struct net_device *dev);@@ -199,7 +199,7 @@ extern void vlan_vids_del_by_dev(struct net_device *dev,extern bool vlan_uses_dev (const struct net_device *dev);#else static inline struct net_device * -__vlan_find_dev_deep (struct net_device *real_dev, +__vlan_find_dev_deep_rcu (struct net_device *real_dev,__be16 vlan_proto,u16 vlan_id) {return NULL ;net/8021q/vlan_core.c +3
-3@@ -63,7 +63,7 @@ bool vlan_do_receive(struct sk_buff **skbp) }/* Must be invoked with rcu_read_lock. */ -struct net_device *__vlan_find_dev_deep (struct net_device *dev, +struct net_device *__vlan_find_dev_deep_rcu (struct net_device *dev,__be16 vlan_proto,u16 vlan_id) {struct vlan_info *vlan_info =rcu_dereference (dev->vlan_info);@@ -81,13 +81,13 @@ struct net_device *__vlan_find_dev_deep(struct net_device *dev, upper_dev =netdev_master_upper_dev_get_rcu (dev);if (upper_dev) -return __vlan_find_dev_deep (upper_dev, +return __vlan_find_dev_deep_rcu (upper_dev, vlan_proto, vlan_id); }return NULL ; } -EXPORT_SYMBOL (__vlan_find_dev_deep); +EXPORT_SYMBOL (__vlan_find_dev_deep_rcu);struct net_device *vlan_dev_real_dev (const struct net_device *dev) {net/bridge/br_netfilter.c +1
-1@@ -535,7 +535,7 @@ static struct net_device *brnf_get_logical_dev(struct sk_buff *skb, const structif (brnf_pass_vlan_indev ==0 || !vlan_tx_tag_present (skb))return br; - vlan =__vlan_find_dev_deep (br, skb->vlan_proto, + vlan =__vlan_find_dev_deep_rcu (br, skb->vlan_proto,vlan_tx_tag_get (skb) &VLAN_VID_MASK );return vlan ? vlan : br;