Skip to contentSkip to conversation

net: remove the unnecessary dance around skb_bond_should_drop

PATCH Applied Jiri Pirko 3 participants 3 messages Feb 12, 2011 – Feb 13, 2011

Subsystems (2)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 net: remove the unnecessary dance around skb_bond_should_drop

No need to check (master) twice and to drive in and out the header file.

---
 include/linux/netdevice.h |   11 -----------
 net/core/dev.c            |    6 +++---
 2 files changed, 3 insertions(+), 14 deletions(-)
include/linux/netdevice.h +0 -11
index c7d7074..5a5baea 100644
@@ -2437,17 +2437,6 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
 	dev->gso_max_size = size;
 }
 
-extern int __skb_bond_should_drop(struct sk_buff *skb,
-				  struct net_device *master);
-
-static inline int skb_bond_should_drop(struct sk_buff *skb,
-				       struct net_device *master)
-{
-	if (master)
-		return __skb_bond_should_drop(skb, master);
-	return 0;
-}
-
 extern struct pernet_operations __net_initdata loopback_net_ops;
 
 static inline int dev_ethtool_get_settings(struct net_device *dev,
net/core/dev.c +3 -3
index 6392ea0..d874fd1 100644
@@ -3105,7 +3105,8 @@ static inline void skb_bond_set_mac_by_master(struct sk_buff *skb,
  * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
  * ARP on active-backup slaves with arp_validate enabled.
  */
-int __skb_bond_should_drop(struct sk_buff *skb, struct net_device *master)
+static int __skb_bond_should_drop(struct sk_buff *skb,
+				  struct net_device *master)
 {
 	struct net_device *dev = skb->dev;
 
@@ -3139,7 +3140,6 @@ int __skb_bond_should_drop(struct sk_buff *skb, struct net_device *master)
 	}
 	return 0;
 }
-EXPORT_SYMBOL(__skb_bond_should_drop);
 
 static int __netif_receive_skb(struct sk_buff *skb)
 {
@@ -3177,7 +3177,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
 	if (skb->deliver_no_wcard)
 		null_or_orig = orig_dev;
 	else if (master) {
-		if (skb_bond_should_drop(skb, master)) {
+		if (__skb_bond_should_drop(skb, master)) {
 			skb->deliver_no_wcard = 1;
 			null_or_orig = orig_dev; /* deliver only exact match */
 		} else
Signature · 1 line
1.7.3.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Jiri Pirko

No need to check (master) twice and to drive in and out the header file.

Quoted 58 lines
---
  include/linux/netdevice.h |   11 -----------
  net/core/dev.c            |    6 +++---
  2 files changed, 3 insertions(+), 14 deletions(-)
include/linux/netdevice.h +0 -11
index c7d7074..5a5baea 100644
@@ -2437,17 +2437,6 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
  	dev->gso_max_size = size;
  }
 
-extern int __skb_bond_should_drop(struct sk_buff *skb,
-				  struct net_device *master);
-
-static inline int skb_bond_should_drop(struct sk_buff *skb,
-				       struct net_device *master)
-{
-	if (master)
-		return __skb_bond_should_drop(skb, master);
-	return 0;
-}
-
  extern struct pernet_operations __net_initdata loopback_net_ops;
 
  static inline int dev_ethtool_get_settings(struct net_device *dev,
net/core/dev.c +3 -3
index 6392ea0..d874fd1 100644
@@ -3105,7 +3105,8 @@ static inline void skb_bond_set_mac_by_master(struct sk_buff *skb,
   * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
   * ARP on active-backup slaves with arp_validate enabled.
   */
-int __skb_bond_should_drop(struct sk_buff *skb, struct net_device *master)
+static int __skb_bond_should_drop(struct sk_buff *skb,
+				  struct net_device *master)
  {
  	struct net_device *dev = skb->dev;
 
@@ -3139,7 +3140,6 @@ int __skb_bond_should_drop(struct sk_buff *skb, struct net_device *master)
  	}
  	return 0;
  }
-EXPORT_SYMBOL(__skb_bond_should_drop);
 
  static int __netif_receive_skb(struct sk_buff *skb)
  {
@@ -3177,7 +3177,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
  	if (skb->deliver_no_wcard)
  		null_or_orig = orig_dev;
  	else if (master) {
-		if (skb_bond_should_drop(skb, master)) {
+		if (__skb_bond_should_drop(skb, master)) {
  			skb->deliver_no_wcard = 1;
  			null_or_orig = orig_dev; /* deliver only exact match */
  		} else