[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <53C4DCB9.1050208@freescale.com>
Date: Tue, 15 Jul 2014 15:48:09 +0800
From: Jianhua Xie <jianhua.xie@...escale.com>
To: David Miller <davem@...emloft.net>
CC: <netdev@...r.kernel.org>, <j.vosburgh@...il.com>,
<vfalico@...il.com>, <andy@...yhouse.net>,
<Jiafei.Pan@...escale.com>
Subject: Re: [PATCH net] bonding: enhance L2 hash helper with packet type
On 7/15/2014 10:08 AM, David Miller wrote:
> From: Xie Jianhua <Jianhua.Xie@...escale.com>
> Date: Mon, 14 Jul 2014 14:05:26 +0800
>
>> @@ -3002,7 +3002,7 @@ 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];
>> + return data->h_dest[5] ^ data->h_source[5] ^ data->h_proto;
>>
>> return 0;
>> }
> About the headlen check, I don't like the idea that the hash depends upon
> whether we have a fully fragmented packet or not.
>
> Just use the appropriate interface, skb_header_pointer(), and recode this
> as:
>
> struct ethhdr *ep, _hdr;
>
> ep = skb_header_pointer(skb, 0, sizeof(_hdr), &_hdr);
> if (ep)
> return ep->h_dest[5] ^ ep->h_source[5] ^ ep->h_proto;
> return 0;
Many thanks, patch v2 is coming.
Best Regards,
Jianhua
--
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