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 52791A0C4C; Tue, 21 Sep 2021 12:09:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D35F040683; Tue, 21 Sep 2021 12:09:52 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2040.outbound.protection.outlook.com [40.107.94.40]) by mails.dpdk.org (Postfix) with ESMTP id C4ACE4003C for ; Tue, 21 Sep 2021 12:09:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXByAL5bNUums1aetL1aQr6263uN8P0aJL/0JkvsllVWgXxQSi01R9d220PVSoUiWbXFoxkLwyVNbYirzNJuB0r3KvUKf6X7uFEpnGfaDXpMErNXwGzalX704l661662S2tyJKiZXV02nNCW6g8+XJeQMdycbFffsUazYUQFtAp6tFsMzjZ1BMyNudJPddfIfdZqh4Vew3vt0Hej6epNs+2p/LHKIuvkd/Ff3FdzYde98vPx3rakfafa+ZuvwLIxkY8vPA+hyBIvbT0KSBidUXNB/6OhND5vckQ4fuzoVedr112Q7BaNTxomNIB82Pg83Ml0E98SpSFhfOHc2TqbHA== 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; bh=L+hfTRn557DzxblyUWh9K3udSNqrfX9CIFahzv8ab9o=; b=Uww05pcvdgQzkTvElkunkUvI/XTZ1uPK6D9Y1qZNqY9DJ490zUb0dt9W9M3AQ8d7TZrcBZoRQz/eHTaHKU8/gN7h5JRnITjl9KLVoI6IsuGcPRbDLMjEu+os8zRLPeIpZVVS5/99kns0WRHilLyUW0+LIOQ5AHAxYvsiJm76eU+MbNUuRzkV6YnOoXP6eDnFOhOtEY/8mZ5txVm8j7C06CnMn2W3kR2iW6ehEzXbKGds3I1t1XyLOM8sddIYVMPY6L6f+CoIrwWPYLVVdxqfoPp/gmlatv85Wq47iDvkq9BM9HCAoSi629/UvY5mG9ZhqSp6VX0tRNW4TvsUBAEN3A== 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=L+hfTRn557DzxblyUWh9K3udSNqrfX9CIFahzv8ab9o=; b=AFzdOPmkPPijxlLzdHLG8X7wqTGsch/P1rV5Y/xYbvpa5CiRErxO2LyoKN43SpDweVLBAnGxlj3xye7+OWEnJ3wbmv4KEpTAOGg+LrHAecv+GY2sDycmxM8npd7OJEyXu5R2kJOu0gJrFHisfK7ccM+S3TGvEL5L8a4trJYeMlq+BRIDwxcoDdQaL7bRHwWvbgUQZdWCZBNthvu6GxP9bPfBVdb5jUCLXFK/rc0OA8tjJXKeBzzNNq4mVLy2fQBiNlVmjENC5Ca2PiiAG/wlfQj/hpI3k5Uw4s8KfLQJ8c6HaqV2op2hdl2kIlEsOr+Dlr+i+59LKXjvH9KwX0mGpw== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by DM6PR12MB4370.namprd12.prod.outlook.com (2603:10b6:5:2aa::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Tue, 21 Sep 2021 10:09:50 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::e550:35a2:96e5:657f]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::e550:35a2:96e5:657f%4]) with mapi id 15.20.4523.018; Tue, 21 Sep 2021 10:09:50 +0000 From: Slava Ovsiienko To: "wenxu@ucloud.cn" , Gregory Etelson CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix empty err msg in mlx5_flow_tunnel_validate Thread-Index: AQHXjOGebCAywPSBXkmINwqEW9GuQquuhWXg Date: Tue, 21 Sep 2021 10:09:50 +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: ucloud.cn; dkim=none (message not signed) header.d=none;ucloud.cn; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 739c0237-7383-4012-ce7e-08d97ce7f2ec x-ms-traffictypediagnostic: DM6PR12MB4370: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pZz37hCF/Wb3PZlfGrh9/cTLlYTPRYXMHnlXBXqnRaF/mjN9T6TSD1yJ1UdNwtVLBxW/GKYUZMjF2nsRSF5Zgi2AbMgxgFhNSZDNyhyu9pdnX6XNanXPcMt0RoP7hZ8kqEeegB1Tg04v7DbOf06/9fEkLauvvTmZZqprZT5ILSqsIDsJHaoj6HvIWq/tr2HDZXZFKUVEDE/SRfbUkil7l+WJb6RBToczSqBwgXLyJC5hf7FOcsebJf58tcbEhLHWqT9o/jMOkGXhrtySF9ivEQoiq5MXJ/8wa0rv2HMxa1WCUUkCGDqBwOi9hUeZZi1nZFzMFHf3RjykIpc5+zleIL1bw6J1Mjrp4eRa7g1LlfTZJIDt0RpDGmTVYOjGXw9VdXWrhC25oebcf0aBwqRxW+dQZ4a94hNPn4vFaRsPlQh4mgL4ZpFJlCtyAGV8fsJxtsuOEXA3ljq38azPI+f+DZnkYEo5sgNIaENrFKyh1sRmy31SceVu9AgILyalB3JfCGTByHF96PPHlF0Yy4/0RxoGcQZORNaMozbIERnWxo4dl5x9HtoetIIc6DcLBCOJDglWbP1C4pIqn95SQ/Yaki+vioHrb2s8esLU5w1CJ0tl5iBAN8tlgQXogekbD+OD7Q00qaUswMFOJKBmXneCTMKPHfz0Pc2d9axcPiCMxgft63Ju+sPulBmRFZsmOgiwh3+r2DHeVHYOTdLxLKf8BQ== 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:(4636009)(366004)(8936002)(4326008)(110136005)(83380400001)(2906002)(8676002)(26005)(5660300002)(33656002)(316002)(38100700002)(9686003)(55016002)(186003)(71200400001)(86362001)(122000001)(6506007)(6636002)(7696005)(508600001)(66476007)(66556008)(64756008)(53546011)(66446008)(76116006)(66946007)(38070700005)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BVoYUCNrUCbmJu2WOKlPibMm5UM3gksW22DGPXEJRkAGwfEw94smK2HWvKAI?= =?us-ascii?Q?aIRL59xGWs9BZf/RMc4gsBkmuEeAga8q+4bKbpMBP+14SHwU+Mh5AAHcqrEt?= =?us-ascii?Q?8XUfjPpkyasQ8FMduJ97WMv6nH2931dC3gsqX7Rgo8C2RqfyYBWzBsByYDqd?= =?us-ascii?Q?0QAMJdzrfU7/WFNTOZOtIctYmJAasDURnQETt1hoNLgZIOWW7hEhDzAfqUey?= =?us-ascii?Q?8rcn2Pfbl1JLBu2syK0nO5nb+tj4QA6FdLtmDQri3ptJhpiO8P3xnkFhzoGZ?= =?us-ascii?Q?+I4IYRcB+vHcWx5epPnXgH+aGnMKvayvEW8JB4vpDG4NbYOIOAOwmuWEGpe1?= =?us-ascii?Q?03n0h/8NF4tsZp8tDBkCHZ6bJ+Qr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ascii?Q?AnkGJcxLLH7Mq+TKGonKiwdOiCg4UWNTX1KT8/7kLYBr+Fmv72kJiq21kbC1?= =?us-ascii?Q?e4Y=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: 739c0237-7383-4012-ce7e-08d97ce7f2ec X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2021 10:09:50.3461 (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: rGFk8ibhw7yFeNOA6n31Gy0IRjZPi/e3z08X+yvZJ/BKXQkhgAhdvFk9Jl0oMugK2TGCpul1+nyvxTM6pHE+HQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4370 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix empty err msg in mlx5_flow_tunnel_validate 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 Sender: "dev" Hi, Winxu Thank you for the patch. > If the mlx5_flow_tunnel_validate validate the flow tunnel rule failed, th= e Typo? "validate" -> "validating" ? > err_msg is empty in the rte_flow_error. Sorry, what do you mean "empty"? It is NULL, not pointing to empty string "= ". Patch looks OK for me, could you, please fix commit message typos and send = v2? =20 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