All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	dev@dpdk.org
Subject: Re: [PATCH v4] ethdev: return named opaque type instead of void pointer
Date: Fri, 9 Mar 2018 10:16:16 -0500	[thread overview]
Message-ID: <20180309151616.GC19004@hmswarspite.think-freely.org> (raw)
In-Reply-To: <b12988d0-cb4a-2dcb-c20a-37cfbdf73eda@intel.com>

On Fri, Mar 09, 2018 at 01:00:35PM +0000, Ferruh Yigit wrote:
> On 3/9/2018 12:36 PM, Neil Horman wrote:
> > On Fri, Mar 09, 2018 at 11:25:31AM +0000, Ferruh Yigit wrote:
> >> "struct rte_eth_rxtx_callback" is defined as internal data structure and
> >> used as named opaque type.
> >>
> >> So the functions that are adding callbacks can return objects in this
> >> type instead of void pointer.
> >>
> >> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> >> ---
> >> v2:
> >> * keep using struct * in parameters, instead add callback functions
> >> return struct rte_eth_rxtx_callback pointer.
> >>
> >> v4:
> >> * Remove deprecation notice. LIBABIVER already increased in this release
> >> ---
> >>  doc/guides/rel_notes/deprecation.rst |  7 -------
> >>  lib/librte_ether/rte_ethdev.c        |  6 +++---
> >>  lib/librte_ether/rte_ethdev.h        | 13 ++++++++-----
> >>  3 files changed, 11 insertions(+), 15 deletions(-)
> >>
> > This doesn't quite make sense to me.  If rte_eth_rxtx_callback is defined as an
> > internal data structure, then it shouldn't be used as part of the prototype for
> > an exported function, as the structure will then no longer be a internal data
> > structure, but rather part of the public ABI.
> 
> "struct rte_eth_rxtx_callback" is internal data structure. And application
> should not access elements of this structure.
> 
> "struct rte_eth_rxtx_callback;" is defined in the public header, so applications
> can use it as opaque type.
> 
> It is possible that both "add" and "remove" APIs use "void *" and API itself can
> cast it. But the inconsistency was "add" related APIs return "void *" and
> "remove" related APIs require a parameter in "struct rte_eth_rxtx_callback *" type.
> 
> While unifying the usage, "struct rte_eth_rxtx_callback *" preferred against
> "void *", because named opaque type documents intention/usage better.
> 
> Thanks,
> ferruh
> 
I get what you're saying about rte_eth_rxtx_callback being an internals
structure (or its intent is to be an internal structure), but it doesn't seem to
hold up to the header file layout.  rte_eth_rxtx_callback is defined in
rte_ethdev_core.h which according to the makefile, is listed as a symlinked
file, and therefore available for external applications to include.  This
negates the intended opaque nature of the struct.  I think before you do this,
you want to rectify that.

Neil

