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 06E38A0487 for ; Mon, 1 Jul 2019 06:38:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D93BA31FC; Mon, 1 Jul 2019 06:38:43 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140074.outbound.protection.outlook.com [40.107.14.74]) by dpdk.org (Postfix) with ESMTP id AE77931FC; Mon, 1 Jul 2019 06:38:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WtCJScTBsYdNrRirAnREbd2TsLyF1+GhUbV0uosNCQA=; b=e6KjjiSf9YOXRZEG1SMrAPubqZ7G8KiP7Ii3IJBewwPW5n4LdFwqXG7guWro96vz4omzn4QSU6PIsVVvUqtytnyL/erPx19w5KIHDEFD1ISBGu1vPAxHHPkIFzF0w1ti0h0rMtmiL+qxJ3Iog7z59G+DnGfoQ5dMEAGfy8vTde4= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3121.eurprd05.prod.outlook.com (10.171.186.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Mon, 1 Jul 2019 04:38:39 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::1442:fc4d:41ad:29d2]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::1442:fc4d:41ad:29d2%5]) with mapi id 15.20.2032.019; Mon, 1 Jul 2019 04:38:39 +0000 From: Slava Ovsiienko To: Moti Haimovsky , Raslan Darawsheh CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5 1/2] net/mlx5: fix crashing testpmd on null drv opts Thread-Index: AQHVJlrZtkTwnjeTO06maD3k+119+Ka1QM3Q Date: Mon, 1 Jul 2019 04:38:39 +0000 Message-ID: References: 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=viacheslavo@mellanox.com; x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 722825e8-a1a2-4fb3-838d-08d6fdddfd3d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM4PR05MB3121; x-ms-traffictypediagnostic: AM4PR05MB3121: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1186; x-forefront-prvs: 00851CA28B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(346002)(39860400002)(366004)(376002)(13464003)(189003)(199004)(229853002)(110136005)(2906002)(52536014)(4326008)(6116002)(450100002)(14454004)(5660300002)(33656002)(71200400001)(316002)(71190400001)(99286004)(66446008)(9686003)(478600001)(55016002)(6436002)(76116006)(64756008)(66946007)(66556008)(66476007)(66066001)(54906003)(73956011)(53936002)(6246003)(7696005)(8936002)(53546011)(6636002)(11346002)(476003)(68736007)(86362001)(486006)(26005)(186003)(14444005)(102836004)(256004)(25786009)(76176011)(305945005)(446003)(7736002)(3846002)(6506007)(74316002)(81166006)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3121; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: 8bvVbxb7jgYIpOJmC+ofbGLRtq3/C+oXep2dqC9Wd7ClFVUsONSgUwFd6v6sDChAkElG20t/3ZKS3mxpfl37SygWcpB4L/DjnRdaqamNXdFpnUfBPspbnoh3m1PJSuaT2hwSMedgbXKDlgTHUWePKJ1L1QyCVOAumBEkbsQ87tiXb+UQ0HLUB1Gh1dfyDFMuwbjVof5+AZoZa7zpxXY4nfkrNC4yR/2Ffc9kH3ebBw5PbxPXqUBA1AoULjkft5jxNBkwrqtSIOLgWej5H8UZYa0ZrLDB659B+ElennpmnRo/npjKTx1+M/nX38JI9CW02kmsht6H9WRZe8+JaZhYp8aP+F1Z/XseZ/4AuhSNPt0fx350/BW1BQyL/QqUC21jA9QDNRtqpg3UxLhTkmCWlFpkPv4FwsIGXvoU345LFb4= 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: 722825e8-a1a2-4fb3-838d-08d6fdddfd3d X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2019 04:38:39.6761 (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: viacheslavo@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3121 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v5 1/2] net/mlx5: fix crashing testpmd on null drv opts X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Acked-by: Viacheslav Ovsiienko Thanks > -----Original Message----- > From: dev On Behalf Of Moti Haimovsky > Sent: Wednesday, June 19, 2019 7:52 > To: Shahaf Shuler > Cc: dev@dpdk.org; stable@dpdk.org > Subject: [dpdk-dev] [PATCH v5 1/2] net/mlx5: fix crashing testpmd on null= drv > opts >=20 > mlx5 implements mlx5_flow_null_drv_ops to be used when a specific flow > typei/driver is not available or invalid. > This routines return error without modifying the rte_flow_error parameter > passed to them which causes testpmd, for example, to crash. > This commit addresses the issue by modifying the rte_flow_error parameter > in theses routines. >=20 > Fixes: 0c76d1c9a18d ("net/mlx5: add abstraction for multiple flow drivers= ") > Fixes: 684dafe795d0 ("net/mlx5: add flow query abstraction interface") > Cc: stable@dpdk.org >=20 > Signed-off-by: Moti Haimovsky > --- > v4,v5: > * Resend the message from a server not inserting DOS line-termination > symbols. >=20 > v3: > * Modified patch subject. >=20 > v2: > * Fixed checkpatch warnings. > --- > drivers/net/mlx5/mlx5_flow.c | 29 +++++++++++++++-------------- > 1 file changed, 15 insertions(+), 14 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 9887018..e5a8e33 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -1694,19 +1694,20 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > const struct rte_flow_attr *attr __rte_unused, > const struct rte_flow_item items[] __rte_unused, > const struct rte_flow_action actions[] __rte_unused, > - struct rte_flow_error *error __rte_unused) > + struct rte_flow_error *error) > { > - rte_errno =3D ENOTSUP; > - return -rte_errno; > + return rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, NULL); > } >=20 > static struct mlx5_flow * > flow_null_prepare(const struct rte_flow_attr *attr __rte_unused, > const struct rte_flow_item items[] __rte_unused, > const struct rte_flow_action actions[] __rte_unused, > - struct rte_flow_error *error __rte_unused) > + struct rte_flow_error *error) > { > - rte_errno =3D ENOTSUP; > + rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, > NULL); > return NULL; > } >=20 > @@ -1716,19 +1717,19 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > const struct rte_flow_attr *attr __rte_unused, > const struct rte_flow_item items[] __rte_unused, > const struct rte_flow_action actions[] __rte_unused, > - struct rte_flow_error *error __rte_unused) > + struct rte_flow_error *error) > { > - rte_errno =3D ENOTSUP; > - return -rte_errno; > + return rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, NULL); > } >=20 > static int > flow_null_apply(struct rte_eth_dev *dev __rte_unused, > struct rte_flow *flow __rte_unused, > - struct rte_flow_error *error __rte_unused) > + struct rte_flow_error *error) > { > - rte_errno =3D ENOTSUP; > - return -rte_errno; > + return rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, NULL); > } >=20 > static void > @@ -1748,10 +1749,10 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > struct rte_flow *flow __rte_unused, > const struct rte_flow_action *actions __rte_unused, > void *data __rte_unused, > - struct rte_flow_error *error __rte_unused) > + struct rte_flow_error *error) > { > - rte_errno =3D ENOTSUP; > - return -rte_errno; > + return rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, NULL); > } >=20 > /* Void driver to protect from null pointer reference. */ > -- > 1.8.3.1