|
@@ -3015,20 +3015,18 @@ static bool bond_flow_dissect(struct bonding *bond, struct sk_buff *skb,
|
|
|
* bond_xmit_hash - generate a hash value based on the xmit policy
|
|
|
* @bond: bonding device
|
|
|
* @skb: buffer to use for headers
|
|
|
- * @count: modulo value
|
|
|
*
|
|
|
* This function will extract the necessary headers from the skb buffer and use
|
|
|
* them to generate a hash based on the xmit_policy set in the bonding device
|
|
|
- * which will be reduced modulo count before returning.
|
|
|
*/
|
|
|
-int bond_xmit_hash(struct bonding *bond, struct sk_buff *skb, int count)
|
|
|
+u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb)
|
|
|
{
|
|
|
struct flow_keys flow;
|
|
|
u32 hash;
|
|
|
|
|
|
if (bond->params.xmit_policy == BOND_XMIT_POLICY_LAYER2 ||
|
|
|
!bond_flow_dissect(bond, skb, &flow))
|
|
|
- return bond_eth_hash(skb) % count;
|
|
|
+ return bond_eth_hash(skb);
|
|
|
|
|
|
if (bond->params.xmit_policy == BOND_XMIT_POLICY_LAYER23 ||
|
|
|
bond->params.xmit_policy == BOND_XMIT_POLICY_ENCAP23)
|
|
@@ -3039,7 +3037,7 @@ int bond_xmit_hash(struct bonding *bond, struct sk_buff *skb, int count)
|
|
|
hash ^= (hash >> 16);
|
|
|
hash ^= (hash >> 8);
|
|
|
|
|
|
- return hash % count;
|
|
|
+ return hash;
|
|
|
}
|
|
|
|
|
|
/*-------------------------- Device entry points ----------------------------*/
|
|
@@ -3666,7 +3664,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
|
|
|
{
|
|
|
struct bonding *bond = netdev_priv(bond_dev);
|
|
|
|
|
|
- bond_xmit_slave_id(bond, skb, bond_xmit_hash(bond, skb, bond->slave_cnt));
|
|
|
+ bond_xmit_slave_id(bond, skb, bond_xmit_hash(bond, skb) % bond->slave_cnt);
|
|
|
|
|
|
return NETDEV_TX_OK;
|
|
|
}
|