DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>
Cc: <dev@dpdk.org>
Subject: RE: [RFC 08/13] mbuf: add fields for mirroring
Date: Sun, 13 Apr 2025 09:00:19 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9FBD1@smartserver.smartshare.dk> (raw)
In-Reply-To: <20250412095659.5f5719e8@hermes.local>

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Saturday, 12 April 2025 18.57
> 
> On Sat, 12 Apr 2025 11:59:10 +0200
> Morten Brørup <mb@smartsharesystems.com> wrote:
> 
> > > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > > Sent: Saturday, 12 April 2025 01.45
> > >
> > > Add field to union used for sched/event etc, for use when
> > > an mbuf is mirrored.
> > >
> > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > > ---
> > >  lib/mbuf/rte_mbuf_core.h | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > >
> > > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
> > > index a0df265b5d..1806dddd67 100644
> > > --- a/lib/mbuf/rte_mbuf_core.h
> > > +++ b/lib/mbuf/rte_mbuf_core.h
> > > @@ -589,6 +589,14 @@ struct __rte_cache_aligned rte_mbuf {
> > >  						 * @see
> > > rte_event_eth_tx_adapter_txq_set()
> > >  						 */
> > >  					} txadapter; /**< Eventdev ethdev Tx
> > > adapter */
> > > +					struct rte_mbuf_mirror {
> > > +						uint32_t orig_len;
> > > +						uint16_t queue_id;
> > > +						uint16_t direction;
> > > +						/**< Port mirroring uses this to
> > > store origin
> > > +						 * @see rte_eth_mirror()
> > > +						 */
> > > +					} mirror;
> > >  					uint32_t usr;
> > >  					/**< User defined tags. See
> > > rte_distributor_process() */
> > >  				} hash;                   /**< hash information
> >
> > Stop overloading the "hash" field!
> >
> > We now have dynfields. The mbuf structure's dedicated fields should
> be limited to absolute core features.
> >
> > Long term, the "hash" field should be cleaned up.
> > E.g. if we get rid of the Flow Director and make the 8 byte "sched"
> (Hierarchical Scheduler) a dynfield, the "hash" field can be reduced
> from 8 byte to 4 byte (RSS hash).
> >
> > I acknowledge that some mbuf fields can be overloaded and thus used
> for multiple purposes - i.e. a value only used for ingress/forwarding
> (e.g. RSS hash) can share an mbuf field with a value only used for
> egress (e.g. Scheduler).
> >
> > The overloading of the "hash" field is too much already. E.g. can the
> Hierarchical Scheduler be used together with the Eventdev ethdev Tx
> adapter, or are they mutually exclusive due to sharing the same mbuf
> field?
> >
> > Going to the extreme, we would completely replace the "hash" field by
> dynfields.
> >
> > In short: Overloading the "hash" field with port mirror information
> is a step in the wrong direction.
> 
> Short answer: Dynamic Fields are hard to work with primary/secondary
> process model.
> The goal was to allow dumpcap to run and just work without
> modifications to the primary application.
> If secondary creates dynamic field, the primary doesn't see it.

I skimmed the mbuf dynfield source code, and it looks like it is designed for primary/secondary process model.
If the primary process doesn't see a dynfield created in a secondary process, it is a bug in the mbuf dynfield library. I couldn't find such a bug in Bugzilla.
I would be much better to fix the bug than overloading the "hash" field.

> 
> The hash field is not going away, flow director is stuck, it has been
> scheduled for removal
> for 3 years and Intel still needs it. Other uses such as storing
> received hash value are
> still needed.
> 
> Long answer:
> It maybe possible. The patchset went through many revisions during
> development.
> Ended up having to have MP server for start/stop, and if that code was
> extended
> to allow secondary to proxy setting up mirror, then the code in
> handling mirror() on
> primary could also setup the dynamic fields. But accessing dynamic
> fields is slower,
> not that it matters that much if we have to copy mbuf anyway. Other
> option
> would be to pre-pend a pseudo header that capture could then use.

  reply	other threads:[~2025-04-13  7:00 UTC|newest]

Thread overview: 153+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 23:44 [RFC 00/13] Packet capture using port mirroring Stephen Hemminger
2025-04-11 23:44 ` [RFC 01/13] app/testpmd: revert auto attach/detach Stephen Hemminger
2025-04-15 13:28   ` lihuisong (C)
2025-04-16  0:06     ` Stephen Hemminger
2025-04-17  3:14       ` lihuisong (C)
2025-04-11 23:44 ` [RFC 02/13] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-04-15  0:19   ` Stephen Hemminger
2025-04-11 23:44 ` [RFC 03/13] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-04-11 23:44 ` [RFC 04/13] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-04-11 23:44 ` [RFC 05/13] net/ring: add argument to attach existing ring Stephen Hemminger
2025-04-11 23:44 ` [RFC 06/13] net/ring: add timestamp devargs Stephen Hemminger
2025-04-11 23:44 ` [RFC 07/13] net/null: all lockfree transmit Stephen Hemminger
2025-04-11 23:44 ` [RFC 08/13] mbuf: add fields for mirroring Stephen Hemminger
2025-04-12  9:59   ` Morten Brørup
2025-04-12 16:56     ` Stephen Hemminger
2025-04-13  7:00       ` Morten Brørup [this message]
2025-04-13 14:31         ` Stephen Hemminger
2025-04-13 14:44           ` Morten Brørup
2025-04-11 23:44 ` [RFC 09/13] ethdev: add port mirror capability Stephen Hemminger
2025-04-11 23:44 ` [RFC 10/13] pcapng: split packet copy from header insertion Stephen Hemminger
2025-04-11 23:44 ` [RFC 11/13] test: add tests for ethdev mirror Stephen Hemminger
2025-04-11 23:44 ` [RFC 12/13] app/testpmd: support for port mirroring Stephen Hemminger
2025-04-11 23:44 ` [RFC 13/13] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-04-12 11:06 ` [RFC 00/13] Packet capture using port mirroring Morten Brørup
2025-04-12 17:04   ` Stephen Hemminger
2025-04-13  9:26     ` Morten Brørup
2025-07-15 16:15 ` [PATCH v4 " Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 01/13] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 02/13] ethdev: make sure all necessary headers included Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 03/13] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 04/13] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 05/13] net/ring: add new devarg to create vdev from existing ring Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 06/13] mbuf: add dynamic flag for use by port mirroring Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 07/13] ethdev: add port mirroring feature Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 08/13] pcapng: split packet copy from header insertion Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 09/13] pcapng: make queue optional Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 10/13] test: add tests for ethdev mirror Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 11/13] app/testpmd: support for port mirroring Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 12/13] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-07-15 16:15   ` [PATCH v4 13/13] pdump: mark API and application as deprecated Stephen Hemminger
2025-07-18 16:28 ` [PATCH v5 00/13] Packet capture using port mirroring Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 01/13] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 02/13] ethdev: make sure all necessary headers included Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 03/13] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 04/13] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 05/13] net/ring: add new devarg to create vdev from existing ring Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 06/13] mbuf: add dynamic flag for use by port mirroring Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 07/13] ethdev: add port mirroring feature Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 08/13] pcapng: split packet copy from header insertion Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 09/13] pcapng: make queue optional Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 10/13] test: add tests for ethdev mirror Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 11/13] app/testpmd: support for port mirroring Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 12/13] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-07-18 16:28   ` [PATCH v5 13/13] pdump: mark API and application as deprecated Stephen Hemminger
2025-07-22 17:34 ` [PATCH v6 00/13] Packet capture using port mirroring Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 01/13] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-07-23  1:08     ` Ivan Malov
2025-07-23 14:38       ` Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 02/13] ethdev: make sure all necessary headers included Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 03/13] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-07-23  1:31     ` Ivan Malov
2025-07-23 15:09       ` Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 04/13] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 05/13] net/ring: add new devarg to create vdev from existing ring Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 06/13] mbuf: add dynamic flag for use by port mirroring Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 07/13] ethdev: add port mirroring feature Stephen Hemminger
2025-07-23  2:13     ` Ivan Malov
2025-07-23 15:26       ` Stephen Hemminger
2025-07-23 15:30         ` Ivan Malov
2025-07-22 17:34   ` [PATCH v6 08/13] pcapng: split packet copy from header insertion Stephen Hemminger
2025-07-23  2:32     ` Ivan Malov
2025-07-23  3:18       ` Ivan Malov
2025-07-23 19:20       ` Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 09/13] pcapng: make queue optional Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 10/13] test: add tests for ethdev mirror Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 11/13] app/testpmd: support for port mirroring Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 12/13] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-07-23  3:16     ` Ivan Malov
2025-07-23  3:27       ` Ivan Malov
2025-07-23 19:26       ` Stephen Hemminger
2025-07-22 17:34   ` [PATCH v6 13/13] pdump: mark API and application as deprecated Stephen Hemminger
2025-07-28 22:08 ` [PATCH v7 00/12] Port mirroring for packet capture Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 01/12] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 02/12] ethdev: make sure all necessary headers included Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 03/12] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 04/12] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 05/12] net/ring: add new devarg to create vdev from existing ring Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 06/12] mbuf: add dynamic flag for use by port mirroring Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 07/12] ethdev: add port mirroring feature Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 08/12] test: add tests for ethdev mirror Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 09/12] pcapng: split packet copy from header insertion Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 10/12] pcapng: make queue optional Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 11/12] app/testpmd: support for port mirroring Stephen Hemminger
2025-07-28 22:08   ` [PATCH v7 12/12] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-08-04 16:27 ` [PATCH v8 00/13] Packet capture using port mirroring Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 01/13] bpf: add ability to load bpf into a buffer Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 02/13] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 03/13] ethdev: make sure all necessary headers included Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 04/13] ethdev: swap bpf and ethdev dependency Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 05/13] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 06/13] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 07/13] net/ring: add new devarg to create vdev from existing ring Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 08/13] mbuf: add dynamic flag for use by port mirroring Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 09/13] ethdev: add port mirroring feature Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 10/13] app/testpmd: support for port mirroring Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 11/13] pcapng: split packet copy from header insertion Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 12/13] pcapng: make queue optional Stephen Hemminger
2025-08-04 16:27   ` [PATCH v8 13/13] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-08-06 21:40 ` [PATCH v9 00/13] Packet capture using port mirroring Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 01/13] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 02/13] ethdev: make sure all necessary headers included Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 03/13] ethdev: reorder bpf and ethdev dependency Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 04/13] bpf: add ability to load bpf into a buffer Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 05/13] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 06/13] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 07/13] net/ring: add new devarg to create vdev from existing ring Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 08/13] mbuf: add dynamic flag for use by port mirroring Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 09/13] ethdev: add port mirroring feature Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 10/13] app/testpmd: support for port mirroring Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 11/13] pcapng: split packet copy from header insertion Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 12/13] pcapng: make queue optional Stephen Hemminger
2025-08-06 21:40   ` [PATCH v9 13/13] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-08-07 17:33 ` [PATCH v10 00/14] Port mirroring feature Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 01/14] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 02/14] ethdev: make sure all necessary headers included Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 03/14] ethdev: reorder bpf and ethdev dependency Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 04/14] bpf: add ability to load bpf into a buffer Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 05/14] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 06/14] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 07/14] net/ring: add new devarg to create vdev from existing ring Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 08/14] mbuf: add dynamic flag for use by port mirroring Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 09/14] ethdev: add port mirroring feature Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 10/14] app/testpmd: support for port mirroring Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 11/14] pcapng: split packet copy from header insertion Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 12/14] pcapng: make queue optional Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 13/14] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-08-07 17:33   ` [PATCH v10 14/14] doc: add documentation for port mirroring Stephen Hemminger
2025-08-08 16:55 ` [PATCH v11 00/14] Port mirroring for packet capture Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 01/14] ethdev: allow start/stop from secondary process Stephen Hemminger
2025-08-09  6:31     ` Khadem Ullah
2025-08-08 16:55   ` [PATCH v11 02/14] ethdev: make sure all necessary headers included Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 03/14] ethdev: reorder bpf and ethdev dependency Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 04/14] bpf: add ability to load bpf into a buffer Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 05/14] test: add test for hotplug and secondary process operations Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 06/14] net/ring: allow lockfree transmit if ring supports it Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 07/14] net/ring: add new devarg to create vdev from existing ring Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 08/14] mbuf: add dynamic flag for use by port mirroring Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 09/14] ethdev: add port mirroring feature Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 10/14] app/testpmd: support for port mirroring Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 11/14] pcapng: split packet copy from header insertion Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 12/14] pcapng: make queue optional Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 13/14] app/dumpcap: use port mirror instead of pdump Stephen Hemminger
2025-08-08 16:55   ` [PATCH v11 14/14] doc: add documentation for port mirroring Stephen Hemminger

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=98CBD80474FA8B44BF855DF32C47DC35E9FBD1@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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).