DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] devtools: skip the symbol check when map file under drivers
Date: Wed, 22 May 2019 09:13:17 -0400	[thread overview]
Message-ID: <20190522131317.GB18629@hmswarspite.think-freely.org> (raw)
In-Reply-To: <BYAPR18MB242432362C57D834158F68C4C8000@BYAPR18MB2424.namprd18.prod.outlook.com>

On Wed, May 22, 2019 at 11:54:13AM +0000, Jerin Jacob Kollanukkaran wrote:
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Wednesday, May 22, 2019 4:21 PM
> > To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> > Cc: Neil Horman <nhorman@tuxdriver.com>; dev@dpdk.org;
> > thomas@monjalon.net; stable@dpdk.org
> > Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] devtools: skip the symbol check
> > when map file under drivers
> > 
> > > > Sorry, but I'm not ok with this, because many of our DPDK PMDs have
> > > > functions that get exported which are meant to be called by
> > > > applications directly.  The
> > >
> > > OK. Just to update my knowledge, Should those API needs to go through
> > > ABI/API depreciation process?
> > >
> > > Actually, I am concerned about the APIs, which is called between
> > > drviers not the application. For example,
> > > drivers/common/dpaax/rte_common_dpaax_version.map
> > >
> > > it is not interface to application rather it is for intra driver case.
> > > I think, I can change my logic to Skip the symbols which NOT starting with
> > rte_.
> > > Agree?
> > >
> > > Context:
> > > I am adding a new driver/common/octeontx2 directory and it has some
> > > API which Needs to shared between drivers not to the application. For
> > > me, it does not make sense to go through any ABI process in such case.
> > >
> > >
> > Maybe not, but other drivers will have APIs designed for apps to call directly -
> > some NIC drivers have them, and I suspect that rawdev drivers will need
> > them a lot. Therefore, it's best to have the drivers directory scanned by our
> > tooling.
> 
> Agreed. But all of those API  which called directly called from application
> is starts with rte_ symbol. How about skipping the symbols which is NOT start with rte_*
> example:
> drivers/common/octeontx/rte_common_octeontx_version.map
> drivers/common/dpaax/rte_common_dpaax_version.map
> 

No, that won't work.  If you export a function, it doesn't matter if its named
rte_* or not.  Its accessible from any library/application that cares to call
it, and so you have a responsibility to keep it stable for those users.

Currently the way we have around that is the use of the __rte_experimental tag.
Adding that tag to an exported function marks it as being unstable, and while
you can use it, it will generate a build time warning about its use, unless you
define ALLOW_EXPERIMENTAL_API.  You could use that, understanding that in-tree
drivers could use it safely, as you should always be keeping the API in sync
with its users, but thats not quite what you want I don't think.

Another solution (allbeit a slightly risky one), would be to bifurcate your
header files into a public and private version, with the private version
prototyping your driver-only functions properly, and the public version aliasing
them such that they generate a build time error indicating those functions
aren't available for public use (you can use the gcc static_assert macro I
believe).  Users could circumvent it by pulling the private header out of the
build, or just prototyping the functions themselves, but at that point a user is
asking for trouble anyway

Neil

  reply	other threads:[~2019-05-22 13:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 11:54 Jerin Jacob Kollanukkaran
2019-05-22 13:13 ` Neil Horman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-23 14:21 Jerin Jacob Kollanukkaran
2019-05-23 17:57 ` Neil Horman
2019-05-23 18:59   ` Thomas Monjalon
2019-05-23 20:17     ` Neil Horman
2019-05-22 13:41 Jerin Jacob Kollanukkaran
2019-05-22 14:11 ` Neil Horman
2019-05-22 13:12 Jerin Jacob Kollanukkaran
2019-05-22 13:40 ` Neil Horman
2019-05-22 14:12   ` Thomas Monjalon
2019-05-22 14:33     ` Neil Horman
2019-05-21 19:56 jerinj
2019-05-21 20:27 ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190522131317.GB18629@hmswarspite.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).