From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v5 1/5] i40e: Use constant random hash keys Date: Mon, 03 Nov 2014 09:59:10 +0100 Message-ID: <1526321.WRfZaPjy3u@xps13> References: <1413180766-12211-1-git-send-email-helin.zhang@intel.com> <1493143.C52zTo8RWN@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "Zhang, Helin" Return-path: In-Reply-To: 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" 2014-11-03 08:18, Zhang, Helin: > From: Thomas Monjalon [mailto:thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org] > > 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. Yes but this patch is only changing rss_key_default so I guess it's only related to RSS, right? > > - 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. Here, you remove the call to rte_rand by a constant value. > > 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 keys. > > > > 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.