From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1A1F7A046B for ; Tue, 28 May 2019 15:23:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F03791B99C; Tue, 28 May 2019 15:23:51 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10073.outbound.protection.outlook.com [40.107.1.73]) by dpdk.org (Postfix) with ESMTP id 24E2B1B95C; Tue, 28 May 2019 15:23:48 +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=YVzCXx88jQKSoLlAzibLu3bAH+LGZvdlbk2SYk0DmAs=; b=e0pjayT0pHp5SCuksqQ9FoBsoHdP/khrFekP52mCYmSbmRZB5qJYCFk/tpJ97PYS5Y0G/nXIMbNylnjCqw4Jzg2GvLjVI4/DIap1b8aIOGLvRzuA8A7Nrqx0Wl1ibPwzGNB4LC8hF5PSK5heg8hy2F+r2h7Mwm7IreHKtoXAePM= Received: from AM0PR05MB4435.eurprd05.prod.outlook.com (52.134.95.151) by AM0PR05MB6161.eurprd05.prod.outlook.com (20.178.113.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.16; Tue, 28 May 2019 13:23:46 +0000 Received: from AM0PR05MB4435.eurprd05.prod.outlook.com ([fe80::c40a:d6fe:1246:7278]) by AM0PR05MB4435.eurprd05.prod.outlook.com ([fe80::c40a:d6fe:1246:7278%4]) with mapi id 15.20.1922.021; Tue, 28 May 2019 13:23:46 +0000 From: Moti Haimovsky To: Shahaf Shuler CC: "dev@dpdk.org" , Moti Haimovsky , "stable@dpdk.org" Thread-Topic: [PATCH v3 1/2] net/mlx5: fix crashing testpmd on null drv opts Thread-Index: AQHVFViUfMGGEWUn9EuqEmPHfAKAog== Date: Tue, 28 May 2019 13:23:46 +0000 Message-ID: <51f2f9ff4410bcbd4939f48d9cb7ce2b4fbf17f5.1559049191.git.motih@mellanox.com> References: In-Reply-To: Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR08CA0095.eurprd08.prod.outlook.com (2603:10a6:800:d3::21) To AM0PR05MB4435.eurprd05.prod.outlook.com (2603:10a6:208:61::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 1.7.1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b0866738-620e-4404-24a0-08d6e36fb6bc 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:AM0PR05MB6161; x-ms-traffictypediagnostic: AM0PR05MB6161: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:612; x-forefront-prvs: 00514A2FE6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(346002)(366004)(136003)(199004)(189003)(486006)(6116002)(450100002)(446003)(11346002)(66066001)(6436002)(66446008)(64756008)(66556008)(66946007)(478600001)(73956011)(76176011)(53936002)(66476007)(386003)(99286004)(102836004)(3846002)(2906002)(4326008)(6506007)(2616005)(6512007)(6636002)(6862004)(71190400001)(71200400001)(52116002)(14454004)(476003)(118296001)(81156014)(81166006)(8676002)(37006003)(54906003)(256004)(26005)(8936002)(186003)(305945005)(50226002)(7736002)(68736007)(5660300002)(316002)(86362001)(36756003)(25786009)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB6161; H:AM0PR05MB4435.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ULi+dDDJeXPvAsQFVXnqQnx96QM15R/gmXIZiV2dAk25O6Y9KBt/ZNR6jAg6aihJCK2iet6mnE4NIXBhLtbEOe2aVP/luSAOzQoFp6VNlKzkIQytXdqPUBYdVayLfEpicY0mlGrdl2KOvfprtjae3RIhC3RCmsjAzUtQT1BJi8VU69v8awRY/XjNY1L3ubyxcX/WqJ5Yj7XsRiRSMdJlbyCdi/xk36jwWe1zG6uEvqpPH1HsyyC06ptzbwXPiEzIYAoQHoS09hNoy5F1LiNb7K9pJ0UMedoz8JH/arzn3GBVEXmDVgeruZ0PSe5wnj8nFo7oRBNmSjxJK0ItGi5LzUcQxn+i5hLwADwxnAwnl5xJXrNz9zHe04Dl0xQqWrHGuQUrdEwobdFaozIAGppjyxwhPpe9bQdDJ3jdoA+DKAQ= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0866738-620e-4404-24a0-08d6e36fb6bc X-MS-Exchange-CrossTenant-originalarrivaltime: 28 May 2019 13:23:46.8890 (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: motih@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6161 Subject: [dpdk-stable] [PATCH v3 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-Subscrib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w0KKwlyZXR1cm4gcnRlX2Zsb3dfZXJyb3Jfc2V0KGVycm9yLCBFTk9UU1VQLA0KKwkJ CQkgIFJURV9GTE9XX0VSUk9SX1RZUEVfVU5TUEVDSUZJRUQsIE5VTEwsIE5VTEwpOw0KIH0NCiAN CiAvKiBWb2lkIGRyaXZlciB0byBwcm90ZWN0IGZyb20gbnVsbCBwb2ludGVyIHJlZmVyZW5jZS4g Ki8NCi0tIA0KMS44LjMuMQ0KDQo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 47EB6A00E6 for ; Mon, 10 Jun 2019 19:49:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C2B41C116; Mon, 10 Jun 2019 19:49:13 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 17F3D1C116 for ; Mon, 10 Jun 2019 19:49:12 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from motih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 10 Jun 2019 20:49:07 +0300 Received: from r-vnc11.mtr.labs.mlnx (r-vnc11.mtr.labs.mlnx [10.208.0.123]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x5AHms9I018957; Mon, 10 Jun 2019 20:49:07 +0300 From: Moti Haimovsky To: haimoti2000@gmail.com Cc: Moti Haimovsky , stable@dpdk.org Date: Mon, 10 Jun 2019 20:48:51 +0300 Message-Id: <51f2f9ff4410bcbd4939f48d9cb7ce2b4fbf17f5.1559049191.git.motih@mellanox.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-stable] [PATCH v3 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190610174851.w_ld51ZAtbHzehymDq8oKtRO2MZ-xs-1t1QsluIQQtQ@z> 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. Fixes: 0c76d1c9a18d ("net/mlx5: add abstraction for multiple flow drivers") Fixes: 684dafe795d0 ("net/mlx5: add flow query abstraction interface") Cc: stable@dpdk.org Signed-off-by: Moti Haimovsky --- v3: * Modified patch subject. v2: * Fixed checkpatch warnings. --- drivers/net/mlx5/mlx5_flow.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) 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 = ENOTSUP; - return -rte_errno; + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, NULL); } 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 = ENOTSUP; + rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, NULL); return NULL; } @@ -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 = ENOTSUP; - return -rte_errno; + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, NULL); } 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 = ENOTSUP; - return -rte_errno; + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, NULL); } 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 = ENOTSUP; - return -rte_errno; + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, NULL); } /* Void driver to protect from null pointer reference. */ -- 1.8.3.1