From: David Marchand <david.marchand@redhat.com>
To: Ilya Maximets <i.maximets@ovn.org>
Cc: dev@dpdk.org, thomas@monjalon.net, alialnu@nvidia.com,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Ori Kam <orika@nvidia.com>,
Aman Singh <aman.deep.singh@intel.com>,
Yuying Zhang <yuying.zhang@intel.com>,
Matan Azrad <matan@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
David Christensen <drc@linux.vnet.ibm.com>,
Ruifeng Wang <ruifeng.wang@arm.com>,
Bruce Richardson <bruce.richardson@intel.com>,
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
Ferruh Yigit <ferruh.yigit@amd.com>
Subject: Re: [PATCH v4] ethdev: advertise flow restore in mbuf
Date: Tue, 26 Sep 2023 11:17:51 +0200 [thread overview]
Message-ID: <CAJFAV8z_3kfTA_1orn6F9B4h6_MOhjg-Y3fTPjsZksf6+6g00A@mail.gmail.com> (raw)
In-Reply-To: <820c8ce1-091a-cd9b-2dd2-c830ff0a503c@ovn.org>
Hello Ilya,
On Mon, Jul 31, 2023 at 10:40 PM Ilya Maximets <i.maximets@ovn.org> wrote:
> On 6/21/23 16:43, David Marchand wrote:
> > As reported by Ilya [1], unconditionally calling
> > rte_flow_get_restore_info() impacts an application performance for drivers
> > that do not provide this ops.
> > It could also impact processing of packets that require no call to
> > rte_flow_get_restore_info() at all.
> >
> > Register a dynamic mbuf flag when an application negotiates tunnel
> > metadata delivery (calling rte_eth_rx_metadata_negotiate() with
> > RTE_ETH_RX_METADATA_TUNNEL_ID).
> >
> > Drivers then advertise that metadata can be extracted by setting this
> > dynamic flag in each mbuf.
> >
> > The application then calls rte_flow_get_restore_info() only when required.
> >
> > Link: http://inbox.dpdk.org/dev/5248c2ca-f2a6-3fb0-38b8-7f659bfa40de@ovn.org/
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> > Tested-by: Ali Alnubani <alialnu@nvidia.com>
> > Acked-by: Ori Kam <orika@nvidia.com>
> > ---
> > Changes since RFC v3:
> > - rebased on next-net,
> > - sending as non RFC for CIs that skip RFC patches,
> >
> > Changes since RFC v2:
> > - fixed crash introduced in v2 and removed unneeded argument to
> > rte_flow_restore_info_dynflag_register(),
> >
> > Changes since RFC v1:
> > - rebased,
> > - updated vectorized datapath functions for net/mlx5,
> > - moved dynamic flag register to rte_eth_rx_metadata_negotiate() and
> > hid rte_flow_restore_info_dynflag_register() into ethdev internals,
> >
> > ---
> > app/test-pmd/util.c | 9 +++--
> > drivers/net/mlx5/mlx5.c | 2 +
> > drivers/net/mlx5/mlx5.h | 5 ++-
> > drivers/net/mlx5/mlx5_flow.c | 47 +++++++++++++++++++++---
> > drivers/net/mlx5/mlx5_rx.c | 2 +-
> > drivers/net/mlx5/mlx5_rx.h | 1 +
> > drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 16 ++++----
> > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 6 +--
> > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 6 +--
> > drivers/net/mlx5/mlx5_trigger.c | 4 +-
> > drivers/net/sfc/sfc_dp.c | 14 +------
> > lib/ethdev/rte_ethdev.c | 5 +++
> > lib/ethdev/rte_flow.c | 27 ++++++++++++++
> > lib/ethdev/rte_flow.h | 18 ++++++++-
> > lib/ethdev/rte_flow_driver.h | 6 +++
> > lib/ethdev/version.map | 1 +
> > 16 files changed, 128 insertions(+), 41 deletions(-)
>
> <snip>
>
> > diff --git a/lib/ethdev/rte_flow_driver.h b/lib/ethdev/rte_flow_driver.h
> > index 356b60f523..f9fb01b8a2 100644
> > --- a/lib/ethdev/rte_flow_driver.h
> > +++ b/lib/ethdev/rte_flow_driver.h
> > @@ -376,6 +376,12 @@ struct rte_flow_ops {
> > const struct rte_flow_ops *
> > rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error);
> >
> > +/**
> > + * Register mbuf dynamic flag for rte_flow_get_restore_info.
> > + */
> > +int
> > +rte_flow_restore_info_dynflag_register(void);
> > +
>
> Hi, David, others.
>
> Is there a reason to not expose this function to the application?
>
> The point is that application will likely want to know the value
> of the flag before creating any devices. I.e. request it once
> and use for all devices later without performing a call to an
> external library (DPDK). In current implementation, application
> will need to open some device first, and only then the result of
> rte_flow_restore_info_dynflag() will become meaningful.
>
> There is no need to require application to call this function,
> it can still be called from the rx negotiation API, but it would
> be nice if application could know it beforehand, i.e. had control
> over when the flag is actually becomes visible.
DPDK tries to register flags only when needed, as there is not a lot
of space for dyn flags.
Some drivers take some space and applications want some share too.
DPDK can export the _register function for applications to call it
regardless of what driver will be used later.
Yet, I want to be sure why it matters in OVS context.
Is it not enough resolving the flag (by calling
rte_flow_restore_info_dynflag()) once rte_eth_rx_metadata_negotiate
for tunnel metadata is called?
Do you want to avoid an atomic store/load between OVS main thread and
PMD threads?
--
David Marchand
next prev parent reply other threads:[~2023-09-26 9:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-05 10:31 [RFC PATCH] " David Marchand
2023-05-24 12:57 ` David Marchand
2023-05-24 16:00 ` Ori Kam
2023-05-24 18:44 ` David Marchand
2023-06-01 8:48 ` David Marchand
2023-06-01 9:31 ` Ori Kam
2023-06-01 9:43 ` David Marchand
2023-06-01 10:02 ` Ori Kam
2023-06-01 10:03 ` David Marchand
2023-06-14 16:46 ` Slava Ovsiienko
2023-06-15 8:00 ` David Marchand
2023-06-15 13:47 ` [RFC PATCH v2] " David Marchand
2023-06-19 12:20 ` Andrew Rybchenko
2023-06-19 13:57 ` Slava Ovsiienko
2023-06-20 10:04 ` Ali Alnubani
2023-06-20 11:10 ` [RFC PATCH v3] " David Marchand
2023-06-20 16:43 ` Slava Ovsiienko
2023-06-21 7:43 ` David Marchand
2023-06-21 12:53 ` Ori Kam
2023-06-21 7:47 ` Ali Alnubani
2023-06-21 14:43 ` [PATCH v4] " David Marchand
2023-06-21 18:52 ` Ferruh Yigit
2023-07-31 20:41 ` Ilya Maximets
2023-09-26 9:17 ` David Marchand [this message]
2023-09-26 19:49 ` Ilya Maximets
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=CAJFAV8z_3kfTA_1orn6F9B4h6_MOhjg-Y3fTPjsZksf6+6g00A@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=alialnu@nvidia.com \
--cc=aman.deep.singh@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=drc@linux.vnet.ibm.com \
--cc=ferruh.yigit@amd.com \
--cc=i.maximets@ovn.org \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=ruifeng.wang@arm.com \
--cc=suanmingm@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
--cc=yuying.zhang@intel.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).