[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140715082028.GA28235@mikrodark.usersys.redhat.com>
Date: Tue, 15 Jul 2014 10:20:28 +0200
From: Veaceslav Falico <vfalico@...il.com>
To: Xie Jianhua <Jianhua.Xie@...escale.com>
Cc: netdev@...r.kernel.org, Jay Vosburgh <j.vosburgh@...il.com>,
Andy Gospodarek <andy@...yhouse.net>,
"David S. Miller" <davem@...emloft.net>,
Pan Jiafei <Jiafei.Pan@...escale.com>
Subject: Re: [PATCH net v2] bonding: enhance L2 hash helper with packet type
On Tue, Jul 15, 2014 at 03:41:23PM +0800, Xie Jianhua wrote:
>From: Jianhua Xie <jianhua.xie@...escale.com>
>
>Current L2 hash helper calculates destination eth addr and
>source ether addr as L2 hash factors. This patch is adding
>packet type ID field into hash factors, which can help to
>distribute different types of packets like IPv4/IPv6 packets
>to different slave devices while only BOND_XMIT_POLICY_LAYER2
>is applied.
1) It's also used in BOND_XMIT_POLICY_{LAYER|ENCAP}23, for the 2nd level
hash.
2) The documentation (D/networking/bonding.txt) also needs an update.
Otherwise, looks good.
>
>CC: Jay Vosburgh <j.vosburgh@...il.com>
>CC: Veaceslav Falico <vfalico@...il.com>
>CC: Andy Gospodarek <andy@...yhouse.net>
>CC: David S. Miller <davem@...emloft.net>
>CC: Pan Jiafei <Jiafei.Pan@...escale.com>
>
>Suggested-by: David S. Miller <davem@...emloft.net>
>Signed-off-by: Jianhua Xie <jianhua.xie@...escale.com>
>---
>
>v2-changes:
> Use the appropriate interface skb_header_pointer()
> to check skb headlen, fragmented packet or not is
> not distinguished any more.
>
>
> drivers/net/bonding/bond_main.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 3a451b6..bcff90c 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2999,11 +2999,11 @@ static struct notifier_block bond_netdev_notifier = {
> /* L2 hash helper */
> static inline u32 bond_eth_hash(struct sk_buff *skb)
> {
>- struct ethhdr *data = (struct ethhdr *)skb->data;
>-
>- if (skb_headlen(skb) >= offsetof(struct ethhdr, h_proto))
>- return data->h_dest[5] ^ data->h_source[5];
>+ struct ethhdr *ep, hdr_tmp;
>
>+ ep = skb_header_pointer(skb, 0, sizeof(hdr_tmp), &hdr_tmp);
>+ if (ep)
>+ return ep->h_dest[5] ^ ep->h_source[5] ^ ep->h_proto;
> return 0;
> }
>
>--
>1.8.5
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists