From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130051.outbound.protection.outlook.com [40.107.13.51]) by dpdk.org (Postfix) with ESMTP id 5C5A61B9CE for ; Thu, 18 Apr 2019 14:21:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QEaVkrIE5pnM2qkPVwm5bI5KkgVzdeE8ECgYQqsbMdU=; b=yVH4A+xCdzXHsJffyxQfLQZPolZVPr4+VWd2RfiGBa3x6MUHF8QeQcA6JdlWRqN4uwkWN2VZGjyiHgI9m/XK9zxy2Q1gG2Nk5tigoPEVc1i3WAj2T32ZR/NidVSygHd7HxqnJgeIAQHFUFLhyCnmtLR0rBcUkgVQoVLZGT4+dhA= Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com (52.133.40.151) by AM0PR0502MB3764.eurprd05.prod.outlook.com (52.133.47.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.19; Thu, 18 Apr 2019 12:21:14 +0000 Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::7da6:9e13:922a:9d88]) by AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::7da6:9e13:922a:9d88%5]) with mapi id 15.20.1813.013; Thu, 18 Apr 2019 12:21:14 +0000 From: Yongseok Koh To: Ori Kam CC: Shahaf Shuler , Matan Azrad , Slava Ovsiienko , Moti Haimovsky , "dev@dpdk.org" Thread-Topic: [PATCH v2 8/9] net/mlx5: add Forward Database table type Thread-Index: AQHU9doNIDrA0IrY10iW1uPnQLIzqKZB1rGA Date: Thu, 18 Apr 2019 12:21:14 +0000 Message-ID: <20190418122106.GN31179@mtidpdk.mti.labs.mlnx> References: <1555276357-4892-1-git-send-email-orika@mellanox.com> <1555586930-109097-1-git-send-email-orika@mellanox.com> <1555586930-109097-9-git-send-email-orika@mellanox.com> In-Reply-To: <1555586930-109097-9-git-send-email-orika@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0031.namprd03.prod.outlook.com (2603:10b6:a02:a8::44) To AM0PR0502MB3971.eurprd05.prod.outlook.com (2603:10a6:208:11::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: caa910a5-2389-4ab6-4e5e-08d6c3f859b5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR0502MB3764; x-ms-traffictypediagnostic: AM0PR0502MB3764: x-microsoft-antispam-prvs: x-forefront-prvs: 0011612A55 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(396003)(376002)(366004)(346002)(199004)(189003)(26005)(102836004)(66066001)(6506007)(386003)(86362001)(2906002)(76176011)(52116002)(6636002)(186003)(99286004)(97736004)(229853002)(8936002)(3846002)(6116002)(33656002)(71200400001)(71190400001)(7736002)(68736007)(6436002)(81156014)(81166006)(8676002)(305945005)(316002)(6486002)(54906003)(1076003)(478600001)(6862004)(9686003)(4326008)(6512007)(256004)(6246003)(14454004)(53936002)(5660300002)(476003)(446003)(11346002)(486006)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3764; H:AM0PR0502MB3971.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Sw5/rbEf69kSMJMEdZ5AAdCE2dF8SpwUJuo6nuEFPaAcUUm6I16DIxZ7cHdlNk77Bg61xToIpUhKt1vFW+RwuBfEtaGGnF6zOcse3syVpmJLa2gfWRceJs1+3rm9Dn6LkPRQd54nACdAPmJB+wyRSvDlJaLy+bXi+KBIBs8M/3BCLo+He5JT93FlkRRk+WaPQPiRGDNhNumR2RLVPCHS3iJqTf8uPG43M9ZnzdNFiTANWQQcPwtTIDZepE8z6/pyaCWWoiVUc4mNcIKQsBiFoSDx4FTuDR2HdYapz+pFbrpQ7SR6CXeiN0QDqOxBe193B0y7R1wPKWK40Ze64fqH6avGgKva+S56cASuT1Ii/NyMhjQBwQhacEAVglkOahzftRomEfvRD6I4Kz9AeXbrEB8p8zz9LWKRHrxdr4j00Qs= Content-Type: text/plain; charset="us-ascii" Content-ID: <965E3E7A5D60BF4CAA2041315063FB9F@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: caa910a5-2389-4ab6-4e5e-08d6c3f859b5 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2019 12:21:14.7846 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3764 Subject: Re: [dpdk-dev] [PATCH v2 8/9] net/mlx5: add Forward Database table type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2019 12:21:16 -0000 On Thu, Apr 18, 2019 at 11:28:49AM +0000, Ori Kam wrote: > Actions like encap/decap, modify header require setting the flow table > type. Until now we supported only Nic RX and Nic TX, this commits adds > the support for FDB table type for those actions. >=20 > Signed-off-by: Ori Kam > --- Acked-by: Yongseok Koh > v2: > * Address ML comments. > --- > drivers/net/mlx5/mlx5_flow_dv.c | 56 +++++++++++++++++++++++++++++------= ------ > 1 file changed, 40 insertions(+), 16 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow= _dv.c > index 9c5826c..5997182 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -40,6 +40,10 @@ > #define MLX5DV_FLOW_ACTION_COUNTERS_DEVX 0 > #endif > =20 > +#ifndef HAVE_MLX5DV_DR_ESWITCH > +#define MLX5DV_FLOW_TABLE_TYPE_FDB 0 > +#endif > + > union flow_dv_attr { > struct { > uint32_t valid:1; > @@ -939,7 +943,9 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5dv_dr_ns *ns; > =20 > resource->flags =3D flow->group ? 0 : 1; > - if (flow->ingress) > + if (resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_FDB) > + ns =3D sh->fdb_ns; > + else if (resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_NIC_RX) > ns =3D sh->rx_ns; > else > ns =3D sh->tx_ns; > @@ -1360,6 +1366,8 @@ struct field_modify_info modify_tcp[] =3D { > * Pointer to action structure. > * @param[in, out] dev_flow > * Pointer to the mlx5_flow. > + * @param[in] transfer > + * Mark if the flow is E-Switch flow. > * @param[out] error > * Pointer to the error structure. > * > @@ -1370,6 +1378,7 @@ struct field_modify_info modify_tcp[] =3D { > flow_dv_create_action_l2_encap(struct rte_eth_dev *dev, > const struct rte_flow_action *action, > struct mlx5_flow *dev_flow, > + uint8_t transfer, > struct rte_flow_error *error) > { > const struct rte_flow_item *encap_data; > @@ -1377,7 +1386,8 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5_flow_dv_encap_decap_resource res =3D { > .reformat_type =3D > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL, > - .ft_type =3D MLX5DV_FLOW_TABLE_TYPE_NIC_TX, > + .ft_type =3D transfer ? MLX5DV_FLOW_TABLE_TYPE_FDB : > + MLX5DV_FLOW_TABLE_TYPE_NIC_TX, > }; > =20 > if (action->type =3D=3D RTE_FLOW_ACTION_TYPE_RAW_ENCAP) { > @@ -1412,6 +1422,8 @@ struct field_modify_info modify_tcp[] =3D { > * Pointer to rte_eth_dev structure. > * @param[in, out] dev_flow > * Pointer to the mlx5_flow. > + * @param[in] transfer > + * Mark if the flow is E-Switch flow. > * @param[out] error > * Pointer to the error structure. > * > @@ -1421,13 +1433,15 @@ struct field_modify_info modify_tcp[] =3D { > static int > flow_dv_create_action_l2_decap(struct rte_eth_dev *dev, > struct mlx5_flow *dev_flow, > + uint8_t transfer, > struct rte_flow_error *error) > { > struct mlx5_flow_dv_encap_decap_resource res =3D { > .size =3D 0, > .reformat_type =3D > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2, > - .ft_type =3D MLX5DV_FLOW_TABLE_TYPE_NIC_RX, > + .ft_type =3D transfer ? MLX5DV_FLOW_TABLE_TYPE_FDB : > + MLX5DV_FLOW_TABLE_TYPE_NIC_RX, > }; > =20 > if (flow_dv_encap_decap_resource_register(dev, &res, dev_flow, error)) > @@ -1470,8 +1484,11 @@ struct field_modify_info modify_tcp[] =3D { > res.reformat_type =3D attr->egress ? > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL : > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2; > - res.ft_type =3D attr->egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX : > - MLX5DV_FLOW_TABLE_TYPE_NIC_RX; > + if (attr->transfer) > + res.ft_type =3D MLX5DV_FLOW_TABLE_TYPE_FDB; > + else > + res.ft_type =3D attr->egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX : > + MLX5DV_FLOW_TABLE_TYPE_NIC_RX; > if (flow_dv_encap_decap_resource_register(dev, &res, dev_flow, error)) > return rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, > @@ -1806,11 +1823,14 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5_priv *priv =3D dev->data->dev_private; > struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_modify_hdr_resource *cache_resource; > + struct mlx5dv_dr_ns *ns; > =20 > - struct mlx5dv_dr_ns *ns =3D > - resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_NIC_TX ? > - sh->tx_ns : sh->rx_ns; > - > + if (resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_FDB) > + ns =3D sh->fdb_ns; > + else if (resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_NIC_TX) > + ns =3D sh->tx_ns; > + else > + ns =3D sh->rx_ns; > /* Lookup a matching resource from cache. */ > LIST_FOREACH(cache_resource, &sh->modify_cmds, next) { > if (resource->ft_type =3D=3D cache_resource->ft_type && > @@ -3604,6 +3624,8 @@ struct field_modify_info modify_tcp[] =3D { > union flow_dv_attr flow_attr =3D { .attr =3D 0 }; > struct mlx5_flow_dv_tag_resource tag_resource; > =20 > + if (attr->transfer) > + res.ft_type =3D MLX5DV_FLOW_TABLE_TYPE_FDB; > if (priority =3D=3D MLX5_FLOW_PRIO_RSVD) > priority =3D priv->config.flow_prio - 1; > for (; !actions_end ; actions++) { > @@ -3709,7 +3731,9 @@ struct field_modify_info modify_tcp[] =3D { > case RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP: > case RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP: > if (flow_dv_create_action_l2_encap(dev, actions, > - dev_flow, error)) > + dev_flow, > + attr->transfer, > + error)) > return -rte_errno; > dev_flow->dv.actions[actions_n++] =3D > dev_flow->dv.encap_decap->verbs_action; > @@ -3721,6 +3745,7 @@ struct field_modify_info modify_tcp[] =3D { > case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: > case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP: > if (flow_dv_create_action_l2_decap(dev, dev_flow, > + attr->transfer, > error)) > return -rte_errno; > dev_flow->dv.actions[actions_n++] =3D > @@ -3740,9 +3765,9 @@ struct field_modify_info modify_tcp[] =3D { > dev_flow->dv.encap_decap->verbs_action; > } else { > /* Handle encap without preceding decap. */ > - if (flow_dv_create_action_l2_encap(dev, actions, > - dev_flow, > - error)) > + if (flow_dv_create_action_l2_encap > + (dev, actions, dev_flow, attr->transfer, > + error)) > return -rte_errno; > dev_flow->dv.actions[actions_n++] =3D > dev_flow->dv.encap_decap->verbs_action; > @@ -3757,9 +3782,8 @@ struct field_modify_info modify_tcp[] =3D { > } > /* Handle decap only if it isn't followed by encap. */ > if (action->type !=3D RTE_FLOW_ACTION_TYPE_RAW_ENCAP) { > - if (flow_dv_create_action_l2_decap(dev, > - dev_flow, > - error)) > + if (flow_dv_create_action_l2_decap > + (dev, dev_flow, attr->transfer, error)) > return -rte_errno; > dev_flow->dv.actions[actions_n++] =3D > dev_flow->dv.encap_decap->verbs_action; > --=20 > 1.8.3.1 >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 297B6A00E6 for ; Thu, 18 Apr 2019 14:21:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F2D491B9EE; Thu, 18 Apr 2019 14:21:20 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130051.outbound.protection.outlook.com [40.107.13.51]) by dpdk.org (Postfix) with ESMTP id 5C5A61B9CE for ; Thu, 18 Apr 2019 14:21:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QEaVkrIE5pnM2qkPVwm5bI5KkgVzdeE8ECgYQqsbMdU=; b=yVH4A+xCdzXHsJffyxQfLQZPolZVPr4+VWd2RfiGBa3x6MUHF8QeQcA6JdlWRqN4uwkWN2VZGjyiHgI9m/XK9zxy2Q1gG2Nk5tigoPEVc1i3WAj2T32ZR/NidVSygHd7HxqnJgeIAQHFUFLhyCnmtLR0rBcUkgVQoVLZGT4+dhA= Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com (52.133.40.151) by AM0PR0502MB3764.eurprd05.prod.outlook.com (52.133.47.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.19; Thu, 18 Apr 2019 12:21:14 +0000 Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::7da6:9e13:922a:9d88]) by AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::7da6:9e13:922a:9d88%5]) with mapi id 15.20.1813.013; Thu, 18 Apr 2019 12:21:14 +0000 From: Yongseok Koh To: Ori Kam CC: Shahaf Shuler , Matan Azrad , Slava Ovsiienko , Moti Haimovsky , "dev@dpdk.org" Thread-Topic: [PATCH v2 8/9] net/mlx5: add Forward Database table type Thread-Index: AQHU9doNIDrA0IrY10iW1uPnQLIzqKZB1rGA Date: Thu, 18 Apr 2019 12:21:14 +0000 Message-ID: <20190418122106.GN31179@mtidpdk.mti.labs.mlnx> References: <1555276357-4892-1-git-send-email-orika@mellanox.com> <1555586930-109097-1-git-send-email-orika@mellanox.com> <1555586930-109097-9-git-send-email-orika@mellanox.com> In-Reply-To: <1555586930-109097-9-git-send-email-orika@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0031.namprd03.prod.outlook.com (2603:10b6:a02:a8::44) To AM0PR0502MB3971.eurprd05.prod.outlook.com (2603:10a6:208:11::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: caa910a5-2389-4ab6-4e5e-08d6c3f859b5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR0502MB3764; x-ms-traffictypediagnostic: AM0PR0502MB3764: x-microsoft-antispam-prvs: x-forefront-prvs: 0011612A55 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(396003)(376002)(366004)(346002)(199004)(189003)(26005)(102836004)(66066001)(6506007)(386003)(86362001)(2906002)(76176011)(52116002)(6636002)(186003)(99286004)(97736004)(229853002)(8936002)(3846002)(6116002)(33656002)(71200400001)(71190400001)(7736002)(68736007)(6436002)(81156014)(81166006)(8676002)(305945005)(316002)(6486002)(54906003)(1076003)(478600001)(6862004)(9686003)(4326008)(6512007)(256004)(6246003)(14454004)(53936002)(5660300002)(476003)(446003)(11346002)(486006)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3764; H:AM0PR0502MB3971.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Sw5/rbEf69kSMJMEdZ5AAdCE2dF8SpwUJuo6nuEFPaAcUUm6I16DIxZ7cHdlNk77Bg61xToIpUhKt1vFW+RwuBfEtaGGnF6zOcse3syVpmJLa2gfWRceJs1+3rm9Dn6LkPRQd54nACdAPmJB+wyRSvDlJaLy+bXi+KBIBs8M/3BCLo+He5JT93FlkRRk+WaPQPiRGDNhNumR2RLVPCHS3iJqTf8uPG43M9ZnzdNFiTANWQQcPwtTIDZepE8z6/pyaCWWoiVUc4mNcIKQsBiFoSDx4FTuDR2HdYapz+pFbrpQ7SR6CXeiN0QDqOxBe193B0y7R1wPKWK40Ze64fqH6avGgKva+S56cASuT1Ii/NyMhjQBwQhacEAVglkOahzftRomEfvRD6I4Kz9AeXbrEB8p8zz9LWKRHrxdr4j00Qs= Content-Type: text/plain; charset="UTF-8" Content-ID: <965E3E7A5D60BF4CAA2041315063FB9F@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: caa910a5-2389-4ab6-4e5e-08d6c3f859b5 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2019 12:21:14.7846 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3764 Subject: Re: [dpdk-dev] [PATCH v2 8/9] net/mlx5: add Forward Database table type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Message-ID: <20190418122114.iVlXXDzC4qOiAbk17Fu6APVy6wP8HbBRPN5U0Va6jjc@z> On Thu, Apr 18, 2019 at 11:28:49AM +0000, Ori Kam wrote: > Actions like encap/decap, modify header require setting the flow table > type. Until now we supported only Nic RX and Nic TX, this commits adds > the support for FDB table type for those actions. >=20 > Signed-off-by: Ori Kam > --- Acked-by: Yongseok Koh > v2: > * Address ML comments. > --- > drivers/net/mlx5/mlx5_flow_dv.c | 56 +++++++++++++++++++++++++++++------= ------ > 1 file changed, 40 insertions(+), 16 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow= _dv.c > index 9c5826c..5997182 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -40,6 +40,10 @@ > #define MLX5DV_FLOW_ACTION_COUNTERS_DEVX 0 > #endif > =20 > +#ifndef HAVE_MLX5DV_DR_ESWITCH > +#define MLX5DV_FLOW_TABLE_TYPE_FDB 0 > +#endif > + > union flow_dv_attr { > struct { > uint32_t valid:1; > @@ -939,7 +943,9 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5dv_dr_ns *ns; > =20 > resource->flags =3D flow->group ? 0 : 1; > - if (flow->ingress) > + if (resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_FDB) > + ns =3D sh->fdb_ns; > + else if (resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_NIC_RX) > ns =3D sh->rx_ns; > else > ns =3D sh->tx_ns; > @@ -1360,6 +1366,8 @@ struct field_modify_info modify_tcp[] =3D { > * Pointer to action structure. > * @param[in, out] dev_flow > * Pointer to the mlx5_flow. > + * @param[in] transfer > + * Mark if the flow is E-Switch flow. > * @param[out] error > * Pointer to the error structure. > * > @@ -1370,6 +1378,7 @@ struct field_modify_info modify_tcp[] =3D { > flow_dv_create_action_l2_encap(struct rte_eth_dev *dev, > const struct rte_flow_action *action, > struct mlx5_flow *dev_flow, > + uint8_t transfer, > struct rte_flow_error *error) > { > const struct rte_flow_item *encap_data; > @@ -1377,7 +1386,8 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5_flow_dv_encap_decap_resource res =3D { > .reformat_type =3D > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL, > - .ft_type =3D MLX5DV_FLOW_TABLE_TYPE_NIC_TX, > + .ft_type =3D transfer ? MLX5DV_FLOW_TABLE_TYPE_FDB : > + MLX5DV_FLOW_TABLE_TYPE_NIC_TX, > }; > =20 > if (action->type =3D=3D RTE_FLOW_ACTION_TYPE_RAW_ENCAP) { > @@ -1412,6 +1422,8 @@ struct field_modify_info modify_tcp[] =3D { > * Pointer to rte_eth_dev structure. > * @param[in, out] dev_flow > * Pointer to the mlx5_flow. > + * @param[in] transfer > + * Mark if the flow is E-Switch flow. > * @param[out] error > * Pointer to the error structure. > * > @@ -1421,13 +1433,15 @@ struct field_modify_info modify_tcp[] =3D { > static int > flow_dv_create_action_l2_decap(struct rte_eth_dev *dev, > struct mlx5_flow *dev_flow, > + uint8_t transfer, > struct rte_flow_error *error) > { > struct mlx5_flow_dv_encap_decap_resource res =3D { > .size =3D 0, > .reformat_type =3D > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2, > - .ft_type =3D MLX5DV_FLOW_TABLE_TYPE_NIC_RX, > + .ft_type =3D transfer ? MLX5DV_FLOW_TABLE_TYPE_FDB : > + MLX5DV_FLOW_TABLE_TYPE_NIC_RX, > }; > =20 > if (flow_dv_encap_decap_resource_register(dev, &res, dev_flow, error)) > @@ -1470,8 +1484,11 @@ struct field_modify_info modify_tcp[] =3D { > res.reformat_type =3D attr->egress ? > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL : > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2; > - res.ft_type =3D attr->egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX : > - MLX5DV_FLOW_TABLE_TYPE_NIC_RX; > + if (attr->transfer) > + res.ft_type =3D MLX5DV_FLOW_TABLE_TYPE_FDB; > + else > + res.ft_type =3D attr->egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX : > + MLX5DV_FLOW_TABLE_TYPE_NIC_RX; > if (flow_dv_encap_decap_resource_register(dev, &res, dev_flow, error)) > return rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, > @@ -1806,11 +1823,14 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5_priv *priv =3D dev->data->dev_private; > struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_modify_hdr_resource *cache_resource; > + struct mlx5dv_dr_ns *ns; > =20 > - struct mlx5dv_dr_ns *ns =3D > - resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_NIC_TX ? > - sh->tx_ns : sh->rx_ns; > - > + if (resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_FDB) > + ns =3D sh->fdb_ns; > + else if (resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_NIC_TX) > + ns =3D sh->tx_ns; > + else > + ns =3D sh->rx_ns; > /* Lookup a matching resource from cache. */ > LIST_FOREACH(cache_resource, &sh->modify_cmds, next) { > if (resource->ft_type =3D=3D cache_resource->ft_type && > @@ -3604,6 +3624,8 @@ struct field_modify_info modify_tcp[] =3D { > union flow_dv_attr flow_attr =3D { .attr =3D 0 }; > struct mlx5_flow_dv_tag_resource tag_resource; > =20 > + if (attr->transfer) > + res.ft_type =3D MLX5DV_FLOW_TABLE_TYPE_FDB; > if (priority =3D=3D MLX5_FLOW_PRIO_RSVD) > priority =3D priv->config.flow_prio - 1; > for (; !actions_end ; actions++) { > @@ -3709,7 +3731,9 @@ struct field_modify_info modify_tcp[] =3D { > case RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP: > case RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP: > if (flow_dv_create_action_l2_encap(dev, actions, > - dev_flow, error)) > + dev_flow, > + attr->transfer, > + error)) > return -rte_errno; > dev_flow->dv.actions[actions_n++] =3D > dev_flow->dv.encap_decap->verbs_action; > @@ -3721,6 +3745,7 @@ struct field_modify_info modify_tcp[] =3D { > case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: > case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP: > if (flow_dv_create_action_l2_decap(dev, dev_flow, > + attr->transfer, > error)) > return -rte_errno; > dev_flow->dv.actions[actions_n++] =3D > @@ -3740,9 +3765,9 @@ struct field_modify_info modify_tcp[] =3D { > dev_flow->dv.encap_decap->verbs_action; > } else { > /* Handle encap without preceding decap. */ > - if (flow_dv_create_action_l2_encap(dev, actions, > - dev_flow, > - error)) > + if (flow_dv_create_action_l2_encap > + (dev, actions, dev_flow, attr->transfer, > + error)) > return -rte_errno; > dev_flow->dv.actions[actions_n++] =3D > dev_flow->dv.encap_decap->verbs_action; > @@ -3757,9 +3782,8 @@ struct field_modify_info modify_tcp[] =3D { > } > /* Handle decap only if it isn't followed by encap. */ > if (action->type !=3D RTE_FLOW_ACTION_TYPE_RAW_ENCAP) { > - if (flow_dv_create_action_l2_decap(dev, > - dev_flow, > - error)) > + if (flow_dv_create_action_l2_decap > + (dev, dev_flow, attr->transfer, error)) > return -rte_errno; > dev_flow->dv.actions[actions_n++] =3D > dev_flow->dv.encap_decap->verbs_action; > --=20 > 1.8.3.1 >=20