From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 8FBCD5947 for ; Thu, 6 Nov 2014 08:44:47 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 05 Nov 2014 23:47:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="412289370" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by FMSMGA003.fm.intel.com with ESMTP; 05 Nov 2014 23:45:36 -0800 Received: from kmsmsx153.gar.corp.intel.com (172.21.73.88) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 6 Nov 2014 15:52:55 +0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 6 Nov 2014 15:52:54 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.174]) by shsmsx102.ccr.corp.intel.com ([169.254.2.156]) with mapi id 14.03.0195.001; Thu, 6 Nov 2014 15:52:53 +0800 From: "Zhang, Helin" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v5 1/5] i40e: Use constant random hash keys Thread-Index: AQHP9zv8pzWfqVE1VkCS4aq11NQwI5xOjDAQ//+IGACABSkBoA== Date: Thu, 6 Nov 2014 07:52:53 +0000 Message-ID: References: <1413180766-12211-1-git-send-email-helin.zhang@intel.com> <1493143.C52zTo8RWN@xps13> <1526321.WRfZaPjy3u@xps13> In-Reply-To: <1526321.WRfZaPjy3u@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v5 1/5] i40e: Use constant random hash keys 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: Thu, 06 Nov 2014 07:44:48 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Monday, November 3, 2014 4:59 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v5 1/5] i40e: Use constant random hash key= s >=20 > 2014-11-03 08:18, Zhang, Helin: > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > > The title is a bit surprising: > > > - it should be about RSS > > > > RSS makes use of hash function to route received packets, though hash > > function can be used for other cases, e.g. Flow director. >=20 > Yes but this patch is only changing rss_key_default so I guess it's only = related to > RSS, right? Yes, it is related to RSS. >=20 > > > - a constant cannot be really random ;) > > > > The hash keys are generated by libc random function. > > It is preparatory to avoid calling random function for each port. >=20 > Here, you remove the call to rte_rand by a constant value. Yes, actually the hardware just needs random keys by default, no matter wha= t the real data it is. So array of random data would be better, as no need of cpu= cycles, and it is safer in multi-threads environments. >=20 > > > 2014-10-21 11:14, Helin Zhang: > > > > To be simpler, and remove the race condition, it uses prepared > > > > constant random hash keys to replace runtime generating the hash ke= ys. > > > > > > Could you explain what is the role of rss_key_default? > > > > Hash function needs to be configured with keys, before end users > > configured them with specific keys, we need to provide a default keys > > which is generated by libc random function. > > The random keys can get the hash function to route the received > > packets to all the queues well-proportioned. Regards, Helin