浏览代码

bonding: Remove bond_dev from xmit_hash_policy call.

Now that the bonding device is no longer used in determining the device to
which to send packets, it can be dropped from the argument list of the various
xmit_hash_policy calls.

Signed-off-by: Jasper Spaans <spaans@fox-it.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jasper Spaans 15 年之前
父节点
当前提交
a361c83cb4
共有 3 个文件被更改,包括 10 次插入15 次删除
  1. 5 6
      drivers/net/bonding/bond_3ad.c
  2. 4 7
      drivers/net/bonding/bond_main.c
  3. 1 2
      drivers/net/bonding/bonding.h

+ 5 - 6
drivers/net/bonding/bond_3ad.c

@@ -1956,7 +1956,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
 	struct port *port, *prev_port, *temp_port;
 	struct port *port, *prev_port, *temp_port;
 	struct aggregator *aggregator, *new_aggregator, *temp_aggregator;
 	struct aggregator *aggregator, *new_aggregator, *temp_aggregator;
 	int select_new_active_agg = 0;
 	int select_new_active_agg = 0;
-	
+
 	// find the aggregator related to this slave
 	// find the aggregator related to this slave
 	aggregator = &(SLAVE_AD_INFO(slave).aggregator);
 	aggregator = &(SLAVE_AD_INFO(slave).aggregator);
 
 
@@ -2024,7 +2024,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
 
 
 				// clear the aggregator
 				// clear the aggregator
 				ad_clear_agg(aggregator);
 				ad_clear_agg(aggregator);
-				
+
 				if (select_new_active_agg) {
 				if (select_new_active_agg) {
 					ad_agg_selection_logic(__get_first_agg(port));
 					ad_agg_selection_logic(__get_first_agg(port));
 				}
 				}
@@ -2075,7 +2075,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
 			}
 			}
 		}
 		}
 	}
 	}
-	port->slave=NULL;	
+	port->slave=NULL;
 }
 }
 
 
 /**
 /**
@@ -2301,7 +2301,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
 }
 }
 
 
 /*
 /*
- * set link state for bonding master: if we have an active 
+ * set link state for bonding master: if we have an active
  * aggregator, we're up, if not, we're down.  Presumes that we cannot
  * aggregator, we're up, if not, we're down.  Presumes that we cannot
  * have an active aggregator if there are no slaves with link up.
  * have an active aggregator if there are no slaves with link up.
  *
  *
@@ -2395,7 +2395,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
 		goto out;
 		goto out;
 	}
 	}
 
 
-	slave_agg_no = bond->xmit_hash_policy(skb, dev, slaves_in_agg);
+	slave_agg_no = bond->xmit_hash_policy(skb, slaves_in_agg);
 
 
 	bond_for_each_slave(bond, slave, i) {
 	bond_for_each_slave(bond, slave, i) {
 		struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
 		struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
@@ -2468,4 +2468,3 @@ out:
 
 
 	return ret;
 	return ret;
 }
 }
-

+ 4 - 7
drivers/net/bonding/bond_main.c

@@ -3696,8 +3696,7 @@ void bond_unregister_arp(struct bonding *bond)
  * Hash for the output device based upon layer 2 and layer 3 data. If
  * Hash for the output device based upon layer 2 and layer 3 data. If
  * the packet is not IP mimic bond_xmit_hash_policy_l2()
  * the packet is not IP mimic bond_xmit_hash_policy_l2()
  */
  */
-static int bond_xmit_hash_policy_l23(struct sk_buff *skb,
-				     struct net_device *bond_dev, int count)
+static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count)
 {
 {
 	struct ethhdr *data = (struct ethhdr *)skb->data;
 	struct ethhdr *data = (struct ethhdr *)skb->data;
 	struct iphdr *iph = ip_hdr(skb);
 	struct iphdr *iph = ip_hdr(skb);
@@ -3715,8 +3714,7 @@ static int bond_xmit_hash_policy_l23(struct sk_buff *skb,
  * the packet is a frag or not TCP or UDP, just use layer 3 data.  If it is
  * the packet is a frag or not TCP or UDP, just use layer 3 data.  If it is
  * altogether not IP, mimic bond_xmit_hash_policy_l2()
  * altogether not IP, mimic bond_xmit_hash_policy_l2()
  */
  */
-static int bond_xmit_hash_policy_l34(struct sk_buff *skb,
-				    struct net_device *bond_dev, int count)
+static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count)
 {
 {
 	struct ethhdr *data = (struct ethhdr *)skb->data;
 	struct ethhdr *data = (struct ethhdr *)skb->data;
 	struct iphdr *iph = ip_hdr(skb);
 	struct iphdr *iph = ip_hdr(skb);
@@ -3740,8 +3738,7 @@ static int bond_xmit_hash_policy_l34(struct sk_buff *skb,
 /*
 /*
  * Hash for the output device based upon layer 2 data
  * Hash for the output device based upon layer 2 data
  */
  */
-static int bond_xmit_hash_policy_l2(struct sk_buff *skb,
-				   struct net_device *bond_dev, int count)
+static int bond_xmit_hash_policy_l2(struct sk_buff *skb, int count)
 {
 {
 	struct ethhdr *data = (struct ethhdr *)skb->data;
 	struct ethhdr *data = (struct ethhdr *)skb->data;
 
 
@@ -4334,7 +4331,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
 	if (!BOND_IS_OK(bond))
 	if (!BOND_IS_OK(bond))
 		goto out;
 		goto out;
 
 
-	slave_no = bond->xmit_hash_policy(skb, bond_dev, bond->slave_cnt);
+	slave_no = bond->xmit_hash_policy(skb, bond->slave_cnt);
 
 
 	bond_for_each_slave(bond, slave, i) {
 	bond_for_each_slave(bond, slave, i) {
 		slave_no--;
 		slave_no--;

+ 1 - 2
drivers/net/bonding/bonding.h

@@ -206,7 +206,7 @@ struct bonding {
 #endif /* CONFIG_PROC_FS */
 #endif /* CONFIG_PROC_FS */
 	struct   list_head bond_list;
 	struct   list_head bond_list;
 	struct   dev_mc_list *mc_list;
 	struct   dev_mc_list *mc_list;
-	int      (*xmit_hash_policy)(struct sk_buff *, struct net_device *, int);
+	int      (*xmit_hash_policy)(struct sk_buff *, int);
 	__be32   master_ip;
 	__be32   master_ip;
 	u16      flags;
 	u16      flags;
 	u16      rr_tx_counter;
 	u16      rr_tx_counter;
@@ -377,4 +377,3 @@ static inline void bond_unregister_ipv6_notifier(void)
 #endif
 #endif
 
 
 #endif /* _LINUX_BONDING_H */
 #endif /* _LINUX_BONDING_H */
-