public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: David Miller <davem@davemloft•net>, Jay Vosburgh <fubar@us•ibm.com>
Cc: netdev@vger•kernel.org, bonding-devel@lists•sourceforge.net
Subject: [RFC 4/4] bond: add new multiqueue hash policy
Date: Thu, 04 Feb 2010 09:11:22 -0800	[thread overview]
Message-ID: <20100204171241.463222870@vyatta.com> (raw)
In-Reply-To: 20100204171118.917737392@vyatta.com

[-- Attachment #1: bond-jhash.patch --]
[-- Type: text/plain, Size: 1686 bytes --]

This hash policy just uses existing transmit hash used for
mulitiqueue.

Signed-off-by: Stephen Hemminger <shemminger@vyatta•com>

--- a/drivers/net/bonding/bond_main.c	2010-02-04 08:57:52.356755294 -0800
+++ b/drivers/net/bonding/bond_main.c	2010-02-04 08:57:53.036755256 -0800
@@ -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;
--- a/include/linux/if_bonding.h	2010-02-04 08:56:35.956131096 -0800
+++ b/include/linux/if_bonding.h	2010-02-04 08:57:53.036755256 -0800
@@ -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;

-- 


  parent reply	other threads:[~2010-02-04 17:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04 17:11 [RFC 0/4] bond hashing revised Stephen Hemminger
2010-02-04 17:11 ` [RFC 1/4] bond: cleanup transmit hash policy interface Stephen Hemminger
2010-02-04 17:11 ` [RFC 2/4] bond: add IPV6 layer3 hash policy support Stephen Hemminger
2010-02-04 17:11 ` [RFC 3/4] bond: support more Layer 4 protocols Stephen Hemminger
2010-02-05 10:38   ` Patrick McHardy
2010-02-05 16:42     ` Stephen Hemminger
2010-02-08 13:11       ` Patrick McHardy
2010-02-04 17:11 ` Stephen Hemminger [this message]
2010-02-05  9:40 ` [RFC 0/4] bond hashing revised Jasper Spaans
2010-02-05 21:04   ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2010-02-19 17:54 [RFC 4/4] bond: add new multiqueue hash policy "Oleg A. Arkhangelsky"

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100204171241.463222870@vyatta.com \
    --to=shemminger@vyatta$(echo .)com \
    --cc=bonding-devel@lists$(echo .)sourceforge.net \
    --cc=davem@davemloft$(echo .)net \
    --cc=fubar@us$(echo .)ibm.com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox