@@ -190,6 +190,7 @@ const struct bond_parm_tbl xmit_hashtype
{ "layer2", BOND_XMIT_POLICY_LAYER2},
{ "layer3+4", BOND_XMIT_POLICY_LAYER34},
{ "layer2+3", BOND_XMIT_POLICY_LAYER23},
+{ "multiqueue", BOND_XMIT_POLICY_MQ},
{ NULL, -1},
};
@@ -3670,6 +3671,13 @@ static u16 bond_xmit_hash_policy_l34(con
}
+/*
+ * Hash for the output device based on multiqueue transmit hash policy
+ */
+static u16 bond_xmit_hash_policy_mq(const struct sk_buff *skb)
+{
+ return skb_tx_hash(skb->dev, skb);
+}
/*-------------------------- Device entry points ----------------------------*/
@@ -4350,6 +4358,9 @@ out:
static void bond_set_xmit_hash_policy(struct bonding *bond)
{
switch (bond->params.xmit_policy) {
+ case BOND_XMIT_POLICY_MQ:
+ bond->xmit_hash_policy = bond_xmit_hash_policy_mq;
+ break;
case BOND_XMIT_POLICY_LAYER23:
bond->xmit_hash_policy = bond_xmit_hash_policy_l23;
break;
@@ -87,6 +87,7 @@
#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */
#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */
#define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */
+#define BOND_XMIT_POLICY_MQ 3 /* transmit hash (multiqueue) */
typedef struct ifbond {
__s32 bond_mode;
This hash policy just uses existing transmit hash used for mulitiqueue. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>