* [RFC 4/4] bond: add new multiqueue hash policy
2010-02-04 17:11 [RFC 0/4] bond hashing revised Stephen Hemminger
@ 2010-02-04 17:11 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2010-02-04 17:11 UTC (permalink / raw)
To: David Miller, Jay Vosburgh; +Cc: netdev, bonding-devel
[-- 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;
--
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC 4/4] bond: add new multiqueue hash policy
@ 2010-02-19 17:54 "Oleg A. Arkhangelsky"
0 siblings, 0 replies; 2+ messages in thread
From: "Oleg A. Arkhangelsky" @ 2010-02-19 17:54 UTC (permalink / raw)
To: netdev
Hello Stephen,
> This hash policy just uses existing transmit hash used for
> mulitiqueue.
> Signed-off-by: Stephen Hemminger
> +/*
> + * 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);
> +}
I think that it would be better to use something like this here:
return skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0;
Bonding is currently non-multiqueue aware and skb_tx_hash() will return zero
everytime.
--
wbr, Oleg.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-19 17:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-19 17:54 [RFC 4/4] bond: add new multiqueue hash policy "Oleg A. Arkhangelsky"
-- strict thread matches above, loose matches on Subject: below --
2010-02-04 17:11 [RFC 0/4] bond hashing revised Stephen Hemminger
2010-02-04 17:11 ` [RFC 4/4] bond: add new multiqueue hash policy Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).