From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 179D93975 for ; Tue, 11 Nov 2014 04:21:05 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 10 Nov 2014 19:30:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,357,1413270000"; d="scan'208";a="629905914" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by fmsmga002.fm.intel.com with ESMTP; 10 Nov 2014 19:30:52 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 11 Nov 2014 11:30:28 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.62]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.242]) with mapi id 14.03.0195.001; Tue, 11 Nov 2014 11:30:26 +0800 From: "Zhang, Helin" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v5 1/5] i40e: Use constant random hash keys Thread-Index: AQHP9zv8pzWfqVE1VkCS4aq11NQwI5xOjDAQ//+IGACADLxy0A== Date: Tue, 11 Nov 2014 03:30:25 +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: Tue, 11 Nov 2014 03:21:06 -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 currently for rss only. >=20 > > > - a constant cannot be really random ;) The comments could be re-worded. > > > > 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. No need to calculate it every time, like what Linux i40e driver does. >=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