> > 
> > Neil
> > 
> 
> 

  reply	other threads:[~2018-03-09 15:17 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01  2:29 [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
2017-12-01  2:29 ` [PATCH 2/7] ethdev: fix port id storage Ferruh Yigit
2017-12-01  9:01   ` Hemant Agrawal
2017-12-01 23:52   ` Ferruh Yigit
2017-12-01  2:29 ` [PATCH 3/7] ethdev: separate driver APIs Ferruh Yigit
2017-12-01  6:24   ` Shreyansh Jain
2017-12-01  8:59   ` Hemant Agrawal
2017-12-01 23:51     ` Ferruh Yigit
2017-12-01  2:29 ` [PATCH 4/7] ethdev: separate internal structures into own header Ferruh Yigit
2017-12-01  5:44   ` Hemant Agrawal
2017-12-01  2:29 ` [PATCH 5/7] ethdev: reorder inline functions Ferruh Yigit
2017-12-01  2:29 ` [PATCH 6/7] ethdev: rename function parameter for consistency Ferruh Yigit
2017-12-01  2:29 ` [PATCH 7/7] ethdev: use opaque user callback object Ferruh Yigit
2017-12-01 10:33   ` Bruce Richardson
2017-12-01 11:22     ` Ananyev, Konstantin
2017-12-01 13:17       ` Bruce Richardson
2017-12-01 23:51         ` Ferruh Yigit
2017-12-04 10:31           ` Bruce Richardson
2017-12-04 17:49             ` Ferruh Yigit
     [not found] ` <49eb13f1-e12f-071a-b58b-1cd4852b7c8b@scylladb.com>
2017-12-01 22:30   ` [PATCH 1/7] ethdev: remove unused flag from header Vlad Zolotarov
2017-12-01 23:51   ` Ferruh Yigit
2017-12-02  2:22     ` Vlad Zolotarov
2017-12-04 17:54       ` Ferruh Yigit
2017-12-04 19:37         ` Vlad Zolotarov
2018-01-09 16:23 ` [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
2018-01-09 16:23   ` [PATCH v2 2/6] ethdev: separate driver APIs Ferruh Yigit
2018-01-09 19:19     ` Andrew Rybchenko
2018-01-09 16:23   ` [PATCH v2 3/6] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-09 16:23   ` [PATCH v2 4/6] ethdev: reorder inline functions Ferruh Yigit
2018-01-09 16:23   ` [PATCH v2 5/6] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-09 16:23   ` [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
2018-01-09 18:55     ` Stephen Hemminger
2018-01-09 18:58     ` Stephen Hemminger
2018-01-17 21:57   ` [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
2018-01-17 21:57     ` [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
2018-01-17 22:11       ` [dpdk-stable] " Thomas Monjalon
2018-01-18 10:09         ` Ferruh Yigit
2018-03-09 11:25       ` [PATCH v4] " Ferruh Yigit
2018-03-09 12:36         ` Neil Horman
2018-03-09 13:00           ` Ferruh Yigit
2018-03-09 15:16             ` Neil Horman [this message]
2018-03-09 15:45               ` Ferruh Yigit
2018-03-09 19:06                 ` Neil Horman
2018-03-20 15:51                   ` Ferruh Yigit
2018-03-20 16:34         ` [PATCH v5] " Ferruh Yigit
2018-03-21 13:04           ` Neil Horman
2018-03-23 17:00             ` Bruce Richardson
2018-03-24  2:08               ` Neil Horman
2018-03-26  8:47                 ` Ananyev, Konstantin
2018-03-27 19:10             ` Ferruh Yigit
2018-01-17 21:57     ` [PATCH v3 3/6] ethdev: separate driver APIs Ferruh Yigit
2018-01-17 21:58     ` [PATCH v3 4/6] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-17 22:24       ` [dpdk-stable] " Thomas Monjalon
2018-01-18 10:09         ` Ferruh Yigit
2018-01-17 21:58     ` [PATCH v3 5/6] ethdev: reorder inline functions Ferruh Yigit
2018-01-17 21:58     ` [PATCH v3 6/6] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-17 22:09     ` [PATCH v3 1/6] ethdev: fix port id storage Thomas Monjalon
2018-01-17 22:19       ` Thomas Monjalon
2018-01-18 10:15         ` Ferruh Yigit
2018-01-18 11:29           ` Thomas Monjalon
2018-01-20 16:57     ` [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-01-20 16:57       ` [PATCH v4 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-20 16:57       ` [PATCH v4 3/4] ethdev: reorder inline functions Ferruh Yigit
2018-01-20 16:57       ` [PATCH v4 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-21 23:12       ` [PATCH v4 1/4] ethdev: separate driver APIs Thomas Monjalon
2018-01-21 23:35       ` [PATCH v5 " Ferruh Yigit
2018-01-21 23:35         ` [PATCH v5 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-21 23:35         ` [PATCH v5 3/4] ethdev: reorder inline functions Ferruh Yigit
2018-01-21 23:35         ` [PATCH v5 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-22  0:16         ` [PATCH v6 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-01-22  0:16           ` [PATCH v6 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-22  0:16           ` [PATCH v6 3/4] ethdev: reorder inline functions Ferruh Yigit
2018-01-22  0:16           ` [PATCH v6 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-22  0:51           ` [PATCH v6 1/4] ethdev: separate driver APIs Thomas Monjalon
2018-03-09 11:27     ` [PATCH v4] ethdev: fix port id storage Ferruh Yigit
2018-03-09 12:58       ` Thomas Monjalon
2018-03-26 20:25         ` Ferruh Yigit

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=20180309151616.GC19004@hmswarspite.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.