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 C1A01A034F; Sun, 3 Oct 2021 14:40:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5230041240; Sun, 3 Oct 2021 14:40:31 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2047.outbound.protection.outlook.com [40.107.92.47]) by mails.dpdk.org (Postfix) with ESMTP id 50BB24122F for ; Sun, 3 Oct 2021 14:40:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LIjoXfErNc3/k9HsvJDSUghp0dG5wsU8vRNbAPcojgl22d/lrRVIdhoz/nSsFj5IDhyG7FL9mWGPipZaTEj74z7Fx98oLIGSbJjvYbBadj+J2DtepfXq7kC9zpFguac8PYeJLTGZKZdDsBfbPABVjYOhuYSyCKaZ/X0gpe8ENn2KynLN+v1vUQ8MJFmieqaIDMLzqVIfd99d60bztt13ywJmD2sw5dxdF/ycNh4jTSFjlkr7eNa/MpdC5mCqmvC3ebDCGuFyF2g9APskEppCXGhJu4MzLUdOiFj6IitOOWMKn5IiqzB79OhQHJnbRaOcmf9cjb58n5gndUJXo/koPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4FKQMdT2I07eX9i1M9gkQf78XssS896SSedhDO6NSWI=; b=Rdiq4WIP9Zlq2eV0nOe1zA1cIwFk2r+Un1GD/GBdktJTlz2iukipCm3SJFe2ioyCQAboeKrPBD8nxm3+8igbiy5WQL536BW7Chax8iVkljzlCnhn8CHFNxOLv9tRGuymiQMZeEK4tMUxzWUDPfk9vOzqRl34B6hAZ9yHjj2MNvhKN3SoEB782h028cSQyogYsn9zit+YWaRld7cJcWxwN2NLiAZpAWPzN2sD7R/ZRNExs5kTbbFV8GmoLcvl60CnKSv7rHSZPQGMRb4izb/GoFgdDsuSG/QjwQDy9y2EIvScUwBl9UoDY1g++gEtkO6yz092+qtboS+bTgsurnrPvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4FKQMdT2I07eX9i1M9gkQf78XssS896SSedhDO6NSWI=; b=fTVON9E3X/63vOkUjkyFxflis7tDr5M8OdzpK72d4Ippt/TrnhkPBUDbjjezOFZ3wIbrtvT24yV8hU6DC0jHprqH/19Xfot1iv/A4+tSYjYdPBNEFT0PsOgV0tAt+4yEyk2Gqgp0ou5G4C6CkXQui3pL3ePUP4dSY7hf9UWtXZ09dQ+w+XQqZTl+jYplqlYeZE4RAJUHWZeeiNSp99WbYpK6PuqNaLNmWwim3S+TjBasCRL4wbSRUSS2fG2b/rDWwIEwtMCcyZJIxB5jzEHkqkeiXmW/8A0ig2TgUdwNe7Z5Exbr29WuvVH4v+MYL4QS3u3Jev2m+AIMTITOuakmDg== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5215.namprd12.prod.outlook.com (2603:10b6:5:397::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Sun, 3 Oct 2021 12:40:27 +0000 Received: from DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32%5]) with mapi id 15.20.4566.022; Sun, 3 Oct 2021 12:40:27 +0000 From: Ori Kam To: Andrew Rybchenko , Xiaoyun Li , NBU-Contact-Thomas Monjalon , Ferruh Yigit CC: "dev@dpdk.org" , Ivan Malov Thread-Topic: [PATCH v1 02/12] ethdev: add eswitch port item to flow API Thread-Index: AQHXtsrq3m61at/Ih0W5n/zl4hs4qKvBLmeg Date: Sun, 3 Oct 2021 12:40:27 +0000 Message-ID: References: <20210907125157.3843-1-ivan.malov@oktetlabs.ru> <20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru> <20211001134716.1608857-3-andrew.rybchenko@oktetlabs.ru> In-Reply-To: <20211001134716.1608857-3-andrew.rybchenko@oktetlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e144420b-4117-4de6-c47e-08d9866afa59 x-ms-traffictypediagnostic: DM4PR12MB5215: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FudloIdhJWxXaJeqM+/D+7HcbBLfWOXq+vi2jjyL+i8DTu27OcIQAy7xDgSVvYZzkPFAKMYV6KS+Re519NnuLe9G/60oVAL7tZ3VfV2rqeembsWTfGyjN7OnpU1bUfgIe+E+9eIYtvqZ2LSx2sGGO217naLjVrBRVdnugfMQHTmIsr4gqlyOwx808Te23TnJIwdC3stbLC4HnpHCCkx2Qkj0Jl6kiBlIxpW6c2ZxZUUSjtA9FgiL3RHkiYQYxBiJwiIL8a5J91FtG4d8INSU022fN+PfqQeCYJrOJynZBKZGG7FmgFas3a8mbprQR1a0E4mF6Xxea53f2dtb2sCu4kaaEccxjbEbU+uRc4TBXgaN8742s982NzxWBPzyyHji3OIKs4B2nZE8rEdk8h9R12qZ3eqy64eva2EXNEgoJpX5+6zjTTt+UVFheAhfxOFplJRLymLSsuGs6RYHHHBJk8U0JvW3FTX8jNPAR7+qFzQevkv/eFaOqUB0Nfy/BQW//NcwFjgiyqY8ArJxZc/kYnLuED7TAyNobybN9hzEum8oa5A7ARNj4nHHKCJrS1bmkpgC3LYZ1y10UL41xcgqmR6IJiJFZs4vj3sIuoEgFRlhJas7RjdTlIc/bKToqhOCG5cBSqaYrjK00VRa59FeEAH8zPShIgplDmkWUTSu7v9CLAtt5A13KCofSToWAG4u/8/FG7msIEa3ZXrXMp6LEg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR12MB5400.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(122000001)(4326008)(76116006)(33656002)(8936002)(38100700002)(7696005)(38070700005)(64756008)(2906002)(53546011)(66946007)(66446008)(6506007)(66476007)(66556008)(5660300002)(8676002)(9686003)(110136005)(186003)(54906003)(52536014)(71200400001)(316002)(508600001)(83380400001)(86362001)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BM4lye+0I8KAIP/Ag/1gyKDWCphOO/Z2mVhJuiQGRvn0TibotCWvzutOc8WD?= =?us-ascii?Q?qlgGiXVCyOxUVw60Wx17Ihakm+dA9SuKX6d5pi66MqaFTCYkHWBClyE8Or+N?= =?us-ascii?Q?fHaWP7bg4fj/6EwW/cnmR6T1OzWF3zIjHglVMTJ9UCoEw0Cc6v2N7LeDvIqZ?= =?us-ascii?Q?sRZzM9u4RAnidOBLH9/N96SasXavazFh8nZBrUOS4GbAmnP876QZMzPBHZVk?= =?us-ascii?Q?kdjoLb5pdRSs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gcjgQio8Z/fcy0?= =?us-ascii?Q?P7LTrIThxZqjFzU94rayaksnzsHuda/Owjxdts22SqWo0JcSJjHDhTARut3M?= =?us-ascii?Q?6zlEHMcsBmYE9i9/K5hBH/hBaoaY+h2mV453SmvkeGJiA/BJ5UovUnzWkbh7?= =?us-ascii?Q?+qLHFy7KKuSiU/RAzzArBDYtY/P2QN9w7Cl6GKCcTiLcqTUbE3epS0nuQTER?= =?us-ascii?Q?k2IqNdqv2AGbbceg01LLDIWRZx496IOjlTVI8Eh5YlkltYT83E4U38B59tYi?= =?us-ascii?Q?OAKakewjqzvw9d9NkXTIyJv7MnWg?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR12MB5400.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e144420b-4117-4de6-c47e-08d9866afa59 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2021 12:40:27.3572 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7rEB5H1SygL80ZfALGivonQbwEr8mWRcINtGsCHQhi/0sJDMbv2rmcfCR6iTzp30UZdMs7pimBhmqavhY6DY/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5215 Subject: Re: [dpdk-dev] [PATCH v1 02/12] ethdev: add eswitch port item to flow API 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 Sender: "dev" Hi Andrew and Ivan, > -----Original Message----- > From: Andrew Rybchenko > Sent: Friday, October 1, 2021 4:47 PM > Subject: [PATCH v1 02/12] ethdev: add eswitch port item to flow API >=20 > From: Ivan Malov >=20 > For use with "transfer" flows. Supposed to match traffic entering the e-s= witch > from the external world (network, guests) via the port which is logically > connected with the given ethdev. >=20 > Must not be combined with attributes "ingress" / "egress". >=20 > This item is meant to use the same structure as ethdev item. >=20 In case the app is not working with representors, meaning each switch port is mapped to ethdev. both items (ethdev and eswitch port ) have the same meaning? > Signed-off-by: Ivan Malov > Signed-off-by: Andrew Rybchenko > --- > app/test-pmd/cmdline_flow.c | 27 +++++++++++++++++++++ > doc/guides/prog_guide/rte_flow.rst | 22 +++++++++++++++++ > doc/guides/rel_notes/release_21_11.rst | 2 +- > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++ > lib/ethdev/rte_flow.c | 1 + > lib/ethdev/rte_flow.h | 12 ++++++++- > 6 files changed, 66 insertions(+), 2 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index e05b0d83d2..188d0ee39d 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -308,6 +308,8 @@ enum index { > ITEM_POL_POLICY, > ITEM_ETHDEV, > ITEM_ETHDEV_ID, > + ITEM_ESWITCH_PORT, > + ITEM_ESWITCH_PORT_ETHDEV_ID, Like my comment from previous patch, I'm not sure the correct term for ETHDEV is ID is should be port. >=20 > /* Validate/create actions. */ > ACTIONS, > @@ -1003,6 +1005,7 @@ static const enum index next_item[] =3D { > ITEM_INTEGRITY, > ITEM_CONNTRACK, > ITEM_ETHDEV, > + ITEM_ESWITCH_PORT, > END_SET, > ZERO, > }; > @@ -1377,6 +1380,12 @@ static const enum index item_ethdev[] =3D { > ZERO, > }; >=20 > +static const enum index item_eswitch_port[] =3D { > + ITEM_ESWITCH_PORT_ETHDEV_ID, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index next_action[] =3D { > ACTION_END, > ACTION_VOID, > @@ -3632,6 +3641,21 @@ static const struct token token_list[] =3D { > item_param), > .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_ethdev, id)), > }, > + [ITEM_ESWITCH_PORT] =3D { > + .name =3D "eswitch_port", > + .help =3D "match traffic at e-switch going from the external port > associated with the given ethdev", Missing the word logically since if we are talking about representor the co= nnected port is the PF while we want to match traffic on one of the FVs. > + .priv =3D PRIV_ITEM(ESWITCH_PORT, > + sizeof(struct rte_flow_item_ethdev)), > + .next =3D NEXT(item_eswitch_port), > + .call =3D parse_vc, > + }, > + [ITEM_ESWITCH_PORT_ETHDEV_ID] =3D { > + .name =3D "ethdev_id", > + .help =3D "ethdev ID", > + .next =3D NEXT(item_eswitch_port, > NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_ethdev, id)), > + }, > /* Validate/create actions. */ > [ACTIONS] =3D { > .name =3D "actions", > @@ -8370,6 +8394,9 @@ flow_item_default_mask(const struct > rte_flow_item *item) > case RTE_FLOW_ITEM_TYPE_ETHDEV: > mask =3D &rte_flow_item_ethdev_mask; > break; > + case RTE_FLOW_ITEM_TYPE_ESWITCH_PORT: > + mask =3D &rte_flow_item_ethdev_mask; > + break; Not sure maybe merged the two cases? > default: > break; > } > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index ab628d9139..292bb42410 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -1460,6 +1460,28 @@ Use this with attribute **transfer**. Attributes > **ingress** and > | ``mask`` | ``id`` | zeroed for wildcard match | > +----------+----------+---------------------------+ >=20 > +Item: ``ESWITCH_PORT`` > +^^^^^^^^^^^^^^^^^^^^^^ > + > +Matches traffic at e-switch going from the external port associated > +with the given ethdev, for example, traffic from net. port or guest. Maybe replace external with e-switch? > + > +:: > + > + * (Ethdev) ~~~~~~~~~~~~ (Internal Port) ~~~~ [] <<<< (External Por= t) > + * : SW : Logical Net / Guest= : > + * : : = : > + * | ---- PMD Layer ---- | ------------ E-Switch Layer ------------= | > + * > + * [] shows the effective ("transfer") standpoint, the match engine= ; > + * << shows the traffic flow in question hitting the match engine; > + * ~~ shows logical interconnects between the endpoints. > + I'm not sure I understand this diagram. > +Use this with attribute **transfer**. Attributes **ingress** and > +**egress** (`Attribute: Traffic direction`_) must not be used. > + > +This item is meant to use the same structure as `Item: ETHDEV`_. > + > Actions > ~~~~~~~ >=20 > diff --git a/doc/guides/rel_notes/release_21_11.rst > b/doc/guides/rel_notes/release_21_11.rst > index 91631adb4e..b2b27de3f0 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -167,7 +167,7 @@ API Changes > 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 >=20 > -* ethdev: Added item ``ETHDEV`` to flow API. > +* ethdev: Added items ``ETHDEV``, ``ESWITCH_PORT`` to flow API. >=20 > * cryptodev: The API rte_cryptodev_pmd_is_valid_dev is modified to > rte_cryptodev_is_valid_dev as it can be used by the application as dif= f --git > a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 6d5de5457c..9a5c2a2d82 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3824,6 +3824,10 @@ This section lists supported pattern items and > their attributes, if any. >=20 > - ``id {unsigned}``: ethdev ID >=20 > +- ``eswitch_port``: match traffic at e-switch going from the external > +port associated with the given ethdev > + > + - ``ethdev_id {unsigned}``: ethdev ID > + > Actions list > ^^^^^^^^^^^^ >=20 > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index > 84eb61cb6c..c4aea5625f 100644 > --- a/lib/ethdev/rte_flow.c > +++ b/lib/ethdev/rte_flow.c > @@ -101,6 +101,7 @@ static const struct rte_flow_desc_data > rte_flow_desc_item[] =3D { > MK_FLOW_ITEM(INTEGRITY, sizeof(struct rte_flow_item_integrity)), > MK_FLOW_ITEM(CONNTRACK, sizeof(uint32_t)), > MK_FLOW_ITEM(ETHDEV, sizeof(struct rte_flow_item_ethdev)), > + MK_FLOW_ITEM(ESWITCH_PORT, sizeof(struct > rte_flow_item_ethdev)), > }; >=20 > /** Generate flow_action[] entry. */ > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index > 880502098e..1a7e4c2e3d 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -583,6 +583,16 @@ enum rte_flow_item_type { > * @see struct rte_flow_item_ethdev > */ > RTE_FLOW_ITEM_TYPE_ETHDEV, > + > + /** > + * [META] > + * > + * Matches traffic at e-switch going from the external port associated > + * with the given ethdev, for example, traffic from net. port or guest. > + * > + * @see struct rte_flow_item_ethdev > + */ > + RTE_FLOW_ITEM_TYPE_ESWITCH_PORT, > }; >=20 > /** > @@ -1813,7 +1823,7 @@ static const struct rte_flow_item_conntrack > rte_flow_item_conntrack_mask =3D { > * @b EXPERIMENTAL: this structure may change without prior notice > * > * Provides an ethdev ID for use with items which are as follows: > - * RTE_FLOW_ITEM_TYPE_ETHDEV. > + * RTE_FLOW_ITEM_TYPE_ETHDEV, > RTE_FLOW_ITEM_TYPE_ESWITCH_PORT. > */ > struct rte_flow_item_ethdev { > uint16_t id; /**< Ethdev ID */ > -- > 2.30.2 Best, Ori