From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id 2BDDA3F9 for ; Fri, 6 Jun 2014 17:13:20 +0200 (CEST) Received: by mail-pd0-f182.google.com with SMTP id r10so2531071pdi.13 for ; Fri, 06 Jun 2014 08:13:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=O/GHBps5odbkjnKdxB2IqnJMwhuyaowTrzYb0AbUeXc=; b=G/Qmn5WkvECfgSBiqewGBk7xESEpy9PWBUXYkmS+mRIwQY3S5Gw9fveLrelfB5wIuk c7t3VQCU37ZgHblwRiCuq/gAD3OCr4YitJj0oN4mekl8oWX1A3qoFz+87tikG/ieiyoa /ksy1qCTM1oLvSMzspNGi5vin3FEcgQyiXXEDqHdhCG8RJRwpNbeDnRF0p2NsRY6WpMl SiEsbACATkeMq7zyU5f9ZoA/iefWNKFkESEw6mAfgInTA4PEql5uxLvyL45xTqGKYBFY uRPOQd9ImnnkpYUSVi5s0Of0Mf4zLHN0ufZZx1i+/rTlgP5UeJeVtlT5hnm95qchKC9d N1fg== X-Gm-Message-State: ALoCoQmYkpT00RTcBHAVRjDkqnQNI84FIQewGZtD4sMdlB/c3Qb8AHwCvxIto0D9OVyJl/LhjhGp X-Received: by 10.68.253.73 with SMTP id zy9mr1746326pbc.114.1402067613445; Fri, 06 Jun 2014 08:13:33 -0700 (PDT) Received: from nehalam.linuxnetplumber.net (static-50-53-83-51.bvtn.or.frontiernet.net. [50.53.83.51]) by mx.google.com with ESMTPSA id ib5sm36937549pbb.55.2014.06.06.08.13.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Jun 2014 08:13:33 -0700 (PDT) Date: Fri, 6 Jun 2014 08:13:30 -0700 From: Stephen Hemminger To: "Doherty, Declan" Message-ID: <20140606081330.7d5e3734@nehalam.linuxnetplumber.net> In-Reply-To: <345C63BAECC1AD42A2EC8C63AFFC3ADC13D3737A@IRSMSX101.ger.corp.intel.com> References: <20140605081557.42a797e8@nehalam.linuxnetplumber.net> <345C63BAECC1AD42A2EC8C63AFFC3ADC13D3737A@IRSMSX101.ger.corp.intel.com> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 1/4] Link Bonding Library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 15:13:20 -0000 On Fri, 6 Jun 2014 09:07:23 +0000 "Doherty, Declan" wrote: > > -----Original Message----- > > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > > Sent: Thursday, June 5, 2014 4:16 PM > > To: Doherty, Declan > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] Link Bonding Library > > > > On Wed, 4 Jun 2014 16:18:02 +0100 > > declan.doherty@intel.com 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 but to help balance traffic flows across the slaves of the bonded device, and as we are doing a modulus calculation based on the number of slaves attached, 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 = (struct ethhdr *)skb->data; > > if (skb_headlen(skb) >= 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 better 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 sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. > > The ether hash is very quick using multplicative hash on 64 bit value.