From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Doherty, Declan" Subject: Re: [PATCH v2 1/4] Link Bonding Library Date: Fri, 6 Jun 2014 09:07:23 +0000 Message-ID: <345C63BAECC1AD42A2EC8C63AFFC3ADC13D3737A@IRSMSX101.ger.corp.intel.com> References: <20140605081557.42a797e8@nehalam.linuxnetplumber.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: "dev-VfR2kkLFssw@public.gmane.org" Return-path: In-Reply-To: <20140605081557.42a797e8-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org> Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" > -----Original Message----- > From: Stephen Hemminger [mailto:stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org] > Sent: Thursday, June 5, 2014 4:16 PM > To: Doherty, Declan > Cc: dev-VfR2kkLFssw@public.gmane.org > Subject: Re: [dpdk-dev] [PATCH v2 1/4] Link Bonding Library > = > On Wed, 4 Jun 2014 16:18:02 +0100 > declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote: > = > > From: Declan Doherty > > > > - Broadcast TX burst broadcast bug fix > > - Add/remove slave behavior fix > > - Checkpatch fixes > > > > Signed-off-by: Declan Doherty > = > There are some pretty weak hash functions in there. > = > What about using: > ..... Hi Stephen, I suppose the naming of these as hash functions is probably misleading, the= aim is not to create a unique hash for each flow with minimal collisions b= ut to help balance traffic flows across the slaves of the bonded device, a= nd as we are doing a modulus calculation based on the number of slaves atta= ched, which I believe will typically be in the 2-4 range, I'm not sure that= a stronger hashing function will give a better balance of flows across the= slaves. For example in the Linux kernel implementation of the link bonding= driver the mac hashing only uses the last byte of src & dst mac addresses = to calculate it's eth hash. /* L2 hash helper */ static inline u32 bond_eth_hash(struct sk_buff *skb) { struct ethhdr *data =3D (struct ethhdr *)skb->data; if (skb_headlen(skb) >=3D offsetof(struct ethhdr, h_proto)) return data->h_dest[5] ^ data->h_source[5]; return 0; } I'll investigate and see if a stronger hashing function will result in a be= tter balancing of flows. -------------------------------------------------------------- Intel Shannon Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 Business address: Dromore House, East Park, Shannon, Co. Clare This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). Any review or distribution by others = is strictly prohibited. If you are not the intended recipient, please conta= ct the sender and delete all copies.