From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 3581DA0548;
	Sun, 10 Oct 2021 13:16:01 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B2F3840040;
	Sun, 10 Oct 2021 13:16:00 +0200 (CEST)
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83])
 by mails.dpdk.org (Postfix) with ESMTP id E6A584003C
 for <dev@dpdk.org>; Sun, 10 Oct 2021 13:15:58 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BkUvGcr44yTfI8z6w84+RzTS8KBbIlMA7yzWvt/bma5oD/PTl11XM9XVLwD6NApjsGPWemFGsygP13ckixAILzeyEpsatp/KJzVDK9ytAfYu2LyVAxMNxNsj4w6Svbulz6mG5b/A1BC+cxlVVTjYohJYrJjBKMHrHO/HhEqZL3Z3CHONiX4zqqPlezQN1O23LlCXnm42EqezLhe8PXtg7K7GY7NQIQh+kzz8bg4nAqHkS4L6FNLyi9uNm80AieFs3GEin4pZWwHFYUzoh91K1lJfneNdm3NuwS47NyGYk6MBEGH+SMFj1RFzyghzUUCzoDkX/LBmFD6bPi7SGPj+Vg==
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=JlLe3YqH1FSBTJaFqiv8RwRc8WQxaFh9jK6HQF1BA4k=;
 b=aqh4sHvj6LhakMlak7Gx01p3XKO2uA0jnL+hKW62x2Zao8/6vMp/lSpPhMQxP8B3LOE9mAHd2TolZ/Xwrk7EpDAxwGHGYazet0ENqAatDnF9aXuaOzW12oaILV96hwUs+2XSyghFhzdwWONS+zqyG+uOmVUpkoLQlMfG7uOLjzTKw0xgLAHcAuD9bHTu4nLsolmn03rQ/QO9sRzLZqDZu9NM5TG3+0jhqqRkWQuiGQWBy+wN4kF1VPOwC+uMCm2eqWOOOTL5LH7fu43E+dDyRGWzkbo1K/v+GZlOv6vsEidza5mSYPELoqGV70YtOPSUDzXXFYeRQZQCsxEWQ3Fd+Q==
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=JlLe3YqH1FSBTJaFqiv8RwRc8WQxaFh9jK6HQF1BA4k=;
 b=O2KfT3wlvOowt7wvdLRJD4JhAkQQlVNI5u3KtOOSZexVkv8RKWuNLd08q4+s/klr5iKtUSQCRhH8HII8+KOdawDkjW76VaYFmCI7B0Z3n3vCWIqsr4wbXXjPUNXxIrlBPavV56MZN6xSb6vwPIXSSFuu9vfJO/tqMylbxKuRLFrxYI8RvgQ/K+DGLrgkYlF4dNoNQYPpLwpNvECFKw3oWt/dLQG32gNgkwY2c6S0e5XUoeZMGz0sLhsz/q5+0+Gc19gSloc0q+LqczTARwiNUH9XjRp145gGw7eFSvguc7xWcyIIh2+61AJeMPfNG4Ib3Zu5eV6KUdnU4wB0yvrh4A==
Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by
 DM4PR12MB5344.namprd12.prod.outlook.com (2603:10b6:5:39f::11) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.4587.22; Sun, 10 Oct 2021 11:15:56 +0000
Received: from DM8PR12MB5400.namprd12.prod.outlook.com
 ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com
 ([fe80::d03d:1f75:ca20:6a32%6]) with mapi id 15.20.4587.025; Sun, 10 Oct 2021
 11:15:56 +0000
From: Ori Kam <orika@nvidia.com>
To: Ivan Malov <ivan.malov@oktetlabs.ru>, "dev@dpdk.org" <dev@dpdk.org>
CC: NBU-Contact-Thomas Monjalon <thomas@monjalon.net>, Xiaoyun Li
 <xiaoyun.li@intel.com>, Ferruh Yigit <ferruh.yigit@intel.com>, Andrew
 Rybchenko <andrew.rybchenko@oktetlabs.ru>
Thread-Topic: [PATCH v2 01/12] ethdev: add port representor item to flow API
Thread-Index: AQHXvWqBha//uHfJuUqQCqQ7aUDqnqvL+qFw
Date: Sun, 10 Oct 2021 11:15:56 +0000
Message-ID: <DM8PR12MB5400572EDCD3122F1EB743A3D6B49@DM8PR12MB5400.namprd12.prod.outlook.com>
References: <20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru>
 <20211010000503.28712-1-ivan.malov@oktetlabs.ru>
 <20211010000503.28712-2-ivan.malov@oktetlabs.ru>
