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 53446A04A4 for ; Wed, 2 Mar 2022 10:00:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48D8040141; Wed, 2 Mar 2022 10:00:14 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2061.outbound.protection.outlook.com [40.107.236.61]) by mails.dpdk.org (Postfix) with ESMTP id BE00940141; Wed, 2 Mar 2022 10:00:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVe8oMc4zbYNYHir4HFyJWIi2xqla9pDdLiZFXjOJ8xnG9kKibyHDTUxj8HvaWfrvpzqcPzbHbKER7jb0gzzPZzQQFwOOqnQBphGhgxeDZxorFEU6l+lHrVO1jHH3zYNujrhZ3plEAjrG7qiuvcM0mTtKuOxyG68Ot9R1jrWWUryx/D+1Sd6Ln7+yr3SSmaiiB2QPobZSAU+ZwBZKnq5TqAXgVh2dypTO14JK0SZ+B697NWF8bvvgAIhrEs2FThdV01iVDt49YmZ50UlxGvuZZQtoGcvsAmwNPiu/pL6TxRaQ0XWEsApOq45gRm/UTw1PHH8+3CCf45gHSTcayqovQ== 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=+pXEORNVc9vdPyp7mrnsabkAcWSz4JDwTZEEkbVMtDw=; b=hlToXqKXfyZid38fOixWJ1Nt2yDm0JHOg2oF/HMg2zA1QBtPBFvQfAsMpVuuqtFbi/C8dI3pgCGYTnv/ZbI4zIuFkSAmZ3pqbWyREWX4VqUn9xL9gHyBN2pJCGw5hx7iIsgJK0MHN0xXYEhBfdm7jssgUHoTip35VWhNCjyK5DAT0svJIoOjdYajBAi578XXVXwsMekYbZGW/IjcTScEwBq7stS4LGxymx3bZL2HCeLJAY0ZeTNob2jKG4g45K5sBHj4hVbn93KBQ4kWSRixAHOy4RkRGHf8TGGTmqMdlGqxovznwaMXW8VRtruWJIpRB0YECJnAySCCXOuxS1voug== 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=+pXEORNVc9vdPyp7mrnsabkAcWSz4JDwTZEEkbVMtDw=; b=qrK/rQ0VdCiDkmIW0KKQSXVCyvsn1pr5Lx77U6GKlxWgiVko9gB90AtmJO9lhYZ0qAzQ+c2tyxyK/4v2lhOCjD+RJFgeuPF01Q21OWPAzuwMQtYrdYFeBj0PWshe+iFo6KIIcdZzIleJN4/o5/FyEUcexDyAx3IgdqEUnmuTSRonP+IPUGR+SVR7o+77F1M2sIsv2e55AV2DeOzmvMBza3hgfbcAGDxUUEH/HaQq/YDTaSm4hRQD81LoE2/iQ8PvcRaXQIaLCHmey8u0QnOPZeudHNs2FzVLdgiqPQG4rjL5mSLi3aprCJEV87oovQQ0/uAkmdnnWegWRirQiRj3BA== Received: from MW2PR12MB4666.namprd12.prod.outlook.com (2603:10b6:302:13::22) by BN6PR12MB1121.namprd12.prod.outlook.com (2603:10b6:404:1c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 2 Mar 2022 09:00:11 +0000 Received: from MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::9da3:dc28:be54:cd4f]) by MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::9da3:dc28:be54:cd4f%4]) with mapi id 15.20.5038.014; Wed, 2 Mar 2022 09:00:11 +0000 From: Ori Kam To: "Jiawei(Jonny) Wang" , Slava Ovsiienko , Matan Azrad , Yongseok Koh CC: "dev@dpdk.org" , Raslan Darawsheh , "stable@dpdk.org" Subject: RE: [PATCH v3] net/mlx5: fix the NIC egress flow mismatch in switchdev mode Thread-Topic: [PATCH v3] net/mlx5: fix the NIC egress flow mismatch in switchdev mode Thread-Index: AQHX18LV8DHTtJhyZkSr57rP37p6KqyseB9A Date: Wed, 2 Mar 2022 09:00:11 +0000 Message-ID: References: <20211105084051.20159-1-jiaweiw@nvidia.com> <20211112124235.9191-1-jiaweiw@nvidia.com> In-Reply-To: <20211112124235.9191-1-jiaweiw@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aaa627f9-0b4a-44d7-59f9-08d9fc2b0ef5 x-ms-traffictypediagnostic: BN6PR12MB1121:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RiBUbpX9zBX+qrgZy+FOksM53jRC9H73h7QD2NcWDKssmGVOcOBxhKpxK8bN4KwSVuQ58U9tR9oOI0q9SUHlaw1dmtwNePQxtXJ6lRx24PV9krlP9umQ43jcU4DuufbJyJHvwqdq/iAmlc3DZ6mC0PVwzVhRY9q4M8v/B2nghWVuHqUlxtW193O+0pwicIiCNZWQN7hcpVhdkYmpJOZuS1Fnoq/j25ukanEkD5OMN7sW1D2cUm2j9M+9ZRZBHokwxYrF49bDBjNlDAIhA3EwfR0dFNWkEdvNbdnJLcDj5iHK3iDCuYARaVsOGPaJAHQTQrVO6SCH1IjHSzHbyeV9oAFYqPwpb0OegdOy5v9kyn/lL7pQkRphLyzlF0qwJzYdhVH7XEyezcTBweGXi1vf4gckPs9z7ShM4Yc7wFEJ5TqHfgq+XsVBZnrb/WUXxe8WluzAwJP79xQJFfpJztgdx3yizUI4vEXOohCvWck3aeyl/n7NytkUVjnOnQoYI1rP5cJ7AvfhDnUIZ6/R3enePSW5yXuqpFJFfoxj3moTOsC82RI4rlTt34T7zYkucHuKGlFUy3+sBiq0oNFfv9FcycgTt/17qhNJHmZK4nn3icyaDOug6gaqSgl/zQJ7adrHaysddonmLNm/aiiXGlA5EIhtguzJ90NxMtoyp1EiK1fbFuetlFATeYurd8XNDya03HozwjIcR/CRLIIA+7cvtw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB4666.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66446008)(64756008)(53546011)(66946007)(66556008)(8676002)(4326008)(83380400001)(508600001)(76116006)(5660300002)(54906003)(110136005)(52536014)(86362001)(316002)(450100002)(8936002)(6506007)(7696005)(71200400001)(66476007)(38100700002)(33656002)(38070700005)(186003)(26005)(122000001)(55016003)(9686003)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AXtdPHXUHQUe3+9hAyiBvM9vOMH5Mo0ETtTyQg+GjUT+aEJCnBvsjR3XwXe3?= =?us-ascii?Q?loVkEQ1eCZ7eKpnMnRfHVC7QLCdMLIT2SG4d5qDewq70oVMPjvI8RO7g8zzG?= =?us-ascii?Q?fNlhQJxutIeRtJs4AFILJAdoXoMVfEkyBtRJfbopRN3YZGDrl7P21U3C4nSy?= =?us-ascii?Q?Y0WdDh1B2yRiasoS9FGFPnYh5oEbgftCpVhWHARF9FBaI/u3gUG3xlG/QrTd?= =?us-ascii?Q?rvIAhOfLvg422H7wO8mVhHHS8uX+nBxBQpmklLKShBiTO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3ZbyhembVHEVY9JzU1gq2prdS0xJpRQessg5MbJ+Za?= =?us-ascii?Q?T+Qq8WdttLimEm2TSjAv93Bj0Q0mwvL/D1kQDtrFWkcFTfnIAFWcojOKSM4h?= =?us-ascii?Q?K3QKnrZZOc/Sauq1a31FPeDEne0gtpyhmag2fYRzcM/69hx2/SNqfHX0CBxy?= =?us-ascii?Q?AiIXt385FfOoHMwXN0assGQVbqmCJ+K2Tf6SXi9CThFHeILxS8DVgHA3RcQL?= =?us-ascii?Q?It8UCRscGsgRJYya3PKmAKpYg5dKhdpH5WvwuuacgcIHpVKwhE1wJ8+6Ca58?= =?us-ascii?Q?bTijIUJTpmJteSyj+9QVE/rvwngfvJf5EbaeoTohYtu4HdL8gUbpUnYkWULi?= =?us-ascii?Q?Ch85ChQ4BzH4ag8i9ZLrDN3MP2lAH4yBrH14XlXbNSggNviANvyp8pd+ik9Q?= =?us-ascii?Q?7GXC6YuryjqFkYW4K5E3h10kW+ln0mxPWFs7hrEsYVGNPV/xyo/Df8Qu4sf6?= =?us-ascii?Q?/Q=3D=3D?= 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: MW2PR12MB4666.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaa627f9-0b4a-44d7-59f9-08d9fc2b0ef5 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2022 09:00:11.2514 (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: BwwS3wEc6ZcbT0+AtWbr1oFQrvgp9up0CX6WsP+z2W2ek5XKJMQn9Msr6DfknsX9YVgyeA+6KAJ8pHQl0nU/kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1121 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi Jiawei, > -----Original Message----- > From: Jiawei(Jonny) Wang > Sent: Friday, November 12, 2021 2:43 PM > Subject: [PATCH v3] net/mlx5: fix the NIC egress flow mismatch in switchd= ev mode >=20 > When E-Switch mode was enabled, the NIC egress flows was implicitly > appended with source vport to match on. If the metadata register C0 > was used to maintain the source vport, it was initialized to zero > on packet steering engine entry, the flow could be hit only > if source vport was zero, the register C0 of the packet was not correct > to match in the TX side, this caused egress flow misses. >=20 > This patch: > - removes the implicit source vport match for NIC egress flow. > - rejects the NIC egress flows on the representor ports at validation. > - allows the internal NIC egress flows containing the TX_QUEUE items in > order to not impact hairpins. >=20 > Fixes: ce777b147bf8 ("net/mlx5: fix E-Switch flow without port item") > Cc: stable@dpdk.org >=20 > Signed-off-by: Jiawei Wang > Acked-by: Viacheslav Ovsiienko > --- > v3: update the tx_item checking > v2: fix one typo > --- > doc/guides/nics/mlx5.rst | 2 ++ > drivers/net/mlx5/mlx5_flow_dv.c | 24 ++++++++++++++++++++---- > 2 files changed, 22 insertions(+), 4 deletions(-) >=20 > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst > index 043d006a2b..267d25ebb8 100644 > --- a/doc/guides/nics/mlx5.rst > +++ b/doc/guides/nics/mlx5.rst > @@ -493,6 +493,8 @@ Limitations > completions, the scheduled send timestamps should not be specified > with non-zero msb >=20 > +- The NIC Egress flow on representor port is not supported. > + > Statistics > ---------- >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow= _dv.c > index 28911d6f0f..201f04ca84 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -7164,8 +7164,10 @@ flow_dv_validate(struct rte_eth_dev *dev, const st= ruct rte_flow_attr > *attr, > return ret; > last_item =3D MLX5_FLOW_ITEM_TAG; > break; > - case MLX5_RTE_FLOW_ITEM_TYPE_TAG: > case MLX5_RTE_FLOW_ITEM_TYPE_TX_QUEUE: > + last_item =3D MLX5_FLOW_ITEM_TX_QUEUE; > + break; > + case MLX5_RTE_FLOW_ITEM_TYPE_TAG: > break; > case RTE_FLOW_ITEM_TYPE_GTP: > ret =3D flow_dv_validate_item_gtp(dev, items, item_flags, > @@ -7999,6 +8001,18 @@ flow_dv_validate(struct rte_eth_dev *dev, const st= ruct rte_flow_attr > *attr, > return rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, NULL, > "sample before modify action is not supported"); > + /* > + * Validation the NIC Egress flow on representor, except implicit > + * hairpin default egress flow with TX_QUEUE item, other flows not > + * work due to metadata regC0 mismatch. > + */ > + if ((!attr->transfer && attr->egress) && priv->representor && > + !(item_flags & MLX5_FLOW_ITEM_TX_QUEUE)) > + return rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + NULL, > + "NIC egress rules on representors" > + " is not supported"); > return 0; > } >=20 > @@ -13563,11 +13577,13 @@ flow_dv_translate(struct rte_eth_dev *dev, > /* > * When E-Switch mode is enabled, we have two cases where we need to > * set the source port manually. > - * The first one, is in case of Nic steering rule, and the second is > - * E-Switch rule where no port_id item was found. In both cases > - * the source port is set according the current port in use. > + * The first one, is in case of NIC ingress steering rule, and the > + * second is E-Switch rule where no port_id item was found. > + * In both cases the source port is set according the current port > + * in use. > */ > if (!(item_flags & MLX5_FLOW_ITEM_PORT_ID) && > + !(attr->egress && !attr->transfer) && > (priv->representor || priv->master)) { > if (flow_dv_translate_item_port_id(dev, match_mask, > match_value, NULL, attr)) > -- > 2.18.1 Acked-by: Ori Kam Best, Ori