From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30046.outbound.protection.outlook.com [40.107.3.46]) by dpdk.org (Postfix) with ESMTP id A22541B45B for ; Thu, 2 Aug 2018 13:20:33 +0200 (CEST) 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=33R+WG/An3IB7Uc6p1PFUKxH5moyOde6nMYkgyh7pOU=; b=kjPXp14IJsg4xCjSNN7bRuyfncnM948mYTQnM3zqzLWoE7D5peIiLGd7bpTb2b+xldvWL9lJeaeYCnFejpmo71qXexoTmS6oUxw5zjGhIDVAesLbBycChbPuwEIaAd5BDY0OEW6Y922RSjiErfyGjWzftfYNR+TpYae7Ud77WcI= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4858.eurprd05.prod.outlook.com (20.176.235.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Thu, 2 Aug 2018 11:20:32 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::52a:650b:ae10:fc3]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::52a:650b:ae10:fc3%4]) with mapi id 15.20.1017.010; Thu, 2 Aug 2018 11:20:32 +0000 From: Shahaf Shuler To: Adrien Mazarguil , Mordechay Haimovsky CC: "dev@dpdk.org" , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= Thread-Topic: [PATCH v2] net/mlx5: fix RSS flow configuration crash Thread-Index: AQHUKjygl4nWWRZNrE6wQgM2G9RxPqSsUJ+AgAAAWwA= Date: Thu, 2 Aug 2018 11:20:32 +0000 Message-ID: References: <1533130807-9183-1-git-send-email-motih@mellanox.com> <1533199267-9658-1-git-send-email-motih@mellanox.com> <20180802111833.GL5211@6wind.com> In-Reply-To: <20180802111833.GL5211@6wind.com> 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=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4858; 6:Qoy1hqqH/fxmDPu8T1CalUtTajxdLbup2muHfmXupmaECnhDDsuP0t5V1YnUddgn8bLvMWdnGQv4A2dmw9FdLlDOKChoAd1R+FvglMKzFPiQJCILfKaQmeQQvjIrs+0LyOLbXi7x5xkfB5Ch8eKAqKFIaSE9CHAKvvlhnTGb3qePkXdFulMlrtYC45icM4pNZBTTmnBiGfsqrEwg0LKtYHyJAAkm2+MVCRURpclHWK0SLP17VXd382CoTkRJGaFeYE/ckdut3sAwBRP+AVWN5+LK5BPUgQeinjy28AWFAaDg+4l3+9IMf5n9Touk9gHt4qlWJ9uoyY8Tt1H20gFYkeqjv1f84ET727SGBbRnIuDVWUyd7kaRwh+F4jJNbmvgKO0+0u1jpLOVAFlSuk8P2kj8tIQtyWTpc6t3vzk8m/DfbdUK/ne83TfpiJBs+lmwVOzAdlbg/A7yVVPSzos7eQ==; 5:gdYMi129FCNyaysADH2/2AykgLqcfHQ/YLi6eXbTEjm37QP4ROzgIkQbGodXQr8aTE2XWIlhUJ+QlcFYTUKDs/Fvz2DOEhA7q0UT2Q8P3fdyCL5H2hJgtg8WsW0C2wc5BOvPTW+bhchiFzDiuCcIt7kOCKheHIrDqcPz7J82FDY=; 7:texHVeYsVG2/Fhre1zM+rEMCzX2OxzRctfZFJKZ7XEADMHb525la4RutraMbhOIveyG4jB/bhXgZU5bTM/uiyd7Qs+FYb53yDdg4CFg1kRdnRk44uB/VuwLnS3RuaSXqQlx/05WFTVXx2yWLgrENomSBKOAWGlP91yLiT2Z4L4VZYQdh6PlQIcYe0zFIZctk7TF2WJWICW4ZpNP6ZVg+1EhimyzB9OYEROjDk0ibxq5YdFawsys8AIO0WDSrEcor x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 259e7f44-cd85-4384-d912-08d5f869f609 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4858; x-ms-traffictypediagnostic: DB7PR05MB4858: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4858; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4858; x-forefront-prvs: 07521929C1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(39860400002)(136003)(396003)(346002)(189003)(199004)(256004)(316002)(97736004)(186003)(14444005)(25786009)(55016002)(26005)(110136005)(86362001)(102836004)(11346002)(53936002)(446003)(54906003)(6246003)(6506007)(8936002)(106356001)(76176011)(229853002)(105586002)(7696005)(99286004)(9686003)(4326008)(2900100001)(2906002)(6436002)(8676002)(68736007)(305945005)(66066001)(81156014)(3846002)(476003)(5250100002)(486006)(5660300001)(478600001)(6116002)(81166006)(33656002)(74316002)(6636002)(14454004)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4858; H:DB7PR05MB4426.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-microsoft-antispam-message-info: Oxd1qSgnsiampaTyu2L+ir0Xd8j+Za61xeSpb5VECrUdGfQJxgxQ1Yn+995SwbmQPr2t2OiYu0GTQodQHtBodN+MmK7UzNxTuAVfEJSsX67EqTzPcRsWugaiOF4RCb9RnXJbM6U1nsskhx8iwi8fvulQVl6SxGd1nbd3VOClzabTYTKvyJtg3GvtHn8+yg/poExF3H5eSKNwBoOOBYNdT02MQ9lnPa6pIUgQvK58C1xbLCGUB7oD70nyCKIRuqJFg8TfG4EMu0pwOt8+516zkAxliH+QdIp/CQuINZS1pdEz9VEYdXpnkJBnGid8Y8hL8JE2fYqBLWDdpQgTVynvO9H/9qSUhRBmYwlZmxq+vxA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 259e7f44-cd85-4384-d912-08d5f869f609 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2018 11:20:32.5377 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4858 Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: fix RSS flow configuration crash 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: , X-List-Received-Date: Thu, 02 Aug 2018 11:20:33 -0000 Thursday, August 2, 2018 2:19 PM, Adrien Mazarguil: > Subject: Re: [PATCH v2] net/mlx5: fix RSS flow configuration crash >=20 > On Thu, Aug 02, 2018 at 11:41:07AM +0300, Moti Haimovsky wrote: > > This commit fixes a segmentation fault observed when configuring > > mlx5 with RSS flow rule containing invalid queues indices such as > > negative numbers, queue numbers bigger than the number Rx queues the > > PMD or has no queues at all. > > > > Fixes: 592f05b29a25 ("net/mlx5: add RSS flow action") > > Cc: nelio.laranjeiro@6wind.com > > > > Signed-off-by: Moti Haimovsky > > --- > > v2: > > * Modifications according to review by Adrien Mazarguil. > > in reply to 1533130807-9183-1-git-send-email-motih@mellanox.com >=20 > Almost, there is one new occurrence with the same issue, see below. >=20 > By the way, like for "types" and "level" fields, a zero value in "queue_n= um" > could be interpreted as default in order to target all configured queues,= for > the convenience of applications that do not care. >=20 > This is not explicitly documented so it's just a recommendation though. >=20 > > v1: > > * Added check for zero queues. > > --- > > drivers/net/mlx5/mlx5_flow.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/drivers/net/mlx5/mlx5_flow.c > > b/drivers/net/mlx5/mlx5_flow.c index 6c3021a..5576044 100644 > > --- a/drivers/net/mlx5/mlx5_flow.c > > +++ b/drivers/net/mlx5/mlx5_flow.c > > @@ -2065,6 +2065,11 @@ struct mlx5_flow_tunnel_info { > > > RTE_FLOW_ERROR_TYPE_ACTION_CONF, > > &rss->key_len, > > "RSS hash key too large"); > > + if (!rss->queue_num) > > + return rte_flow_error_set(error, ENOTSUP, > > + > RTE_FLOW_ERROR_TYPE_ACTION_CONF, > > + &rss->queue_num, Will fix locally. No need for new version.=20 >=20 > Here ^^ >=20 > > + "no queues were provided for > RSS"); > > if (rss->queue_num > priv->config.ind_table_max_size) > > return rte_flow_error_set(error, ENOTSUP, > > > RTE_FLOW_ERROR_TYPE_ACTION_CONF, @@ -2077,6 +2082,12 @@ struct > > mlx5_flow_tunnel_info { > > "some RSS protocols are not" > > " supported"); > > for (i =3D 0; i !=3D rss->queue_num; ++i) { > > + if (rss->queue[i] >=3D priv->rxqs_n) > > + return rte_flow_error_set > > + (error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION_CONF, > > + rss, > > + "queue index out of range"); > > if (!(*priv->rxqs)[rss->queue[i]]) > > return rte_flow_error_set > > (error, EINVAL, > > -- > > 1.8.3.1 > > >=20 > -- > Adrien Mazarguil > 6WIND