From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Chevallier Subject: Re: [PATCH net-next v2] net: mvpp2: Don't use dynamic allocs for local variables Date: Wed, 21 Mar 2018 22:14:48 +0100 Message-ID: <20180321221448.7b3ecae8@bootlin.com> References: <20180321151400.6658-1-maxime.chevallier@bootlin.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Antoine Tenart , "thomas.petazzoni@bootlin.com" , "gregory.clement@bootlin.com" , "miquel.raynal@bootlin.com" , Nadav Haklai , "Stefan Chulski" , "mw@semihalf.com" To: Yan Markman Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Hello Yan, On Wed, 21 Mar 2018 19:57:47 +0000, Yan Markman wrote : > Hi Maxime Please avoid top-posting on this list. > Please check the TWO points: > > 1). The mvpp2_prs_flow_find() returns TID if found > The TID=0 is valid FOUND value > For Not-found use -ENOENT (just like your mvpp2_prs_vlan_find) This is actually what is used in this patch. You might be refering to a previous draft version of this patch. > 2). The original code always uses "mvpp2_prs_entry *pe" storage > Zero-Allocated Please check the correctnes of new "mvpp2_prs_entry > pe" without memset(pe, 0, sizeof(pe)); > in all procedures where pe=kzalloc() has been replaced I think we're good on that regard. On places where I didn't memset the prs_entry, the pe.index field is set, and this is followed by a read from TCAM that will initialize the prs_entry to the correct value : pe.index = tid; mvpp2_prs_hw_read(priv, &pe); > Thanks > Yan Markman [...] Thanks, Maxime