From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 09/33] crypto/octeontx: adds symmetric capabilities Date: Mon, 08 Oct 2018 22:27:55 +0200 Message-ID: <30793843.hyrbbjGcfd@xps> References: <1528476325-15585-1-git-send-email-anoob.joseph@caviumnetworks.com> <46633655.Q4LKdWAF6e@xps> <348A99DA5F5B7549AA880327E580B43589645898@IRSMSX101.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: "dev@dpdk.org" , Akhil Goyal , Anoob Joseph , "De Lara Guarch, Pablo" , Murthy NSSR , Jerin Jacob , Narayana Prasad , Ankur Dwivedi , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj To: "Trahe, Fiona" , "Joseph, Anoob" Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 640441B188 for ; Mon, 8 Oct 2018 22:27:59 +0200 (CEST) In-Reply-To: <348A99DA5F5B7549AA880327E580B43589645898@IRSMSX101.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 08/10/2018 17:59, Trahe, Fiona: > Hi Akhil, Joseph, Thomas, > Just spotted this now. > See below. > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > 24/09/2018 13:36, Joseph, Anoob: > > > Hi Fiona, > > > > > > Can you please comment on this? > > > > > > We are adding all capabilities of octeontx-crypto PMD as a macro in > > > otx_cryptodev_capabilites.h file and then we are using it from > > > otx_cryptodev_ops.c. This is the approach followed by QAT crypto PMD. As > > > per my understanding, this is to ensure that cryptodev_ops file remains > > > simple. For other PMDs with fewer number of capabilities, the structure > > > can be populated in the .c file itself without the size of the file > > > coming into the picture. > > > > > > But this would cause checkpatch to report error. Akhil's suggestion is > > > to move the entire definition to a header and include it from the .c > > > file. I believe, the QAT approach was to avoid variable definition in > > > the header. What do you think would be a better approach here? > > > > I think we should avoid adding some code in a .h file. > > And it is even worst when using macros. > > > > I suggest defining the capabilities in a .c file. > > If you don't want to bloat the main .c file, you can create a function > > defined in another .c file. > > > I can't remember all the variations we tried, but there were a few. > I think the macro works well in this case. > What is the issue we need to solve? It is a discussion about best practice. My answer is: avoid long macros and avoid instructions in .h file.