In-Reply-To: <20211010000503.28712-2-ivan.malov@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: 278cb62a-c9cc-4349-cf68-08d98bdf54c5
x-ms-traffictypediagnostic: DM4PR12MB5344:
x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr
x-microsoft-antispam-prvs: <DM4PR12MB534490E27F611EB2A210B3DFD6B49@DM4PR12MB5344.namprd12.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8882;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: X92R3DziteRYSnw6lIf0Q5jabLpYQVvEUeqVuy9E/Trqin+Kp4faJQwPQLDKCuaV7wZV6yFM/w9XdF15XolACGbHxY8vUIjfuz6+gRTbAcHDDtTLkRd4n8eSFncp1S5hIVWajPcHDNyj5eaGSNQycAhz5H8PnMyoJBsy3V8jEGj4xaNKyANtW0OwKEoi88IZCiNX4mF0b7nQ0GFj8qoOPbmeCo58LkIqqFJIn8aju0447Np8DIWn85JLkkBCXam0vArbrhUUurtKQrCVCF+994KvZaf0KTZWQb2wgRvSyM3swmSSS8dXdG2HP91l6v/+KoSiSEiZU18CF1fyhq0YAuvICDUn8wDPZhRZsy8NQyr3aJe654wOSUNlZGpgKSu8bvTJBhC7bJrjwXzKBQHf70uZoRjn2O8rr6Auf3s2SXC5OvuDuJ2eCXk/BT5Cmg5NI6l+nbmA75LNsEfFsLtngO9cIxaS3P8kzkILwtncaewzCRonk2MIqkfD3SHvzPZEVILxFQF2VE1yQvFh0ozF400KjXOk/7b/9KdwC5eKG/Pam3WgEzXJCQE0UAcdp/a2bcIlyGq+yjTqTAzEbv68ajd60TejfV0rJpu/A95qNGn7VDLoRBxYh3hdJae6Fx7/+mvJtUyRUDEhwprKD+Je1tO8Iv2V5c51txdZXS/XFmx2uZhfFup50lXrHWAMBoofpLTWo/zrciK1m2K8Y8N0vw==
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)(7696005)(122000001)(4326008)(508600001)(8936002)(5660300002)(55016002)(38070700005)(38100700002)(2906002)(53546011)(9686003)(6506007)(33656002)(66946007)(83380400001)(52536014)(186003)(8676002)(86362001)(71200400001)(316002)(110136005)(76116006)(54906003)(66476007)(66556008)(64756008)(66446008);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xzFK9GEJ1sofm5bE8KTWE0ssGZ7OXeVffBOcqRepcEEHcuTy4ptsVHikdwTZ?=
 =?us-ascii?Q?7j5TVzbm9KMKLRD11VHKN3D57aGHnVnH4owAXa55ptFlaDstpi6Wk0JSOmuP?=
 =?us-ascii?Q?ZtJMUHJWrCwo6IAYhA0go03WhjtPsdAPJK+kG2m0LxnAEKGDgVGgxG/LfyOE?=
 =?us-ascii?Q?NmFdVrklsMvjQVG0Akpfr2RvKWMH3qew7oCV6cIanvfgqb71hBTM83jDaNCN?=
 =?us-ascii?Q?3nCUp/k8TGDQOqBWXaGnZTMGQkc9Am1wQCTS+BhKM8KGUluwPYpgBsRIOYue?=
 =?us-ascii?Q?A+MKLVGrmeKEZJsQqijYdPhVriur2La0Flzo/yXqQ3K0Tk05qncIppIKRQnZ?=
 =?us-ascii?Q?9ne+y7xsZ/+lBamf0Fv2t5SQHwmjUKCqfYOnsr1Hqtr5qzAh9vxLdZqSPizt?=
 =?us-ascii?Q?0tZpmbWquZ7S2EfQfz6pMgpTdlGjSoDzHEwbBIZT6J8xMmOwyrDTx5PTu/Ha?=
 =?us-ascii?Q?5huDeBi8u3q/JX6fSakzCgFszKRCuEqu+Wb4XzcZ4EfmFHwH031l6d1qqmKg?=
 =?us-ascii?Q?wCQGv2aOOil4mqbfAk1wa0/cWecN2Zun61aflfzaTHS5sKmY6jSTFNEolYZH?=
 =?us-ascii?Q?hk0h6aUuxY/JYueVmjjJ8CNHZjLvKdWceZDCLNY/sTdxwBhOaf0iO2nI9dgM?=
 =?us-ascii?Q?uDh1VMN0vV1vqlhDMjPI5Mqtt1JfgPiJQnMab/U4/7wFvPh3n/35d2v63ukT?=
 =?us-ascii?Q?EgOBeGB9Tb/r6A92OgVUolurNxWl4WShdNRrOZb7V5QkBMZshLVFUU1MCvKL?=
 =?us-ascii?Q?joMKuS+FyRwdxy/NXMXsfuom4cPaWTQx23+8oEyyG7BZIQp70aLaQflaDkze?=
 =?us-ascii?Q?rxX6RrZSf5ZWqHx8VgE0CHphNcM3IHi5fxuWjqpg4rCylqxxwcYLKtg6uPgJ?=
 =?us-ascii?Q?W9XWB7xC8sS3np1J311n+6RzgXLic1Dmziduzv5y3Jtt0SxwmXtcoiFwH3I4?=
 =?us-ascii?Q?30YIsiNtQBp7tsy8KTFmAda3wELlMZh5QHXO/S6WpA3dHTsiRqAZY83E1U2T?=
 =?us-ascii?Q?mycG0CTowRSgkWAoM2qVaNmj43WUIzsDtTNbsFpmbysvazYevqGT9FE+AVi2?=
 =?us-ascii?Q?OTMdRUR4QA2tia1+H/lXl3PgxVENkdDjHlEvYakNSurxA9z81UQ7xJvoAQ1Q?=
 =?us-ascii?Q?LClooW7C7UJt3l/qCYaLgxCUAvkNZ1Sy1Qj3aCG2qMMJiIY8R5eKIzz7Vk1R?=
 =?us-ascii?Q?3GVMY83xJtCZPK1FnPUDiAndE7Dhh33oHcNITwgA1s2V18UjEfBaHIIDJMJq?=
 =?us-ascii?Q?5NEeUYil/MyaLoKY4vH9y7CynSt5d1pdgecPf9aaQsyfUD9MuEhlOF3U7LDr?=
 =?us-ascii?Q?eh4gy+ASVM6Je630jJG5fd8FlJ2onC0liB9JXXzC3VQKGi4Futd0/Rg5+Evb?=
 =?us-ascii?Q?N6w3L0HOY1KvKT1fwDewBEo/HGQm?=
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: 278cb62a-c9cc-4349-cf68-08d98bdf54c5
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2021 11:15:56.4882 (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: Tks/T1hC3ooyO7K0taY9vs5VitCrZWmw0a9lhLh9xh5SAw6oSml168aoTyz4iUqnSqSnFsfTAlYtYnCciIkSbw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5344
Subject: Re: [dpdk-dev] [PATCH v2 01/12] ethdev: add port representor item
 to flow API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi Ivan,

>From the new patches I saw you choose port_representor and represented_port
Didn't we agree to go with ETHDEV_PORT and SHADOW_PORT?
The only thing that worries me is that the naming are very easy to get wron=
g.
port_representor and represented_port.

Also there is an issue with wording if we assume like in previous thread th=
at
DPDK can have both the representor port and also the represented_port.
While if we look at for example ethdev_port and shadow port are better defi=
ned
as ethdev_port -> the port that is closest to the DPDK ethdev while shadow =
port
is defined as the other side of the ethdev port.

What do you think?

> -----Original Message-----
> From: Ivan Malov <ivan.malov@oktetlabs.ru>
> Sent: Sunday, October 10, 2021 3:05 AM
> Subject: [PATCH v2 01/12] ethdev: add port representor item to flow API
> ?
> For use in "transfer" flows. Supposed to match traffic entering the embed=
ded
> switch from the given ethdev.


I would also add a comment that says the since we are in transfer it means
that all rules are located in the E-Switch which means that the matching is=
 done
on the source port of the traffic.=20

I think this will also help understand the view point that we are looking f=
rom the point
of the switch, and to add the drawing.

>=20
> Must not be combined with direction attributes.
>=20
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> ---
>  app/test-pmd/cmdline_flow.c                 | 27 ++++++++++
>  doc/guides/prog_guide/rte_flow.rst          | 59 +++++++++++++++++++++
>  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                       | 27 ++++++++++
>  6 files changed, 120 insertions(+)
>=20
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c in=
dex
> bb22294dd3..a912a8d815 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -306,6 +306,8 @@ enum index {
>  	ITEM_POL_PORT,
>  	ITEM_POL_METER,
>  	ITEM_POL_POLICY,
> +	ITEM_PORT_REPRESENTOR,
> +	ITEM_PORT_REPRESENTOR_PORT_ID,
>=20
>  	/* Validate/create actions. */
>  	ACTIONS,
> @@ -1000,6 +1002,7 @@ static const enum index next_item[] =3D {
>  	ITEM_GENEVE_OPT,
>  	ITEM_INTEGRITY,
>  	ITEM_CONNTRACK,
> +	ITEM_PORT_REPRESENTOR,
>  	END_SET,
>  	ZERO,
>  };
> @@ -1368,6 +1371,12 @@ static const enum index item_integrity_lv[] =3D {
>  	ZERO,
>  };
>=20
> +static const enum index item_port_representor[] =3D {
> +	ITEM_PORT_REPRESENTOR_PORT_ID,
> +	ITEM_NEXT,
> +	ZERO,
> +};
> +
>  static const enum index next_action[] =3D {
>  	ACTION_END,
>  	ACTION_VOID,
> @@ -3608,6 +3617,21 @@ static const struct token token_list[] =3D {
>  			     item_param),
>  		.args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_conntrack,
> flags)),
>  	},
> +	[ITEM_PORT_REPRESENTOR] =3D {
> +		.name =3D "port_representor",
> +		.help =3D "match traffic entering the embedded switch from the
> given ethdev",
> +		.priv =3D PRIV_ITEM(PORT_REPRESENTOR,
> +				  sizeof(struct rte_flow_item_ethdev)),
> +		.next =3D NEXT(item_port_representor),
> +		.call =3D parse_vc,
> +	},
> +	[ITEM_PORT_REPRESENTOR_PORT_ID] =3D {
> +		.name =3D "port_id",
> +		.help =3D "ethdev port ID",
> +		.next =3D NEXT(item_port_representor,
> NEXT_ENTRY(COMMON_UNSIGNED),
> +			     item_param),
> +		.args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_ethdev,
> port_id)),
> +	},
>  	/* Validate/create actions. */
>  	[ACTIONS] =3D {
>  		.name =3D "actions",
> @@ -8343,6 +8367,9 @@ flow_item_default_mask(const struct rte_flow_item
> *item)
>  	case RTE_FLOW_ITEM_TYPE_PFCP:
>  		mask =3D &rte_flow_item_pfcp_mask;
>  		break;
> +	case RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR:
> +		mask =3D &rte_flow_item_ethdev_mask;
> +		break;
>  	default:
>  		break;
>  	}
> diff --git a/doc/guides/prog_guide/rte_flow.rst
> b/doc/guides/prog_guide/rte_flow.rst
> index 2b42d5ec8c..2e0f590777 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -1425,6 +1425,65 @@ Matches a conntrack state after conntrack action.
>  - ``flags``: conntrack packet state flags.
>  - Default ``mask`` matches all state bits.
>=20
> +Item: ``PORT_REPRESENTOR``
> +^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Matches traffic entering the embedded switch from the given ethdev.
> +
> +Term **ethdev** and the concept of **port representor** are synonymous.
> +The **represented port** is an *entity* plugged to the embedded switch
> +at the opposite end of the "wire" leading to the ethdev.
> +
> +::
> +
> +    .------------------------.
> +    |    PORT_REPRESENTOR    |  Ethdev (Application Port Referred to by =
its ID)
> +    '------------------------'
> +                ||
> +                \/
> +    .------------------------.
> +    |  Embedded Switch Port  |  Logical Port
> +    '------------------------'
> +                ||
> +                ||
> +                ||
> +                \/
> +    .------------------------.
> +    |  Embedded Flow Engine  |
> +    '------------------------'
> +                :
> +                 :
> +                :
> +                 :
> +    .------------------------.
> +    |  Embedded Switch Port  |  Logical Port
> +    '------------------------'
> +                :
> +                 :
> +    .------------------------.
> +    |    REPRESENTED_PORT    |  Net / Guest / Another Ethdev (Same
> Application)
> +    '------------------------'
> +
> +

