From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60078.outbound.protection.outlook.com [40.107.6.78]) by dpdk.org (Postfix) with ESMTP id D291A1E2F for ; Mon, 29 Oct 2018 17:54:32 +0100 (CET) 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=WBfg/+xKSEHFjaQtfNt8PQBJGxXdt1kVaYuCSbjTre8=; b=olQIIpJIUY9vBFD2IyW9MzlkxnsvQPIJ5vzCb6o57z7zfNu72kToJfGVxMzH59kZSw0ofzzYM/Z7orsWXeulpm15hyr7MC1+SmoaLpALetoEnmum+eHCO/NSZVXJBcxxuPgXMnWgS6AnoB35S44hpjwfe5XZ9UYVQVv2SdKTUxU= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB4253.eurprd05.prod.outlook.com (52.133.12.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Mon, 29 Oct 2018 16:54:30 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::345d:803:9e2:679c]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::345d:803:9e2:679c%4]) with mapi id 15.20.1273.027; Mon, 29 Oct 2018 16:54:30 +0000 From: Dekel Peled To: Shahaf Shuler , Yongseok Koh CC: "dev@dpdk.org" , Ori Kam Thread-Topic: [dpdk-dev] [PATCH v6 6/6] net/mlx5: add raw data encap decap to Direct Verbs Thread-Index: AQHUb26gcWHQkXNEo0u/jNaDfRVuFaU2bvFg Date: Mon, 29 Oct 2018 16:54:30 +0000 Message-ID: References: <1539259967-10975-1-git-send-email-dekelp@mellanox.com> <1540498108-18358-7-git-send-email-dekelp@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB4253; 6:SnJ3ZFMti4dDoKMAZtG5oFdYpar4ZCFOeAX2OeH0j4ncbE8p4QBqa1SCw2HBU3/YGforvcew3hk7hY6YDOm9W4xSKkpnv7pVniQFRmwBkJbtPJHS9X9LNClN3pEFuOx2VR/UH4a51ZH5HBXtPrhzK1QUGS2MbOMj0LCMPx76A8ZLEli1/og+94HYEHnQiAQPrdNjONbRmjvw4sTjao+3cP9+OSBGMy9ITSQCOuajMdVlv+cEvyiLbhvsHF4Ke7Dt8S+7FQVX+jCmo4xMqCVUSgVklqPTSvJjBS/o6vUQAnIstvxrLxYZ/hdzJx1OSr/rSDgboPJClHf1ENenv12iRqQyyHiaS99ORIVRJ7uC7VkgNMEf1bt+dm+/NAujuyi1TuFD82KVVdvgBZqE4Dp4+yVSZwmtPRxnbjXmv3FO8Ui7kHkL3ncb+p/6ViUZAIMzUK4vYouwMU8lE+RaVXW85Q==; 5:hFknkoVmT6o9MT2eDs7moGONifV0qfixwjDWmIiRpP3xjtdP/PLQeKk4w0c4iygOU95PvBm6K7xzgHKpeYUjQ8hoaCu83EXpTjaZAfVOI6OJPg1SZbL+EAcB+ehu3uEN9MZn6dMRXMA6ok1uN/NYDxm5mjovbZR8vehm7o94AXM=; 7:3lFfPUroEtqt5QRv5FH0NbmLXRRok2Yg+x6/GLkuNdM4FpvJ31nO5Vgowsg0tc2EndXtuwu5iON87WtGwV0DD0GzUJ4GgqUseQL9P2kXsVpozGWd/bP/y3vwCOsKfD5F4AIFrzcapT9zyk3sJegETA== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: b3d373ce-dba9-47e0-2799-08d63dbf3212 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4253; x-ms-traffictypediagnostic: VI1PR05MB4253: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(17755550239193); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB4253; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4253; x-forefront-prvs: 084080FC15 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(136003)(396003)(376002)(366004)(199004)(189003)(13464003)(81156014)(74316002)(81166006)(5660300001)(25786009)(6506007)(7696005)(102836004)(107886003)(53546011)(256004)(14444005)(6636002)(76176011)(33656002)(2906002)(99286004)(4744004)(71200400001)(71190400001)(2900100001)(97736004)(105586002)(478600001)(106356001)(14454004)(5250100002)(86362001)(446003)(66066001)(6116002)(8936002)(6246003)(3846002)(7736002)(229853002)(305945005)(6436002)(53936002)(9686003)(316002)(110136005)(68736007)(54906003)(486006)(476003)(55016002)(186003)(11346002)(4326008)(575784001)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4253; H:VI1PR05MB4224.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-microsoft-antispam-message-info: fxYhdJ2t2g/1lPwr0+Y/ip2TBkwkzCO/OHCnTHQe+f/MD9js4HxMfE0w6KAYo3IGKw3hAZHL2JD6qJ6x6/z5nuKu/0AASSAlLgpo29GzTKUVB4BNhjojKM8XlPj7g4LKL3uTWNq6V0mwrOoB6KWnuK/cMgPqSKOcDaqzW+X3+4qHAThKcV31YfLe1CM3waE9ZQCgKylG610UcTsJB7Rq50bLcX6dHJ6RXnb79uwJOGn/jF/ZZSb/XOirwgxGpxADYT1Fjsnc2XACzQJnDecl/udZcjubEuoL7c5miTJblQfcavFQpOPt6YuuTEvCa/KtAO7wxwxBgh4IEWYxGodgE46X348IT/MxYfeeAbNPsNM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3d373ce-dba9-47e0-2799-08d63dbf3212 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2018 16:54:30.6591 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4253 Subject: Re: [dpdk-dev] [PATCH v6 6/6] net/mlx5: add raw data encap decap to Direct Verbs 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: Mon, 29 Oct 2018 16:54:33 -0000 Thanks, PSB. > -----Original Message----- > From: Shahaf Shuler > Sent: Monday, October 29, 2018 12:03 PM > To: Dekel Peled ; Yongseok Koh > > Cc: dev@dpdk.org; Ori Kam > Subject: RE: [dpdk-dev] [PATCH v6 6/6] net/mlx5: add raw data encap decap > to Direct Verbs >=20 > Thursday, October 25, 2018 11:08 PM, Dekel Peled: > > Subject: [dpdk-dev] [PATCH v6 6/6] net/mlx5: add raw data encap decap > > to Direct Verbs > > > > This patch implements the encap and decap actions, using raw data, in > > DV flow for MLX5 PMD. > > > > Signed-off-by: Dekel Peled > > --- > > drivers/net/mlx5/mlx5_flow.h | 12 ++- > > drivers/net/mlx5/mlx5_flow_dv.c | 227 > > ++++++++++++++++++++++++++++++++++++++-- > > 2 files changed, 224 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_flow.h > > b/drivers/net/mlx5/mlx5_flow.h index 2d73a05..92ba111 100644 > > --- a/drivers/net/mlx5/mlx5_flow.h > > +++ b/drivers/net/mlx5/mlx5_flow.h > > @@ -96,15 +96,19 @@ > > #define MLX5_FLOW_ACTION_VXLAN_DECAP (1u << 23) #define > > MLX5_FLOW_ACTION_NVGRE_ENCAP (1u << 24) #define > > MLX5_FLOW_ACTION_NVGRE_DECAP (1u << 25) > > +#define MLX5_FLOW_ACTION_RAW_ENCAP (1u << 26) #define > > +MLX5_FLOW_ACTION_RAW_DECAP (1u << 27) > > > > #define MLX5_FLOW_FATE_ACTIONS \ > > (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | > > MLX5_FLOW_ACTION_RSS) > > > > -#define MLX5_FLOW_ENCAP_ACTIONS \ > > - (MLX5_FLOW_ACTION_VXLAN_ENCAP | > > MLX5_FLOW_ACTION_NVGRE_ENCAP) > > +#define MLX5_FLOW_ENCAP_ACTIONS > > (MLX5_FLOW_ACTION_VXLAN_ENCAP | \ > > + MLX5_FLOW_ACTION_NVGRE_ENCAP | \ > > + MLX5_FLOW_ACTION_RAW_ENCAP) > > > > -#define MLX5_FLOW_DECAP_ACTIONS \ > > - (MLX5_FLOW_ACTION_VXLAN_DECAP | > > MLX5_FLOW_ACTION_NVGRE_DECAP) > > +#define MLX5_FLOW_DECAP_ACTIONS > > (MLX5_FLOW_ACTION_VXLAN_DECAP | \ > > + MLX5_FLOW_ACTION_NVGRE_DECAP | \ > > + MLX5_FLOW_ACTION_RAW_DECAP) > > > > #ifndef IPPROTO_MPLS > > #define IPPROTO_MPLS 137 > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > > b/drivers/net/mlx5/mlx5_flow_dv.c index d7d0c6b..ca75645 100644 > > --- a/drivers/net/mlx5/mlx5_flow_dv.c > > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > > @@ -186,6 +186,82 @@ > > } > > > > /** > > + * Validate the raw encap action. > > + * > > + * @param[in] action_flags > > + * Holds the actions detected until now. > > + * @param[in] action > > + * Pointer to the encap action. > > + * @param[in] attr > > + * Pointer to flow attributes > > + * @param[out] error > > + * Pointer to error structure. > > + * > > + * @return > > + * 0 on success, a negative errno value otherwise and rte_errno is s= et. > > + */ > > +static int > > +flow_dv_validate_action_raw_encap(uint64_t action_flags, > > + const struct rte_flow_action *action, > > + const struct rte_flow_attr *attr, > > + struct rte_flow_error *error) > > +{ > > + if (!(action->conf)) > > + return rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > action, > > + "configuration cannot be null"); > > + if (action_flags & MLX5_FLOW_ACTION_DROP) > > + return rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > NULL, > > + "can't drop and encap in same > > flow"); > > + if (action_flags & MLX5_FLOW_ENCAP_ACTIONS) > > + return rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > NULL, > > + "can only have a single encap" > > + " action in a flow"); > > + /* encap without preceding decap is not supported for ingress */ > > + if (attr->ingress && !(action_flags & > > MLX5_FLOW_ACTION_RAW_DECAP)) > > + return rte_flow_error_set(error, ENOTSUP, > > + > > RTE_FLOW_ERROR_TYPE_ATTR_INGRESS, > > + NULL, > > + "encap action not supported for " > > + "ingress"); >=20 > The error message doesn't seems informative enough. This is the case when flow rule is created with ingress attribute, and only= raw_encap action, without raw_decap. I used the same error message as in L2 encap case. >=20 > > + return 0; > > +} > > + > > +/** > > + * Validate the raw decap action. > > + * > > + * @param[in] action_flags > > + * Holds the actions detected until now. > > + * @param[out] error > > + * Pointer to error structure. > > + * > > + * @return > > + * 0 on success, a negative errno value otherwise and rte_errno is s= et. > > + */ > > +static int > > +flow_dv_validate_action_raw_decap(uint64_t action_flags, > > + struct rte_flow_error *error) > > +{ > > + if (action_flags & MLX5_FLOW_ACTION_DROP) > > + return rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > NULL, > > + "can't drop and decap in same > > flow"); > > + if (action_flags & MLX5_FLOW_ENCAP_ACTIONS) > > + return rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > NULL, > > + "can't have encap action before" > > + " decap action"); > > + if (action_flags & MLX5_FLOW_DECAP_ACTIONS) > > + return rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > NULL, > > + "can only have a single decap" > > + " action in a flow"); >=20 > Just like you don't allow to do only encap w/o decap on ingress, on egres= s we > cannot do only decap w/o a subsequent encap. This validation was implemented during action creation, to save the checkin= g of later actions. I will move it to here. >=20 > > + return 0; > > +} > > + > > +/** > > * Get the size of specific rte_flow_item_type > > * > > * @param[in] item_type > > @@ -396,6 +472,7 @@ > > /** > > * Convert L2 encap action to DV specification. > > * Used for VXLAN and NVGRE encap actions. > > + * Also used for raw encap action without preceding decap. > > * > > * @param[in] dev > > * Pointer to rte_eth_dev structure. > > @@ -414,23 +491,34 @@ > > { > > struct ibv_flow_action *verbs_action =3D NULL; > > const struct rte_flow_item *encap_data; > > + const struct rte_flow_action_raw_encap *raw_encap_data; >=20 > This one can be declared inside the if statement I prefer all variable declarations at start of function. >=20 > > struct priv *priv =3D dev->data->dev_private; > > uint8_t buf[MLX5_ENCAP_MAX_LEN]; > > + uint8_t *buf_ptr =3D buf; >=20 > Why you need this buf_ptr? Compilation issue with the fixed sized array o= f > buf? I needed it to refer to different buffers, raw buffer in raw_encap_data, or= buffer converted from encap_data. It will be removed now when moving to use cache. >=20 > > size_t size =3D 0; > > int convert_result =3D 0; > > > > - if (action->type =3D=3D RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP) > > - encap_data =3D ((const struct rte_flow_action_vxlan_encap *) > > + if (action->type =3D=3D RTE_FLOW_ACTION_TYPE_RAW_ENCAP) { > > + raw_encap_data =3D > > + (const struct rte_flow_action_raw_encap *)action- > > >conf; > > + buf_ptr =3D raw_encap_data->data; > > + size =3D raw_encap_data->size; > > + } else { > > + if (action->type =3D=3D > > RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP) > > + encap_data =3D > > + ((const struct rte_flow_action_vxlan_encap > > *) > > action->conf)->definition; > > - else > > - encap_data =3D ((const struct rte_flow_action_nvgre_encap *) > > + else > > + encap_data =3D > > + ((const struct rte_flow_action_nvgre_encap > > *) > > action->conf)->definition; > > - convert_result =3D flow_dv_convert_encap_data(encap_data, buf, > > - &size, error); > > - if (convert_result) > > - return NULL; > > + convert_result =3D flow_dv_convert_encap_data(encap_data, > > buf, > > + &size, error); > > + if (convert_result) > > + return NULL; > > + } > > verbs_action =3D mlx5_glue- > > >dv_create_flow_action_packet_reformat > > - (priv->ctx, size, (size ? buf : NULL), > > + (priv->ctx, size, (size ? buf_ptr : NULL), > > > > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL, > > MLX5DV_FLOW_TABLE_TYPE_NIC_TX); > > if (!verbs_action) > > @@ -472,6 +560,50 @@ > > } > > > > /** > > + * Convert raw decap/encap (L3 tunnel) action to DV specification. > > + * > > + * @param[in] dev > > + * Pointer to rte_eth_dev structure. > > + * @param[in] action > > + * Pointer to action structure. > > + * @param[in] attr > > + * Pointer to the flow attributes. > > + * @param[out] error > > + * Pointer to the error structure. > > + * > > + * @return > > + * Pointer to action on success, NULL otherwise and rte_errno is set= . > > + */ > > +static struct ibv_flow_action * > > +flow_dv_create_action_raw_encap(struct rte_eth_dev *dev, >=20 > I would call it flow_dv_create_action_packet_reformat, as this is the onl= y > case this function is being called. > For raw_encap only you will use the l2_encap function. I prefer this name, since L2 and L3 encap and decap use mlx5dv packet refor= mat function. >=20 > > + const struct rte_flow_action *action, > > + const struct rte_flow_attr *attr, > > + struct rte_flow_error *error) > > +{ > > + struct ibv_flow_action *verbs_action =3D NULL; > > + const struct rte_flow_action_raw_encap *encap_data; > > + struct priv *priv =3D dev->data->dev_private; > > + enum mlx5dv_flow_action_packet_reformat_type reformat_type; > > + enum mlx5dv_flow_table_type ft_type; > > + > > + encap_data =3D (const struct rte_flow_action_raw_encap *)action- > > >conf; > > + reformat_type =3D attr->egress ? > > + > > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TU > > NNEL : > > + > > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_T > > O_L2; > > + ft_type =3D attr->egress ? > > + MLX5DV_FLOW_TABLE_TYPE_NIC_TX : > > + MLX5DV_FLOW_TABLE_TYPE_NIC_RX; > > + verbs_action =3D mlx5_glue- > > >dv_create_flow_action_packet_reformat > > + (priv->ctx, encap_data->size, > > + (encap_data->size ? encap_data->data : > > NULL), > > + reformat_type, ft_type); > > + if (!verbs_action) > > + rte_flow_error_set(error, EINVAL, > > RTE_FLOW_ERROR_TYPE_ACTION, > > + NULL, "cannot create encap action"); > > + return verbs_action; > > +} > > + > > +/** > > * Verify the @p attributes will be correctly understood by the NIC an= d > store > > * them in the @p flow if everything is correct. > > * > > @@ -726,7 +858,6 @@ > > > > RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP ? > > > > MLX5_FLOW_ACTION_VXLAN_ENCAP : > > > > MLX5_FLOW_ACTION_NVGRE_ENCAP; > > - > > ++actions_n; > > break; > > case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: > > @@ -740,7 +871,23 @@ > > > > RTE_FLOW_ACTION_TYPE_VXLAN_DECAP ? > > > > MLX5_FLOW_ACTION_VXLAN_DECAP : > > > > MLX5_FLOW_ACTION_NVGRE_DECAP; > > - > > + ++actions_n; > > + break; > > + case RTE_FLOW_ACTION_TYPE_RAW_ENCAP: > > + ret =3D > > flow_dv_validate_action_raw_encap(action_flags, > > + actions, attr, > > + error); > > + if (ret < 0) > > + return ret; > > + action_flags |=3D MLX5_FLOW_ACTION_RAW_ENCAP; > > + ++actions_n; > > + break; > > + case RTE_FLOW_ACTION_TYPE_RAW_DECAP: > > + ret =3D > > flow_dv_validate_action_raw_decap(action_flags, > > + error); > > + if (ret < 0) > > + return ret; > > + action_flags |=3D MLX5_FLOW_ACTION_RAW_DECAP; > > ++actions_n; > > break; > > default: > > @@ -1550,6 +1697,64 @@ > > MLX5_FLOW_ACTION_NVGRE_DECAP; > > actions_n++; > > break; > > + case RTE_FLOW_ACTION_TYPE_RAW_ENCAP: > > + /* Handle encap action with preceding decap */ > > + if (flow->actions & MLX5_FLOW_ACTION_RAW_DECAP) { > > + dev_flow->dv.actions[actions_n].type =3D > > + > > MLX5DV_FLOW_ACTION_IBV_FLOW_ACTION; > > + dev_flow->dv.actions[actions_n].action =3D > > + flow_dv_create_action_raw_encap > > + (dev, action, > > + attr, error); > > + if (!(dev_flow->dv.actions[actions_n].action)) > > + return -rte_errno; > > + dev_flow->dv.verbs_action =3D > > + dev_flow->dv.actions[actions_n].action; > > + } else { > > + /* Handle encap action without preceding decap */ > > + dev_flow->dv.actions[actions_n].type =3D > > + > > MLX5DV_FLOW_ACTION_IBV_FLOW_ACTION; > > + dev_flow->dv.actions[actions_n].action =3D > > + flow_dv_create_action_l2_encap > > + (dev, action, error); > > + if (!(dev_flow->dv.actions[actions_n].action)) > > + return -rte_errno; > > + dev_flow->dv.verbs_action =3D > > + dev_flow->dv.actions[actions_n].action; > > + } > > + flow->actions |=3D MLX5_FLOW_ACTION_RAW_ENCAP; > > + actions_n++; > > + break; > > + case RTE_FLOW_ACTION_TYPE_RAW_DECAP: > > + /* Check if this decap action is followed by encap. */ > > + for (; action->type !=3D RTE_FLOW_ACTION_TYPE_END && > > + action->type !=3D RTE_FLOW_ACTION_TYPE_RAW_ENCAP; > > + action++) { > > + } > > + /* Handle decap action only if it isn't followed by encap */ > > + if (action->type !=3D RTE_FLOW_ACTION_TYPE_RAW_ENCAP) { > > + /* on egress, decap without following encap is error. > > */ > > + if (attr->egress) > > + return rte_flow_error_set > > + (error, ENOTSUP, > > + > > RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, > > + NULL, > > + "decap action not supported for " > > + "egress"); >=20 > This check should have been performed on the validate stage. I will move it. >=20 > > + dev_flow->dv.actions[actions_n].type =3D > > + > > MLX5DV_FLOW_ACTION_IBV_FLOW_ACTION; > > + dev_flow->dv.actions[actions_n].action =3D > > + flow_dv_create_action_l2_decap > > + (dev, action, error); > > + if (!(dev_flow->dv.actions[actions_n].action)) > > + return -rte_errno; > > + dev_flow->dv.verbs_action =3D > > + dev_flow->dv.actions[actions_n].action; > > + actions_n++; > > + } > > + /* If decap is followed by encap, handle it at encap case. */ > > + flow->actions |=3D MLX5_FLOW_ACTION_RAW_DECAP; > > + break; > > default: > > break; > > } > > -- > > 1.8.3.1