From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas@monjalon.net>
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com
 [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 640441B188
 for <dev@dpdk.org>; Mon,  8 Oct 2018 22:27:59 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id EA97621F4F;
 Mon,  8 Oct 2018 16:27:58 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Mon, 08 Oct 2018 16:27:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=mesmtp;
 bh=8+LZNezeYym+Pd8XZIz5rK0RL/+5dREhHEP2CdVfjLQ=; b=MGJ33KPEivqP
 Gf9y1J4L2C18fAEm1HJMHQngX1qQdKVnnq5KbJD9yhHbzHCQ4FnuKnS1lBY5ZxH/
 gCOdAlfKhegkVc5sNB161fIVs00P/2qo6aP9PBfS+AcffFfR5VyWXCGaMDA+Cu9z
 x2nwIx9fkK9JvwePEWAObaVHhPOU/jI=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm3; bh=8+LZNezeYym+Pd8XZIz5rK0RL/+5dREhHEP2CdVfj
 LQ=; b=Lc+NCZPZZQ6CTJVWw3VgnjszYWNOqm4ay7jOTpxsUr2tjgFIaEAQRDd1d
 db7F5KAx5Si38uW237RPHDuEdVITwOly5O89axGgEd17Dl1SkF4muL5IBvgPVgaK
 dsOqWFmmS79FeOeDPxcduwaC1uogFOvuJ7gjccR3qN7HhXZqCg3VHP5hqyuhQ6KF
 xz5WdbsMdiYVZhOP8SGTnAmc75X/vVx0gdvg0hjDEK8EOdfqG0iOyepdtuxsieqI
 gUvSgT6yzdCqDhpMmPzInlMmVyCAkrSBZgd4n41VIZH5tJKfwC4kTZG33/M7rxCT
 kj6pCNOOPe48BE4+tdIvk5Jgb2rFA==
X-ME-Sender: <xms:zr27W9i9GIZjXivXdZuqbPSQ4Zxl1iY-XIUZ1TBvh7eWjqRt7vLPJw>
X-ME-Proxy: <xmx:zr27W-QwVC2jfRBanvInf6ZW6dmieegp2JAwMNNJ_WBImkMVqi0j_g>
 <xmx:zr27W1rk3GElW7jy9aGvq5iPsEQ2dO1cE-antuhy6Ji7ii-JoCGRnQ>
 <xmx:zr27W-U7LBkNH1XVv8qSoH0Cv4gYQIPqjdaxow-pDalJePQMPeeTKw>
 <xmx:zr27W8VmSpjTMRQbq3jFc2z8HWmhmjYQYuCDPH-xJ5ZN-FEzw2oyAA>
 <xmx:zr27WwqWhTYpzkm7EGRNYJ-E4GC75zeb1T1O8ROHT12hN0xQE_Sg_Q>
 <xmx:zr27W7ZZllR-uOrWb9nQPNfJHboLtvysMATi9I5YYQWQQ1RTeeOjZw>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 05A57E4240;
 Mon,  8 Oct 2018 16:27:56 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: "Trahe, Fiona" <fiona.trahe@intel.com>, "Joseph,
 Anoob" <Anoob.Joseph@caviumnetworks.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Akhil Goyal <akhil.goyal@nxp.com>,
 Anoob Joseph <ajoseph@caviumnetworks.com>, "De Lara Guarch,
 Pablo" <pablo.de.lara.guarch@intel.com>,
 Murthy NSSR <nidadavolu.murthy@caviumnetworks.com>,
 Jerin Jacob <jerin.jacob@caviumnetworks.com>,
 Narayana Prasad <narayanaprasad.athreya@caviumnetworks.com>,
 Ankur Dwivedi <ankur.dwivedi@caviumnetworks.com>,
 Nithin Dabilpuram <nithin.dabilpuram@caviumnetworks.com>,
 Ragothaman Jayaraman <rjayaraman@caviumnetworks.com>,
 Srisivasubramanian S <ssrinivasan@caviumnetworks.com>,
 Tejasree Kondoj <kondoj.tejasree@caviumnetworks.com>
Date: Mon, 08 Oct 2018 22:27:55 +0200
Message-ID: <30793843.hyrbbjGcfd@xps>
In-Reply-To: <348A99DA5F5B7549AA880327E580B43589645898@IRSMSX101.ger.corp.intel.com>
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-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds symmetric
	capabilities
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 08 Oct 2018 20:27:59 -0000

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.