From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: dev@dpdk.org, Ajit Khaparde <ajit.khaparde@broadcom.com>,
Andrew Boyer <andrew.boyer@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Bruce Richardson <bruce.richardson@intel.com>,
Chenbo Xia <chenbox@nvidia.com>,
Chengwen Feng <fengchengwen@huawei.com>,
Dariusz Sosnowski <dsosnowski@nvidia.com>,
David Christensen <drc@linux.vnet.ibm.com>,
Hyong Youb Kim <hyonkim@cisco.com>,
Jerin Jacob <jerinj@marvell.com>, Jie Hai <haijie1@huawei.com>,
Jingjing Wu <jingjing.wu@intel.com>,
John Daley <johndale@cisco.com>,
Kevin Laatz <kevin.laatz@intel.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
Maciej Czekaj <mczekaj@marvell.com>,
Matan Azrad <matan@nvidia.com>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Ori Kam <orika@nvidia.com>, Ruifeng Wang <ruifeng.wang@arm.com>,
Satha Rao <skoteshwar@marvell.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Suanming Mou <suanmingm@nvidia.com>,
Sunil Kumar Kori <skori@marvell.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Yisen Zhuang <yisen.zhuang@huawei.com>,
Yuying Zhang <Yuying.Zhang@intel.com>
Subject: Re: [PATCH v6 01/23] mbuf: add accessors for rearm and Rx descriptor fields
Date: Tue, 27 Feb 2024 09:17:18 -0800 [thread overview]
Message-ID: <20240227171718.GA16014@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F26C@smartserver.smartshare.dk>
On Tue, Feb 27, 2024 at 10:10:03AM +0100, Morten Brørup wrote:
> > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> > Sent: Tuesday, 27 February 2024 06.41
> >
> > RTE_MARKER typedefs are a GCC extension unsupported by MSVC. Provide
> > inline functions to access compatible type pointer to rearm_data
> > and rx_descriptor_fields1 which will allow direct references on the
> > rte marker fields to be removed.
> >
> > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> > ---
> > lib/mbuf/rte_mbuf.h | 13 +++++++++++++
> > lib/mbuf/rte_mbuf_core.h | 11 ++++++++++-
> > 2 files changed, 23 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h
> > index 286b32b..aa7495b 100644
> > --- a/lib/mbuf/rte_mbuf.h
> > +++ b/lib/mbuf/rte_mbuf.h
> > @@ -132,6 +132,19 @@
> > #endif
> > }
> >
> > +static inline
> > +uint64_t *
> > +rte_mbuf_rearm_data(struct rte_mbuf *m)
> > +{
> > + return (uint64_t *)&m->data_off;
> > +}
>
> Consider returning (void *) instead of (uint64_t *).
> Just a suggestion; I don't know which is better.
if you mean just the cast i don't think it matters. arguably it could go
void * first but we're already aliasing through a different type. this
is one argument in favor of the union.
>
> > +
> > +static inline
> > +void *
> > +rte_mbuf_rx_descriptor_fields1(struct rte_mbuf *m)
> > +{
> > + return &m->packet_type;
> > +}
>
> The mbuf_rx_descriptor_fields1 field is disappearing in a later patch;
> consider taking the opportunity to use a better name here.
oh boy. you're asking for a new name but not suggesting a new name.
naming is hard (no one is ever happy). for this and rearm_data if you
or anyone suggests a name i'll make the change ~everywhere including
comments across all drivers.
>
> >
> > static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
> >
> > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
> > index 5688683..7000c04 100644
> > --- a/lib/mbuf/rte_mbuf_core.h
> > +++ b/lib/mbuf/rte_mbuf_core.h
> > @@ -486,7 +486,12 @@ struct rte_mbuf {
> > struct rte_mbuf *next;
> > #endif
> >
> > - /* next 8 bytes are initialised on RX descriptor rearm */
> > + /**
> > + * next 8 bytes are initialised on RX descriptor rearm
> > + *
> > + * To obtain a pointer to rearm_data use the rte_mbuf_rearm_data()
>
> The "rearm_data" field is disappearing in a later patch;
> don't refer to it by that name in the comments here.
without having renamed the block of fields cheerfully known as
"rearm_data" i kept all documentation/comments here and in drivers
using rearm_data for familiarity. (unless someone suggests a new name for the group
of fields).
>
> > + * accessor instead of directly referencing through the data_off field.
> > + */
> > RTE_MARKER64 rearm_data;
> > uint16_t data_off;
> >
> > @@ -522,6 +527,10 @@ struct rte_mbuf {
> > * mbuf. Example: if vlan stripping is enabled, a received vlan packet
> > * would have RTE_PTYPE_L2_ETHER and not RTE_PTYPE_L2_VLAN because the
> > * vlan is stripped from the data.
> > + *
> > + * To obtain a pointer to rx_descriptor_fields1 use the
> > + * rte_mbuf_rx_descriptor_fields1() accessor instead of directly
>
> The "rx_descriptor_fields1" field is disappearing in a later patch;
> don't refer to it by that name in the comments here.
> And if you update the access function's name, remember to update it in the comment here too.
same as above.
>
> > + * referencing through the the anonymous union fields.
> > */
> > union {
> > uint32_t packet_type; /**< L2/L3/L4 and tunnel information. */
> > --
> > 1.8.3.1
next prev parent reply other threads:[~2024-02-27 17:17 UTC|newest]
Thread overview: 177+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 23:26 [PATCH] replace GCC marker extension with C11 anonymous unions Tyler Retzlaff
2024-01-30 23:26 ` [PATCH] mbuf: " Tyler Retzlaff
2024-01-31 9:18 ` Morten Brørup
2024-01-31 21:09 ` Tyler Retzlaff
2024-01-31 22:39 ` Morten Brørup
2024-01-31 13:49 ` Bruce Richardson
2024-01-31 20:45 ` Tyler Retzlaff
2024-01-31 22:55 ` Morten Brørup
2024-02-13 6:45 ` [PATCH v2] RFC: " Tyler Retzlaff
2024-02-13 6:45 ` [PATCH v2] mbuf: " Tyler Retzlaff
2024-02-13 16:58 ` Morten Brørup
2024-02-13 18:48 ` Tyler Retzlaff
2024-02-13 19:27 ` Morten Brørup
2024-02-13 20:00 ` Tyler Retzlaff
2024-02-13 8:57 ` [PATCH v2] RFC: " Bruce Richardson
2024-02-13 17:09 ` Morten Brørup
2024-02-13 23:33 ` [PATCH v3] RFC deprecate RTE_MARKER in struct rte_mbuf Tyler Retzlaff
2024-02-13 23:33 ` [PATCH v3] mbuf: deprecate GCC marker in rte mbuf struct Tyler Retzlaff
2024-02-14 10:46 ` Morten Brørup
2024-02-14 20:16 ` Tyler Retzlaff
2024-02-14 10:49 ` [PATCH v3] RFC deprecate RTE_MARKER in struct rte_mbuf Morten Brørup
2024-02-26 1:18 ` Stephen Hemminger
2024-02-15 6:21 ` [PATCH v4 00/18] stop using zero sized marker fields Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 01/18] mbuf: deprecate GCC marker in rte mbuf struct Tyler Retzlaff
2024-02-18 2:28 ` fengchengwen
2024-02-18 12:39 ` Thomas Monjalon
2024-02-18 13:07 ` Morten Brørup
2024-02-18 15:22 ` Thomas Monjalon
2024-02-18 16:20 ` Morten Brørup
2024-02-20 17:24 ` Tyler Retzlaff
2024-02-20 17:20 ` Tyler Retzlaff
2024-02-20 17:53 ` Thomas Monjalon
2024-02-20 19:16 ` Thomas Monjalon
2024-02-20 19:37 ` Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 02/18] mbuf: stop using zero sized marker fields Tyler Retzlaff
2024-02-18 2:38 ` fengchengwen
2024-02-15 6:21 ` [PATCH v4 03/18] net/i40e: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 04/18] net/iavf: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 05/18] net/ice: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 06/18] net/ixgbe: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 07/18] net/mlx5: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 08/18] net/sfc: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 09/18] net/bnxt: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 10/18] net/enic: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 11/18] net/fm10k: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 12/18] net/hns3: " Tyler Retzlaff
2024-02-18 3:00 ` fengchengwen
2024-02-15 6:21 ` [PATCH v4 13/18] net/ionic: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 14/18] net/thunderx: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 15/18] net/virtio: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 16/18] net/cnxk: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 17/18] common/idpf: " Tyler Retzlaff
2024-02-15 6:21 ` [PATCH v4 18/18] examples/dma: " Tyler Retzlaff
2024-02-15 9:37 ` [PATCH v4 00/18] " Morten Brørup
2024-02-24 8:21 ` [PATCH v5 00/22] stop using RTE_MARKER extensions Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 01/22] eal: provide macro to expand marker extensions Tyler Retzlaff
2024-02-24 10:51 ` Thomas Monjalon
2024-02-24 11:18 ` Thomas Monjalon
2024-02-24 8:21 ` [PATCH v5 02/22] mbuf: expand rte markers empty when building with MSVC Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 03/22] security: " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 04/22] cryptodev: " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 05/22] mbuf: stop using mbuf cacheline marker fields Tyler Retzlaff
2024-02-24 10:58 ` Thomas Monjalon
2024-02-26 18:20 ` Stephen Hemminger
2024-02-24 8:21 ` [PATCH v5 06/22] mbuf: add mbuf descriptor accessors Tyler Retzlaff
2024-02-24 11:01 ` Thomas Monjalon
2024-02-24 8:21 ` [PATCH v5 07/22] common/idpf: use " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 08/22] net/bnxt: " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 09/22] net/cnxk: " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 10/22] net/enic: " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 11/22] net/fm10k: " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 12/22] net/hns3: " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 13/22] net/i40e: " Tyler Retzlaff
2024-02-24 8:21 ` [PATCH v5 14/22] net/iavf: " Tyler Retzlaff
2024-02-24 8:22 ` [PATCH v5 15/22] net/ice: " Tyler Retzlaff
2024-02-24 8:22 ` [PATCH v5 16/22] net/ionic: " Tyler Retzlaff
2024-02-24 8:22 ` [PATCH v5 17/22] net/ixgbe: " Tyler Retzlaff
2024-02-24 8:22 ` [PATCH v5 18/22] net/mlx5: " Tyler Retzlaff
2024-02-24 8:22 ` [PATCH v5 19/22] net/octeon_ep: " Tyler Retzlaff
2024-02-24 8:22 ` [PATCH v5 20/22] net/sfc: " Tyler Retzlaff
2024-02-24 8:22 ` [PATCH v5 21/22] net/thunderx: " Tyler Retzlaff
2024-02-24 8:22 ` [PATCH v5 22/22] net/virtio: " Tyler Retzlaff
2024-02-24 10:42 ` [PATCH v5 00/22] stop using RTE_MARKER extensions Morten Brørup
2024-02-24 11:13 ` Thomas Monjalon
2024-02-24 11:23 ` Morten Brørup
2024-02-27 5:41 ` [PATCH v6 00/23] stop and remove RTE_MARKER typedefs Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 01/23] mbuf: add accessors for rearm and Rx descriptor fields Tyler Retzlaff
2024-02-27 9:10 ` Morten Brørup
2024-02-27 17:17 ` Tyler Retzlaff [this message]
2024-02-28 8:28 ` Morten Brørup
2024-02-28 16:20 ` Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 02/23] mbuf: consolidate driver asserts for mbuf struct Tyler Retzlaff
2024-02-27 10:02 ` Konstantin Ananyev
2024-03-14 16:51 ` Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 03/23] common/idpf: use mbuf descriptor accessors Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 04/23] net/bnxt: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 05/23] net/cnxk: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 06/23] net/enic: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 07/23] net/fm10k: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 08/23] net/hns3: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 09/23] net/i40e: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 10/23] net/iavf: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 11/23] net/ice: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 12/23] net/ionic: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 13/23] net/ixgbe: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 14/23] net/mlx5: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 15/23] net/octeon_ep: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 16/23] net/sfc: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 17/23] net/thunderx: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 18/23] net/virtio: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 19/23] examples/dma: use mbuf descriptor accessor Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 20/23] mbuf: remove and stop using rte marker fields Tyler Retzlaff
2024-02-27 9:15 ` Morten Brørup
2024-02-27 10:03 ` Konstantin Ananyev
2024-02-27 15:18 ` David Marchand
2024-02-27 16:04 ` Morten Brørup
2024-02-27 17:23 ` Tyler Retzlaff
2024-02-28 10:42 ` David Marchand
2024-02-28 14:03 ` Dodji Seketeli
2024-02-28 14:43 ` David Marchand
2024-02-29 14:50 ` Dodji Seketeli
2024-02-28 14:18 ` David Marchand
2024-02-28 15:01 ` Morten Brørup
2024-02-28 15:33 ` David Marchand
2024-02-28 17:20 ` Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 21/23] security: remove " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 22/23] cryptodev: " Tyler Retzlaff
2024-02-27 5:41 ` [PATCH v6 23/23] devtools: forbid new use of rte marker typedefs Tyler Retzlaff
2024-03-20 22:01 ` [PATCH v7 0/4] remove use of RTE_MARKER fields in libraries Tyler Retzlaff
2024-03-20 22:01 ` [PATCH v7 1/4] net/i40e: use inline prefetch function Tyler Retzlaff
2024-03-26 10:16 ` Morten Brørup
2024-03-27 18:14 ` Tyler Retzlaff
2024-03-27 19:45 ` Morten Brørup
2024-03-20 22:01 ` [PATCH v7 2/4] mbuf: remove rte marker fields Tyler Retzlaff
2024-03-21 10:32 ` Bruce Richardson
2024-03-21 15:31 ` Tyler Retzlaff
2024-03-21 16:19 ` Morten Brørup
2024-03-26 11:12 ` Morten Brørup
2024-03-20 22:01 ` [PATCH v7 3/4] security: " Tyler Retzlaff
2024-03-26 10:28 ` Morten Brørup
2024-03-27 19:59 ` Tyler Retzlaff
2024-03-20 22:01 ` [PATCH v7 4/4] cryptodev: " Tyler Retzlaff
2024-03-26 10:31 ` Morten Brørup
2024-03-27 19:56 ` [PATCH v8 0/4] remove use of RTE_MARKER fields in libraries Tyler Retzlaff
2024-03-27 19:56 ` [PATCH v8 1/4] net/i40e: use inline prefetch function Tyler Retzlaff
2024-03-27 19:56 ` [PATCH v8 2/4] mbuf: remove rte marker fields Tyler Retzlaff
2024-03-27 19:56 ` [PATCH v8 3/4] security: " Tyler Retzlaff
2024-03-27 19:56 ` [PATCH v8 4/4] cryptodev: " Tyler Retzlaff
2024-04-02 20:08 ` [PATCH v9 0/4] remove use of RTE_MARKER fields in libraries Tyler Retzlaff
2024-04-02 20:08 ` [PATCH v9 1/4] net/i40e: use inline prefetch function Tyler Retzlaff
2024-04-02 20:08 ` [PATCH v9 2/4] mbuf: remove rte marker fields Tyler Retzlaff
2024-04-02 20:45 ` Stephen Hemminger
2024-04-02 20:51 ` Tyler Retzlaff
2024-04-02 20:08 ` [PATCH v9 3/4] security: " Tyler Retzlaff
2024-04-02 20:08 ` [PATCH v9 4/4] cryptodev: " Tyler Retzlaff
2024-04-03 17:53 ` [PATCH v10 0/4] remove use of RTE_MARKER fields in libraries Tyler Retzlaff
2024-04-03 17:53 ` [PATCH v10 1/4] net/i40e: use inline prefetch function Tyler Retzlaff
2024-04-03 21:49 ` Stephen Hemminger
2024-04-03 17:53 ` [PATCH v10 2/4] mbuf: remove rte marker fields Tyler Retzlaff
2024-04-03 19:32 ` Morten Brørup
2024-04-03 22:45 ` Tyler Retzlaff
2024-04-03 21:49 ` Stephen Hemminger
2024-04-03 17:53 ` [PATCH v10 3/4] security: " Tyler Retzlaff
2024-04-03 21:50 ` Stephen Hemminger
2024-04-03 17:53 ` [PATCH v10 4/4] cryptodev: " Tyler Retzlaff
2024-04-03 21:50 ` Stephen Hemminger
2024-04-04 17:51 ` [PATCH v11 0/4] remove use of RTE_MARKER fields in libraries Tyler Retzlaff
2024-04-04 17:51 ` [PATCH v11 1/4] net/i40e: use inline prefetch function Tyler Retzlaff
2024-04-04 17:51 ` [PATCH v11 2/4] mbuf: remove rte marker fields Tyler Retzlaff
2024-04-04 17:51 ` [PATCH v11 3/4] security: " Tyler Retzlaff
2024-04-04 17:51 ` [PATCH v11 4/4] cryptodev: " Tyler Retzlaff
2024-06-19 15:01 ` [PATCH v12 0/4] remove use of RTE_MARKER fields in libraries David Marchand
2024-06-19 15:01 ` [PATCH v12 1/4] net/i40e: use mbuf prefetch helper David Marchand
2024-06-19 15:01 ` [PATCH v12 2/4] mbuf: remove marker fields David Marchand
2024-06-19 15:01 ` [PATCH v12 3/4] security: " David Marchand
2024-06-19 15:01 ` [PATCH v12 4/4] cryptodev: " David Marchand
2024-06-19 17:30 ` [PATCH v12 0/4] remove use of RTE_MARKER fields in libraries David Marchand
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=20240227171718.GA16014@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
--to=roretzla@linux.microsoft.com \
--cc=Yuying.Zhang@intel.com \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew.boyer@amd.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bruce.richardson@intel.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=drc@linux.vnet.ibm.com \
--cc=dsosnowski@nvidia.com \
--cc=fengchengwen@huawei.com \
--cc=haijie1@huawei.com \
--cc=hyonkim@cisco.com \
--cc=jerinj@marvell.com \
--cc=jingjing.wu@intel.com \
--cc=johndale@cisco.com \
--cc=kevin.laatz@intel.com \
--cc=kirankumark@marvell.com \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=matan@nvidia.com \
--cc=maxime.coquelin@redhat.com \
--cc=mb@smartsharesystems.com \
--cc=mczekaj@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=orika@nvidia.com \
--cc=ruifeng.wang@arm.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
--cc=somnath.kotur@broadcom.com \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.com \
--cc=yisen.zhuang@huawei.com \
/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).