All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jianhua Xie <jianhua.xie@freescale.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <j.vosburgh@gmail.com>,
	<vfalico@gmail.com>, <andy@greyhouse.net>,
	<Jiafei.Pan@freescale.com>
Subject: Re: [PATCH net] bonding: enhance L2 hash helper with packet type
Date: Tue, 15 Jul 2014 15:48:09 +0800	[thread overview]
Message-ID: <53C4DCB9.1050208@freescale.com> (raw)
In-Reply-To: <20140714.190839.1595507738609644305.davem@davemloft.net>

On 7/15/2014 10:08 AM, David Miller wrote:
> From: Xie Jianhua <Jianhua.Xie@freescale.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

      reply	other threads:[~2014-07-15  7:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14  6:05 [PATCH net] bonding: enhance L2 hash helper with packet type Xie Jianhua
2014-07-14  9:15 ` Eric Dumazet
2014-07-14 11:17   ` Jianhua Xie
2014-07-15  2:08 ` David Miller
2014-07-15  7:48   ` Jianhua Xie [this message]

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=53C4DCB9.1050208@freescale.com \
    --to=jianhua.xie@freescale.com \
    --cc=Jiafei.Pan@freescale.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=j.vosburgh@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vfalico@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.