From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D069A00BE; Wed, 29 Apr 2020 11:44:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0A43D1D966; Wed, 29 Apr 2020 11:44:28 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70050.outbound.protection.outlook.com [40.107.7.50]) by dpdk.org (Postfix) with ESMTP id 49C531D6B6 for ; Wed, 29 Apr 2020 11:44:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AycS+L0cOUJXDwAR6edeGEEqN3T4T9k8joJrp9dYuZR3oJRuicHwmWn75Qud2EsRzj0vhVzdZQn71ONU4C8kIn9FRck2dmFz9sxjtq4mo7ZhNPKHP7XOf4BA6Eq0O7xt8y33+KtRMKD/hw0Pa/6uroBSQuYB7MA4m1ABy2NjjRkm468HK3AUS2C/MlnVRUiNOsmK6+AroRFrpzZoi/dNpVk6JYax2VZqF6B4ciBTyyAkLKC2XQX5wWyvux8ODdNDylgwq7PwY4z5Q3QIoQaeLLvQJF5EQ8n44YzDtlZWPWfqgnbkzJN9IXWgK0wkBaBzWLOAQg/3WfRN8OGLHpCNDw== 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-SenderADCheck; bh=0ag/JFQaixx2XT3i0y+/l4SH8wutpwJrNvLZrc9hCTo=; b=b4hXQu+vrMzyJI/4aQdQ3Cdf7HopZgHeak6toL4ui2rg3A2PdTLcwJNcIVr37aqoyCWVlwmLxO5J165magnO8pTMlg9afYjc4S4UO1Ql6bECcBfN0p3PaHdZ8SWUhOVkrZl313bZBC3zjSDRy3n+fLCnOzcSU0BUiPo13ojfL5nOVA/TMe1pbs2FsZX60ywozkMHSyQvteZl+Esqc4V2G946lIWfNQQVyhSnkqjnBEedw2/MPQx7BEYwwYYBQt2hg1AOyeS88EMUfTt89+Nf5F1Agu0Wv9dK7pZQiCSQaRUVR6BiEeuT1lHrznINivcyR9ezv3GNMXXxTsUUYx7S4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=0ag/JFQaixx2XT3i0y+/l4SH8wutpwJrNvLZrc9hCTo=; b=FoOQn14nrxUBsLGdB/PWgbiOQ6Ef4a/4qo2VYobuKw1//N9yNNmxmt3WzFAix6iqnMN2B2tjLtYe9NiOU8VdDI3zbPoKD5L0FMJ5hN0rfiajBqHk8Z40MS+V2IE2hfq8WqIUNgvvmnHrXVwZsWHNHUIyZ3NAHIof4OYqwQBUsAw= Received: from VI1PR05MB6718.eurprd05.prod.outlook.com (2603:10a6:800:13b::9) by VI1PR05MB5663.eurprd05.prod.outlook.com (2603:10a6:803:d0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Wed, 29 Apr 2020 09:44:23 +0000 Received: from VI1PR05MB6718.eurprd05.prod.outlook.com ([fe80::6d6a:e905:6b4b:addd]) by VI1PR05MB6718.eurprd05.prod.outlook.com ([fe80::6d6a:e905:6b4b:addd%6]) with mapi id 15.20.2937.023; Wed, 29 Apr 2020 09:44:23 +0000 From: Raslan Darawsheh To: Bing Zhao , Ori Kam , Slava Ovsiienko CC: Matan Azrad , "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix the empty flow error structure Thread-Index: AQHWFIohCeI/b6g8ZkyFd8Nb1B1s0aiP65iw Date: Wed, 29 Apr 2020 09:44:23 +0000 Message-ID: References: <1587108644-456343-1-git-send-email-bingz@mellanox.com> In-Reply-To: <1587108644-456343-1-git-send-email-bingz@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [188.161.230.216] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 14a8194c-7578-4668-37d9-08d7ec21e607 x-ms-traffictypediagnostic: VI1PR05MB5663:|VI1PR05MB5663: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2733; x-forefront-prvs: 03883BD916 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OW/HihoJRJMBTMTVQkdfVP8/GsOhXlwVJvz0GrJT1ns62Kj5jX7zaEE3os80tqere1xhfEgGlyW988nu4fZkclZ90yBjcFyCUp9m9I3x1pntRroBF5HMCONaDZ3Yjg7tB2Rk8IfhQjYqxT0clXAl2j83zScNtkQYFE2PkdAQlQeYm2lNx2yZE4xHThRm9i3o7sraRY2/WPuppkD4jKgvDRluiIqsdaeTE3XBY/d88UuR/0bYfG91B6DQI7O/DvNcHgU3FrGlB5bApp3i8+01tFfUG5xePu4wj3PYO7JcfAN5IQbymOrr+DhB8MuycQJ2FkCIeCYFQKatlwuSgSRfvjdjBtCERPXmYlo/z4/7BkNcrt5nhVFDGW1/G3+v9PDcWG54t6/eps/kGohM++Sy5FahVWVMzxF00gioj+YntuckE/BLH9gA9gsJlQRn0GL1 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB6718.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(376002)(346002)(39850400004)(396003)(478600001)(86362001)(5660300002)(53546011)(6636002)(6506007)(316002)(71200400001)(186003)(26005)(110136005)(7696005)(54906003)(4326008)(8676002)(8936002)(2906002)(66946007)(66446008)(64756008)(66556008)(66476007)(55016002)(9686003)(33656002)(76116006)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: +Z5AqaKQoyen076ZT01GRyki3jQb29CYKoLsi+gqpiNYCNEArQM1SAB0SaqTFSCmldeUeDYSG8U84M58HhA0RQqgHzbvIywqPTraJIpd45XKsP28+Vl4iqRdNbVJa6X5cgyQ3U+P/NkuWI3Ziolig3tXFNOFPXSX/MAnDnop1gb9w/C9Tg5Rz9WGWvVb5uCLmQUOEu2QbmWcwDVHcWRdBZJHGQIVUQ1ajDCIew9rcgtpPUPX/SYIHvOCE2dnTjMsMNNIwLP9stwwTI22I6ZG1b63xlTHnai4TGrfKG2FEs/2l8UnUnKsudocgRUrWdwlyKzf0Wrr0uXCNvHwSMMirG2XnZFK8j054nq+57FOeVTVTkH9xerZPCCvsnYfxxvpWfylz8olGvVYIzCAIiQWNzvKPk4B0HkohU54BAwuhQEaKhtf0ruNtwP7CrEMQdW4B1Tc53ILToFUbDADbr4UwXOuKHikLzWKor7zfohyA87woQM+w5soM9mjm7wZ5jBQjV0wYB9e/ajYPf4ERD2aD9gU4yCQiWsbNQ48vnXNyhgM2j7RElkYOMn/sDXyBBMsbTJ8mz0hCl/LD+EYl3XwvvNNaNUWe7ls6SAMSxlhtUiYSfrVd0qqmbn+jpvFCnXODoYcdgpFKOsrHYsj+GixFUqW01Kxg51nMnb3bjaLjs5g4s0Y5zdWA/fJdaUMW65R/JofySO9g5kOpXpwIgyBRe1cotxOt/MfsDR2OlFaNwW/InIzAcN+psYTSDS82Q4/AJvuFA6eI54EQWH8S88nSdVwp1UCujWMN8KNZQnjWEJtWcf1BjzLIKr31wEfh2Sj 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: 14a8194c-7578-4668-37d9-08d7ec21e607 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2020 09:44:23.2029 (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-CrossTenant-userprincipalname: qupRB+q3HOZwV+097E1mutYzhYVgkeDVv0tG91I7o3VOt5yoOFPUnZDQvp1AlOLxg7Ctvx10mxC/Rfw17xeZ9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5663 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix the empty flow error structure 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" Hi, > -----Original Message----- > From: Bing Zhao > Sent: Friday, April 17, 2020 10:31 AM > To: Ori Kam ; Slava Ovsiienko > ; Raslan Darawsheh > Cc: Matan Azrad ; dev@dpdk.org > Subject: [PATCH] net/mlx5: fix the empty flow error structure >=20 > The output flow error parameter is used to indicate the detailed > reason of the failure when calling a rte_flow_* interface. Even > though sometimes the application will not check it or use it, the PMD > must fill it in the failure branch before returning. Or else, some > dirty value in the stack, heap will be accessed as a pointer and then > cause a crash. > In this case, when a port is stopped, it is not allowed to insert a > flow from application. The detailed error information should be > filled. If the application needs to check the detailed error reason, > it will get the information but not result in any crash. >=20 > Fixes: 6ec024870715 ("net/mlx5: check device stat before creating flow") Fixed Fixes line sha >=20 > Signed-off-by: Bing Zhao > Acked-by: Ori Kam > --- > drivers/net/mlx5/mlx5_flow.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index c529aa3..6a5522c 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -4490,9 +4490,12 @@ struct rte_flow * > * are not affected. > */ > if (unlikely(!dev->data->dev_started)) { > - rte_errno =3D ENODEV; > DRV_LOG(DEBUG, "port %u is not started when " > "inserting a flow", dev->data->port_id); > + rte_flow_error_set(error, ENODEV, > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > + NULL, > + "port not started"); > return NULL; > } > return (void *)(uintptr_t)flow_list_create(dev, &priv->flows, > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh