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 67573A04FD; Mon, 30 May 2022 13:00:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E08042B9F; Mon, 30 May 2022 13:00:57 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2064.outbound.protection.outlook.com [40.107.92.64]) by mails.dpdk.org (Postfix) with ESMTP id CDD9F42B9C for ; Mon, 30 May 2022 13:00:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XpgTYlTpSM0DCEbRxBJ33BsPeNgcJFfuGVnHks6E+wlJE4FJz31v0dN6qYH/JoMfwPUqxn241PcDJwVuzEexrEgPC+Y7JNuAdoplkZTxgOPT8DqWzIy/3+RSxg6qouecuAJ99vjGMAmgftZmsLP5SI2MHaUsx/riSopWnIl9olEPiHK1YccIr28/FJ4mpXTRPS5R6OWeM3DEYn0RWhLs4amUu1K6eMaMjK4ykR9/phn2UbAyBjomuBtw/VK9dJo9rQ5S5HP5rQWGcrDA4sLxkBZK/93+4vKvqwtuUZH2yuP6RG23uPN9k6goSwVotRA+jPOyg7NvVnxuoS/XEy9B4w== 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=JvejV4nVgWcbgWdTwxTcD3Mr4zse7Xw6YthStEGnpQ0=; b=lAfLmoKAZ0SI5zGRpffrw+YdVK2M+lWBFG7MiMPoZ796gwRHPTcAR/W0wrnwzymA+iEiDNmzy4R/qY1qko2YBtthefNoRbfuLnLssmJxQvvx7WeQK1qcln3WVtyS2O+IEjqTUj4n1LD/mLn4L5lG+Ct9vml45xe2uyyil8PFf93yaeOd0hDyuFCX4f/yAd7vmz+9kqFskRcAzyjGqLEH1mtzQeDQMoMUG0Wn0NjdFPerM5EpJJ8XmlqYyCWUVbReBPw2D+w6e1lEliR7xTKbqeY4L13FiXG/JF6aXlGnmARJtmv+87lO8SEpc0yYAwMtMXRqnvgD279HcZmB8MlYbg== 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=JvejV4nVgWcbgWdTwxTcD3Mr4zse7Xw6YthStEGnpQ0=; b=fyftcKHcFuZApq8WvKJgmd0eXKvCIww6UsMOja36XT48cKkztgC1T6LlpswJhdyNzZ94EcjUOzedI06RgX7vlvJYQc3jQJ9luf2ewiXMVIAUbQfW2H577AT5eWRO7Tf3NGF/Oec+jJA19fsLx7oQvI0yAVgQj9zFiIynsMwt1jee3y2IpVfvPf8c0dcwu8X6a1wVwV4113OM0taBMoWLgcPALIYdXwOJ4rvPOpGcqjtkATi9lmMVbgVvi4CV6if/5VMMyGqsMtkuBGrMHz9yNh5sx//Xettiajvfh2Y1xl0T6/ZOrRTsFn6R/6tD9P9jqwCSqA5bg50gaERDC5hCPQ== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by MWHPR12MB1136.namprd12.prod.outlook.com (2603:10b6:300:f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Mon, 30 May 2022 11:00:54 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::4861:58fd:b38:2f09]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::4861:58fd:b38:2f09%3]) with mapi id 15.20.5293.019; Mon, 30 May 2022 11:00:54 +0000 From: Slava Ovsiienko To: "wenxu@ucloud.cn" , Gregory Etelson , Raslan Darawsheh CC: "dev@dpdk.org" Subject: RE: [dpdk-dev] [PATCH] net/mlx5: fix empty err msg in mlx5_flow_tunnel_validate Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix empty err msg in mlx5_flow_tunnel_validate Thread-Index: AQHXjOGebCAywPSBXkmINwqEW9GuQq05Dr+w Date: Mon, 30 May 2022 11:00:54 +0000 Message-ID: References: <1628487855-14030-1-git-send-email-wenxu@ucloud.cn> In-Reply-To: <1628487855-14030-1-git-send-email-wenxu@ucloud.cn> 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: c5985563-2fde-44ed-3a10-08da422baab8 x-ms-traffictypediagnostic: MWHPR12MB1136: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: 0RQMPYJT9ddkpBdpJbvlhf8UHj6b7ch9rYJyJbzEfpUCbNDGXAjwWBo2aUUjQG7k4gvW+TRmOh/OcxKZX2IlGF/D22iioDaXEJ6lnwLTReQpVj7lJjNPYbTGUbufuwwa2GNrfF4qibMrYUdcKrxb7RtF6HefWKlrtXr9BqzSZM6HytXXR2UzJ2hyan1rf9ZMRvC1GTY9oWJrymP6TrNtcrMuYjYIAd27Tv6ElBZW3kulr1ZMfxdLEcUKAnq9IsuTLdHKmlwE62MUBeMvjZ1pcEH1ECrTn3T2xxp+H9D6LtdLrF6ObXq7jNocJ0ALhzf12Xeegg0tpKdVV814JXsrNn0g9W4VHGu1zZYhNQ9VdC6OvJsLCNIR8FwtE3tlxW0l1uAAkTTfUFGh36txWWRThprDX888kFexwWpc/0hNFFrCsr67OrXVCkHaLsG8D8XZDCs+A6FfvaD7TaWPZ4uHgOOZ3KfkHQAG40YZkNgZmCpfXd/JCCtztvzCTSsWOm5qiGk/sE0WNZW6H42cWic7FYYCozduCWTot/aJnoDehPybtkBRhITkW5Ds+PnuyAE97acNlxmBIC+TGUZ1QEZKAg0DK6KsGUlKkbGF8ZQ5jLQf81angjOaPsf5fNH1UElaN4qHbqGcNekene+S/ugiVa9ddaPrUZtlEI1RAfb+GKpbeYb90IXjq1/XIl7Q7oOCswJZlccablLgBMnGhZpuLA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3753.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(55016003)(66946007)(66476007)(66556008)(38100700002)(52536014)(64756008)(66446008)(110136005)(316002)(8936002)(86362001)(76116006)(186003)(6636002)(5660300002)(7696005)(33656002)(8676002)(2906002)(508600001)(122000001)(83380400001)(38070700005)(26005)(6506007)(9686003)(53546011)(71200400001)(4326008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PFNbrjcAw/a8VucprfcHpDTItiZuCXP5oXiL4yvJbKXMASAFfvl1Zme97Xxt?= =?us-ascii?Q?Nh9yim+CbDxLyac0hUzlnku5nyoi+f8JAqRWOqB83G6v51y+Zm+iesmNwJHf?= =?us-ascii?Q?KQ6VRnflBPj7NNoW4OOS0Xd8OrhNQBOx0fcOJnXqSHock6FY97ijm1lnx1rm?= =?us-ascii?Q?uRAYJ9JEWcx/FYS/otjNJy2E4IfLoKtgKlZvQE61ncm+DxPG7/LkgYdhuSUu?= =?us-ascii?Q?JHmc7YblwHoWlZBADNknW26DdzIwZ/KTH0jSSv+0kpQiud6mBmxEu6PBt1uO?= =?us-ascii?Q?Yv0IMHthh6nmJMgCOUBA6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=?us-ascii?Q?w+BBefcfJdqxjdR1q25vJi9zagpNOVVr8j5LnbzuXe2gH/KftZR3ylmClWkG?= =?us-ascii?Q?e95Y2DGlFZUkArXFsKKvv3gpESYC0cjppREx6wLJJex5VnTH5hZvagUmNKaD?= =?us-ascii?Q?ocOHK9v5BFPNvMifzwYgoEl56+NNFyk47VGZPSzrVRSiNq2RvzeFm2zoqsoo?= =?us-ascii?Q?RT+J/HIXSETFjrZOYK+ZAgK9CYeV3febYSF+bQI/C3598gZ2gmt3uRx8ZSic?= =?us-ascii?Q?U4pBdM0eVmU86tkbBwO2B3TA2hjhO35d97JDu+tLFrvOhbGZPqd3grn5Mko4?= =?us-ascii?Q?aeiDYh2KpLirXTLS4JUNSPo6/RV1GXJFbeCsoPTNYVtf4oIRq61r2BLsSDej?= =?us-ascii?Q?lr4aIcIOJrMfyx/xRZd/40Aq/Yh1DSVf8uz6tTpALRsaqLYPyd+GRHTQ54qF?= =?us-ascii?Q?9WIjXmYDB400wq6HRUY7K3/BZICHlsdU28pb4+WObaMQwfdWol4iZJ7RKGHi?= =?us-ascii?Q?hJovyI7PYOpADLtw6SVTbXlZKXsRR9XCEx8T1QwKA+8YbMZCj6qUvoycawyG?= =?us-ascii?Q?XbTivhXqYw=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: DM6PR12MB3753.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5985563-2fde-44ed-3a10-08da422baab8 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2022 11:00:54.1417 (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: K0fFPMx0YXcrpzxb+M86pTSb4nH8c6gU5m+TD7F4YkJy9KPAs+DoKSNP0Nb/oXN1V4e4UMJQyZA3y8Fmns0SfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1136 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 Hi, wenxu I'm sorry, it seems the mlx5_flow_tunnel_validate() routine had been already refactored and fixed, this patch is no longer relevant, With best regards, Slava > -----Original Message----- > From: dev On Behalf Of wenxu@ucloud.cn > Sent: Monday, August 9, 2021 8:44 > To: Gregory Etelson > Cc: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] net/mlx5: fix empty err msg in > mlx5_flow_tunnel_validate >=20 > From: wenxu >=20 > If the mlx5_flow_tunnel_validate validate the flow tunnel rule failed, th= e > err_msg is empty in the rte_flow_error. >=20 > Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload") >=20 > Signed-off-by: wenxu > --- > drivers/net/mlx5/mlx5_flow.c | 43 ++++++++++++++++++++------------------= ----- > 1 file changed, 20 insertions(+), 23 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index e63a297..3c5aca0 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -9081,30 +9081,31 @@ int mlx5_alloc_tunnel_hub(struct > mlx5_dev_ctx_shared *sh) > return err; > } >=20 > -static inline bool > +static inline int > mlx5_flow_tunnel_validate(struct rte_eth_dev *dev, > struct rte_flow_tunnel *tunnel, > - const char *err_msg) > + struct rte_flow_error *error) > { > - err_msg =3D NULL; > if (!is_tunnel_offload_active(dev)) { > - err_msg =3D "tunnel offload was not activated"; > - goto out; > + return rte_flow_error_set(error, EINVAL, > + > RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, > + "tunnel offload was not activated"); > } else if (!tunnel) { > - err_msg =3D "no application tunnel"; > - goto out; > + return rte_flow_error_set(error, EINVAL, > + > RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, > + "no application tunnel"); > } >=20 > switch (tunnel->type) { > default: > - err_msg =3D "unsupported tunnel type"; > - goto out; > + return rte_flow_error_set(error, EINVAL, > + > RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, > + "unsupported tunnel type"); > case RTE_FLOW_ITEM_TYPE_VXLAN: > break; > } >=20 > -out: > - return !err_msg; > + return 0; > } >=20 > static int > @@ -9116,13 +9117,11 @@ int mlx5_alloc_tunnel_hub(struct > mlx5_dev_ctx_shared *sh) { > int ret; > struct mlx5_flow_tunnel *tunnel; > - const char *err_msg =3D NULL; > - bool verdict =3D mlx5_flow_tunnel_validate(dev, app_tunnel, err_msg); >=20 > - if (!verdict) > - return rte_flow_error_set(error, EINVAL, > - > RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, > - err_msg); > + ret =3D mlx5_flow_tunnel_validate(dev, app_tunnel, error); > + if (ret < 0) > + return ret; > + > ret =3D mlx5_get_flow_tunnel(dev, app_tunnel, &tunnel); > if (ret < 0) { > return rte_flow_error_set(error, ret, @@ -9143,13 +9142,11 > @@ int mlx5_alloc_tunnel_hub(struct mlx5_dev_ctx_shared *sh) { > int ret; > struct mlx5_flow_tunnel *tunnel; > - const char *err_msg =3D NULL; > - bool verdict =3D mlx5_flow_tunnel_validate(dev, app_tunnel, err_msg); >=20 > - if (!verdict) > - return rte_flow_error_set(error, EINVAL, > - RTE_FLOW_ERROR_TYPE_HANDLE, > NULL, > - err_msg); > + ret =3D mlx5_flow_tunnel_validate(dev, app_tunnel, error); > + if (ret < 0) > + return ret; > + > ret =3D mlx5_get_flow_tunnel(dev, app_tunnel, &tunnel); > if (ret < 0) { > return rte_flow_error_set(error, ret, > -- > 1.8.3.1