From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D5AD42641; Tue, 26 Sep 2023 11:18:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E35F40277; Tue, 26 Sep 2023 11:18:11 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 35A5640271 for ; Tue, 26 Sep 2023 11:18:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695719888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rJcCBZf5xuOL4D/NmqfA68+7ZhDWdcAwnQvwcNipZ9k=; b=EpfvHH5qiEODGPYyjxKdcAxI4291IJc+29ks5FW2JG526R9WZcCz4VrU3YeCu4Jbx9ArIg eDuPniCcKh2GuN7rW8HtGtWQl6Tm0abYj+wwRgFSFLWwfvr1KgooCPT7rmwGMUF75LP9Zf YeQGkU9zDChpG8HxRbKgNE2+3jQd6c8= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-Jt5EvQsdMWCWbQY5HkbtPQ-1; Tue, 26 Sep 2023 05:18:05 -0400 X-MC-Unique: Jt5EvQsdMWCWbQY5HkbtPQ-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b6ff15946fso129096451fa.2 for ; Tue, 26 Sep 2023 02:18:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695719883; x=1696324683; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rJcCBZf5xuOL4D/NmqfA68+7ZhDWdcAwnQvwcNipZ9k=; b=pEaF1sn9BxFaovmjtBlYsjmx+10MjsIuPMlobHLMKqpgKNoytoLo6/MVPrGNLmiy4v cCESAXhiJ+CKzamdnXORqnGmTeEbUkIj81BTTH2tpqCLV1yi3o8ZwEWv2t/5tjsEcdVg f3SQxiKHaWzh2oFTYlBv66sb0PVFnL+8Xu1qAcEmKqBAE3Juebib4cYQBCd0e7CxRjzv 0BVQEy2QxjN7pPUwMqtY0uSDtTMIgTVODdYyxTxOfDC7y1A0gv7ql9ms/su96FwbKg4d voB3GZZG2/uXPTwEGoTelg4b00d9HZRolscMqmKYnHpEZK3BNGDXVvyDu7fRM6b1OacN qz+Q== X-Gm-Message-State: AOJu0YxMkV79NXMiDJz5IaGTuo6mwzBKCWLhwNIPx+g6lR698izkeg8I kwPqOxpIywGgbVw+q7++hjIKvZjcYBSSuU8CdrDtzj9YqmNrtNyWWWphCx0FvjsHMDNvHLeJbw0 xO2w3q+4Tn1n1p56HKJc= X-Received: by 2002:a2e:b443:0:b0:2bd:1614:d47 with SMTP id o3-20020a2eb443000000b002bd16140d47mr8836627ljm.42.1695719883742; Tue, 26 Sep 2023 02:18:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMxis8SwHfX7H/uQt0gufNrnGykNzB/FA2Vb6J4/S90UOMRRYPssVDaCeIm0FjXb2zUIhsO5LyqNoGb0tQTBw= X-Received: by 2002:a2e:b443:0:b0:2bd:1614:d47 with SMTP id o3-20020a2eb443000000b002bd16140d47mr8836599ljm.42.1695719883394; Tue, 26 Sep 2023 02:18:03 -0700 (PDT) MIME-Version: 1.0 References: <20230505103102.2912297-1-david.marchand@redhat.com> <20230621144327.2202591-1-david.marchand@redhat.com> <820c8ce1-091a-cd9b-2dd2-c830ff0a503c@ovn.org> In-Reply-To: <820c8ce1-091a-cd9b-2dd2-c830ff0a503c@ovn.org> From: David Marchand Date: Tue, 26 Sep 2023 11:17:51 +0200 Message-ID: Subject: Re: [PATCH v4] ethdev: advertise flow restore in mbuf To: Ilya Maximets Cc: dev@dpdk.org, thomas@monjalon.net, alialnu@nvidia.com, Andrew Rybchenko , Viacheslav Ovsiienko , Ori Kam , Aman Singh , Yuying Zhang , Matan Azrad , Suanming Mou , David Christensen , Ruifeng Wang , Bruce Richardson , Konstantin Ananyev , Ferruh Yigit X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hello Ilya, On Mon, Jul 31, 2023 at 10:40=E2=80=AFPM Ilya Maximets = 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 driv= ers > > 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 requir= ed. > > > > Link: http://inbox.dpdk.org/dev/5248c2ca-f2a6-3fb0-38b8-7f659bfa40de@ov= n.org/ > > Signed-off-by: David Marchand > > Acked-by: Andrew Rybchenko > > Acked-by: Viacheslav Ovsiienko > > Tested-by: Ali Alnubani > > Acked-by: Ori Kam > > --- > > 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(-) > > > > > 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? --=20 David Marchand