I think this drawing is harder to understand than the one
you draw in the previous thread (A-> ethdev, b-> embedded switch, switch , =
c-> embedded switch, d -> represented entity (shadow port).

> +- Incompatibe with `Attribute: Traffic direction`_.
> +- Requires `Attribute: Transfer`_.
> +
> +.. _table_rte_flow_item_ethdev:
> +
> +.. table:: ``struct rte_flow_item_ethdev``
> +
> +   +----------+-------------+---------------------------+
> +   | Field    | Subfield    | Value                     |
> +   +=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+
> +   | ``spec`` | ``port_id`` | ethdev port ID            |
> +   +----------+-------------+---------------------------+
> +   | ``last`` | ``port_id`` | upper range value         |
> +   +----------+-------------+---------------------------+
> +   | ``mask`` | ``port_id`` | zeroed for wildcard match |
> +   +----------+-------------+---------------------------+
> +
> +- Default ``mask`` provides exact match behaviour.
> +
>  Actions
>  ~~~~~~~
>=20
> diff --git a/doc/guides/rel_notes/release_21_11.rst
> b/doc/guides/rel_notes/release_21_11.rst
> index 89d4b33ef1..1261cb2bf3 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -188,6 +188,8 @@ 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 ``PORT_REPRESENTOR`` to flow API.
> +
>  * kvargs: The experimental function ``rte_kvargs_strcmp()`` has been
>    removed. Its usages have been replaced by a new function
>    ``rte_kvargs_get_with_value()``.
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index 8ead7a4a71..dcb9f47d98 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -3795,6 +3795,10 @@ This section lists supported pattern items and the=
ir
> attributes, if any.
>=20
>  - ``conntrack``: match conntrack state.
>=20
> +- ``port_representor``: match traffic entering the embedded switch from
> +the given ethdev
> +
> +  - ``port_id {unsigned}``: ethdev port ID
> +
>  Actions list
>  ^^^^^^^^^^^^
>=20
> diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index
> 8cb7a069c8..5e9317c6d1 100644
> --- a/lib/ethdev/rte_flow.c
> +++ b/lib/ethdev/rte_flow.c
> @@ -100,6 +100,7 @@ static const struct rte_flow_desc_data
> rte_flow_desc_item[] =3D {
>  	MK_FLOW_ITEM(GENEVE_OPT, sizeof(struct
> rte_flow_item_geneve_opt)),
>  	MK_FLOW_ITEM(INTEGRITY, sizeof(struct rte_flow_item_integrity)),
>  	MK_FLOW_ITEM(CONNTRACK, sizeof(uint32_t)),
> +	MK_FLOW_ITEM(PORT_REPRESENTOR, 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
> 7b1ed7f110..3625fd2c12 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -574,6 +574,15 @@ enum rte_flow_item_type {
>  	 * @see struct rte_flow_item_conntrack.
>  	 */
>  	RTE_FLOW_ITEM_TYPE_CONNTRACK,
> +
> +	/**
> +	 * [META]
> +	 *
> +	 * Matches traffic entering the embedded switch from the given ethdev.
> +	 *
> +	 * @see struct rte_flow_item_ethdev
> +	 */
> +	RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR,
>  };
>=20
>  /**
> @@ -1799,6 +1808,24 @@ static const struct rte_flow_item_conntrack
> rte_flow_item_conntrack_mask =3D {  };  #endif
>=20
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this structure may change without prior notice
> + *
> + * Provides an ethdev port ID for use with the following items:
> + * RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR.
> + */
> +struct rte_flow_item_ethdev {
> +	uint16_t port_id; /**< ethdev port ID */ };
> +
> +/** Default mask for items based on struct rte_flow_item_ethdev */
> +#ifndef __cplusplus static const struct rte_flow_item_ethdev
> +rte_flow_item_ethdev_mask =3D {
> +	.port_id =3D 0xffff,
> +};
> +#endif
> +
>  /**
>   * Matching pattern item definition.
>   *
> --
> 2.20.1