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 4D35C42A68; Fri, 5 May 2023 05:36:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22E06410EA; Fri, 5 May 2023 05:36:14 +0200 (CEST) Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com [209.85.222.46]) by mails.dpdk.org (Postfix) with ESMTP id 3232B40ED7 for ; Fri, 5 May 2023 05:36:12 +0200 (CEST) Received: by mail-ua1-f46.google.com with SMTP id a1e0cc1a2514c-77d508ba6faso440027241.2 for ; Thu, 04 May 2023 20:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683257771; x=1685849771; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=w5n9libb/K9bo9I5VHEpQBUD6SraUHYHrCcZjXRds/I=; b=XFTg9eDuiZs+gwaP7pN8oVADlY6k5ReA2ZjIsVOLAQmYh1kYWdxeS2SZ3mu9E0DgQE RCS51ap7ip9C/x6kZKZHj3yEmqBqRwcYWYdtUywySUsZ+y6Q55NXnXFscj0w6SxkDf6h 1TdBN0pZ5mKjfJjO8SLxucWQCVidTr8t7zc8IYrf47uIDJLs08wFBIE9vR5R7rFwpUdA oWTQ9gQH37t5YBBzLUGd91qgzWLcaDHGhNspzv2sm6GLo1PktFAXf7MuyMt3s3oe4ols GNHHpKXOKhTRR4+zVaG8z297Pat/Nc6ahVAJBLF2AfNokQ9c3w2uzPua+5u5MITBMlSH 1aYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683257771; x=1685849771; 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=w5n9libb/K9bo9I5VHEpQBUD6SraUHYHrCcZjXRds/I=; b=C9Zc7nG6ke3sDWlkVjUtlw5nTFQ+dVe3CKw3SNVuknmKy48FdNDVrn4cU+EPX9KHYJ SDB0yO1u5X7Rc8Z5lO2ezhMS8mmt8VbsflhmzGiRWvnZNsM+RaVSzwjnsdKPLhv3UB4o s/pVN9Ykg2y+k0vvIsBT8Rh3mBlGcWm/KXduerlmwzUia73fciZd2Ioyg58eck8cp8OF qPz+73VQvx0bHNrXylS6v1x7I3hhJOExHCpdshbtsRv8vSNpmBdk2/Xmly3Eq7SritDd ON+UIMVEgoxyt6MqjKKdVqe/HrF8VnHqB/+GeF9SSqw5igFUes9Br5cVU0ZR/Sr0IF7f G+Kg== X-Gm-Message-State: AC+VfDzT/3d7OOljG1/ARgPHRRGFzLhsVl3U5IpAUZaibd3VVQPA4jiM ekXDZb9WnN868BoAfbXPkgcH74Bi64GMQVddKVM= X-Google-Smtp-Source: ACHHUZ4BFmXZyzAN2zL8gU13C5qADF8xVMESs5bVt0o0FT5hN7g2FxE5yx3/ZlHORddgx4ZNWCpvV1gmmXMT2jgOSEg= X-Received: by 2002:a67:e3d6:0:b0:42f:a9ce:6930 with SMTP id k22-20020a67e3d6000000b0042fa9ce6930mr97234vsm.18.1683257771293; Thu, 04 May 2023 20:36:11 -0700 (PDT) MIME-Version: 1.0 References: <20230420052901.918948-1-kirankumark@marvell.com> In-Reply-To: <20230420052901.918948-1-kirankumark@marvell.com> From: Jerin Jacob Date: Fri, 5 May 2023 09:05:45 +0530 Message-ID: Subject: Re: [dpdk-dev][PATCH] ethdev: add send queue flow matching item To: kirankumark@marvell.com Cc: Ori Kam , Aman Singh , Yuying Zhang , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , dev@dpdk.org 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 On Thu, Apr 20, 2023 at 10:59=E2=80=AFAM wrote: > > From: Kiran Kumar K > > Adding support for send queue flow matching item. To be consistent, use Tx queue every where.(git commit subject too) > This item is valid only for egress rules. > An example use case would be that application can > set different vlan insert rules with different PCP values > based on tx queue number. > > Signed-off-by: Kiran Kumar K > --- > app/test-pmd/cmdline_flow.c | 28 +++++++++++++++++++ > doc/guides/prog_guide/rte_flow.rst | 7 +++++ > doc/guides/rel_notes/release_23_07.rst | 31 ++------------------- > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++ > lib/ethdev/rte_flow.c | 1 + > lib/ethdev/rte_flow.h | 26 +++++++++++++++++ > 6 files changed, 68 insertions(+), 29 deletions(-) > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 58939ec321..a68a6080a8 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -496,6 +496,8 @@ enum index { > ITEM_QUOTA_STATE_NAME, > ITEM_AGGR_AFFINITY, > ITEM_AGGR_AFFINITY_VALUE, > + ITEM_TX_QUEUE, > + ITEM_TX_QUEUE_VALUE, > > /* Validate/create actions. */ > ACTIONS, > @@ -1452,6 +1454,7 @@ static const enum index next_item[] =3D { > ITEM_METER, > ITEM_QUOTA, > ITEM_AGGR_AFFINITY, > + ITEM_TX_QUEUE, > END_SET, > ZERO, > }; > @@ -1953,6 +1956,12 @@ static const enum index item_aggr_affinity[] =3D { > ZERO, > }; > > +static const enum index item_tx_queue[] =3D { > + ITEM_TX_QUEUE_VALUE, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index next_action[] =3D { > ACTION_END, > ACTION_VOID, > @@ -6945,6 +6954,22 @@ static const struct token token_list[] =3D { > .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_aggr_affin= ity, > affinity)), > }, > + [ITEM_TX_QUEUE] =3D { > + .name =3D "tx_queue", > + .help =3D "match on the tx queue of send packet", > + .priv =3D PRIV_ITEM(TX_QUEUE, > + sizeof(struct rte_flow_item_tx_queue)), > + .next =3D NEXT(item_tx_queue), > + .call =3D parse_vc, > + }, > + [ITEM_TX_QUEUE_VALUE] =3D { > + .name =3D "tx_queue_value", > + .help =3D "tx queue value", > + .next =3D NEXT(item_tx_queue, NEXT_ENTRY(COMMON_UNSIGNED)= , > + item_param), > + .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_tx_queue, > + tx_queue)), > + }, > }; > > /** Remove and return last entry from argument stack. */ > @@ -11849,6 +11874,9 @@ flow_item_default_mask(const struct rte_flow_item= *item) > case RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY: > mask =3D &rte_flow_item_aggr_affinity_mask; > break; > + case RTE_FLOW_ITEM_TYPE_TX_QUEUE: > + mask =3D &rte_flow_item_tx_queue_mask; > + break; > default: > break; > } > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/r= te_flow.rst > index 32fc45516a..7154b56330 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -1486,6 +1486,13 @@ This item is meant to use the same structure as `I= tem: PORT_REPRESENTOR`_. > > See also `Action: REPRESENTED_PORT`_. > > +Item: ``TX_QUEUE`` > +^^^^^^^^^^^^^^^^^^^^^^^ > + > +Matches on the tx queue of send packet . tx -> Tx > + > +- ``tx_queue``: Tx queue. > + > Item: ``AGGR_AFFINITY`` > ^^^^^^^^^^^^^^^^^^^^^^^ > > diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_note= s/release_23_07.rst > index a9b1293689..631cbd2b58 100644 > --- a/doc/guides/rel_notes/release_23_07.rst > +++ b/doc/guides/rel_notes/release_23_07.rst > @@ -24,36 +24,9 @@ DPDK Release 23.07 > New Features > ------------ > > -.. This section should contain new features added in this release. > - Sample format: > +* **Added flow matching of tx queue.** Same as below. Right? > > - * **Add a title in the past tense with a full stop.** > - > - Add a short 1-2 sentence description in the past tense. > - The description should be enough to allow someone scanning > - the release notes to understand the new feature. > - > - If the feature adds a lot of sub-features you can use a bullet list > - like this: > - > - * Added feature foo to do something. > - * Enhanced feature bar to do something else. > - > - Refer to the previous release notes for examples. > - > - Suggested order in release notes items: > - * Core libs (EAL, mempool, ring, mbuf, buses) > - * Device abstraction libs and PMDs (ordered alphabetically by vendo= r name) > - - ethdev (lib, PMDs) > - - cryptodev (lib, PMDs) > - - eventdev (lib, PMDs) > - - etc > - * Other libs > - * Apps, Examples, Tools (if significant) > - > - This section is a comment. Do not overwrite or remove it. > - Also, make sure to start the actual text at the margin. > - =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D No need to remove this section comment. > + Added ``RTE_FLOW_ITEM_TYPE_TX_QUEUE`` to match tx queue of send packet= . Added ``RTE_FLOW_ITEM_TYPE_TX_QUEUE`` rte_flow pattern to match Tx queue of send packet. > > > Removed Items > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/tes= tpmd_app_ug/testpmd_funcs.rst > index 8f23847859..29f7dd4428 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3779,6 +3779,10 @@ This section lists supported pattern items and the= ir attributes, if any. > > - ``affinity {value}``: aggregated port (starts from 1). > > +- ``tx_queue``: match tx queue of send packet. > + > + - ``tx_queue {value}``: send queue value (starts from 0). > + > - ``send_to_kernel``: send packets to kernel. > > > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c > index 69e6e749f7..f0d7f868fa 100644 > --- a/lib/ethdev/rte_flow.c > +++ b/lib/ethdev/rte_flow.c > @@ -164,6 +164,7 @@ static const struct rte_flow_desc_data rte_flow_desc_= item[] =3D { > MK_FLOW_ITEM(IPV6_ROUTING_EXT, sizeof(struct rte_flow_item_ipv6_r= outing_ext)), > MK_FLOW_ITEM(QUOTA, sizeof(struct rte_flow_item_quota)), > MK_FLOW_ITEM(AGGR_AFFINITY, sizeof(struct rte_flow_item_aggr_affi= nity)), > + MK_FLOW_ITEM(TX_QUEUE, sizeof(struct rte_flow_item_tx_queue)), > }; > > /** Generate flow_action[] entry. */ > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h > index 713ba8b65c..e75876c371 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -672,8 +672,34 @@ enum rte_flow_item_type { > * @see struct rte_flow_item_aggr_affinity. > */ > RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY, > + /** > + * Match Send Queue number. Tx queue > + * This is valid only for egress rules. > + * > + * @see struct rte_flow_item_tx_queue > + */ > + RTE_FLOW_ITEM_TYPE_TX_QUEUE, > }; > > +/** > + * RTE_FLOW_ITEM_TYPE_TX_QUEUE > + * > + * Send queue number Tx > + * > + * @see struct rte_flow_item_tx_queue > + */ > +struct rte_flow_item_tx_queue { > + /** Send queue number that packet is being transmitted */ Tx > + uint16_t tx_queue; > +}; > + > +/** Default mask for RTE_FLOW_ITEM_TX_QUEUE. */ > +#ifndef __cplusplus > +static const struct rte_flow_item_tx_queue rte_flow_item_tx_queue_mask = =3D { > + .tx_queue =3D RTE_BE16(0xffff), > +}; > +#endif > + > /** > * @warning > * @b EXPERIMENTAL: this API may change without prior notice. > -- > 2.34.1 >