From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60067.outbound.protection.outlook.com [40.107.6.67]) by dpdk.org (Postfix) with ESMTP id 9EF3F1B45B for ; Thu, 2 Aug 2018 13:17:32 +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=MAta+BtqCG6/aAcGJrHuD4LLVzR+qROXbvbRKE2U9w8=; b=e05kwSUq9gW8lJsgHLfGQTlfOOZZniHGi7jzq0/HotbbJ8YTuSWPTiekkpVXZ2o/T2qXibABXHk0CH789YrL/e06f3tvFHvftL3QHnT2xqoQgjE2HbJERn/KJdsUOLwq9yMyAhMjtXVLd4nAb8ne0fLK3kIYkvHWwQP7WokMy38= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4267.eurprd05.prod.outlook.com (52.134.108.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Thu, 2 Aug 2018 11:17:31 +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:17:31 +0000 From: Shahaf Shuler To: Mordechay Haimovsky , Adrien Mazarguil CC: "dev@dpdk.org" , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= Thread-Topic: [PATCH v2] net/mlx5: fix RSS flow configuration crash Thread-Index: AQHUKjygl4nWWRZNrE6wQgM2G9RxPqSsUAmw Date: Thu, 2 Aug 2018 11:17:31 +0000 Message-ID: References: <1533130807-9183-1-git-send-email-motih@mellanox.com> <1533199267-9658-1-git-send-email-motih@mellanox.com> In-Reply-To: <1533199267-9658-1-git-send-email-motih@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4267; 6:ZpY5sOuGHklhqPjNg/ThHrWQGhSuzmYFP6AMYVViTL/W4BALDKDgnZkD97i12v1KQU8qBWGbnzLby5O9dycGXlcMMRkXnlW+H88siycD69GV4lTReaSQYmYeNvSNbrYGVHCk79JBE7xm+J02BODj4CaHX+YrzxZ/7vGCD2XjiDJ1Loy3XhqJyYrlZk4WAftShEzBU4HclDPmEc/ggGctC7jIm29UFgC9NuU7w/Cx8dHpp8RTPZsAIz56a8NPvUuJHpMVYwLjc+wPQDFr8fsa/btXr6NBoArF6o0cs3iI6Z/dv/Hfb/3ReyAx04ZdlTwU8GkVwE4xipt+e4kQAWtXAAF2qmCfSgz9miEtqpEj4FaDhyiP4JkqD/P4r8dg81rrMh+mZ4iomRYN6mPyNCutumyopaHxb8y0h7FzMvsz3HpK3dUBJYw/tceYB4x4yOf1xA05zko/v/xObcsjHHVU7w==; 5:EqyYsJcpEVbUW19KYKrPRR9s602YdkrFxlRMbYSBhcasDethBvfw0cAfvRYkQB1j47ulITm5T4+IFvfoXMm/c67K4sfacoStpDl0Q7o7WpdvKcjrbFkIYxVXZvQuAfg9VL6F/W2+7CmgCAKgSFEPEfHKlsSJb/5RKxCc0zatjIo=; 7:F2WY6/j0EW92tAWOaCj2V7pX8VdE1qnfuFsXaH30F1DBzezh1/vmXlZwfSXTNvDS0vbq095OYNAb2JVA3C2f+wACRFzZDGG8VR8X8d9N9lgAYEchtQaBTdsf3U+7O64mnzWkj0bGwjr2RSMAgeqccusLORTZ3pWerYGFPsSDbzeqTv1mpjA4inlw4tTEZ8OBpRB376QwRaYc5t6lsUJbu4QwxiCpahsd7rFQl6Y2GkDfZG911bS2DBaQd6srh8I8 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 05d794ba-38aa-4352-b047-08d5f86989f1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4267; x-ms-traffictypediagnostic: DB7PR05MB4267: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4267; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4267; x-forefront-prvs: 07521929C1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(396003)(366004)(39860400002)(136003)(376002)(346002)(189003)(199004)(8676002)(26005)(14444005)(446003)(6246003)(7736002)(5250100002)(476003)(4326008)(6506007)(74316002)(66066001)(68736007)(99286004)(9686003)(102836004)(486006)(7696005)(76176011)(11346002)(2906002)(54906003)(25786009)(2900100001)(110136005)(305945005)(8936002)(106356001)(81156014)(316002)(256004)(5660300001)(105586002)(6116002)(3846002)(97736004)(86362001)(81166006)(53936002)(229853002)(478600001)(14454004)(33656002)(55016002)(6436002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4267; 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: 6h8d1KSdJnleZ1dsLLCCqGkPsN6ZlaBsxpVdMu8cnzba6KjpoInhmoroNKubFOF0rUsosytY4ALWgzcBs+dnSZjPO57vK1CRwb1PD1LbtgfJYrkoGXAwdwxplxLedQIbpqmirYql03y18XQiBN5zhoVnix7S58tQqU3GTL4RZMffgZmWBV8mRcU5jnsa2FXbLxJ1jPYxzT7EiGe+hA5NTCgGXJS0S78Z+jT3eIzBGO3f7AZumhga9QMFV+xzMNIbOEHeADGXo+5+dH+jUMr5FsUQPfXQkAsh9qUaEven/YSNZiK1dZXSk8zNJ+VvXl6zhMz8DVDiktRTCjJCnSfgn3ewzgxc6UEmWd8PmXaI2Wg= 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: 05d794ba-38aa-4352-b047-08d5f86989f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2018 11:17:31.1084 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4267 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:17:32 -0000 Thursday, August 2, 2018 11:41 AM, Mordechay Haimovsky: > Subject: [PATCH v2] net/mlx5: fix RSS flow configuration crash >=20 > This commit fixes a segmentation fault observed when configuring > mlx5 with RSS flow rule containing invalid queues indices such as negativ= e > numbers, queue numbers bigger than the number Rx queues the PMD or > has no queues at all. >=20 > Fixes: 592f05b29a25 ("net/mlx5: add RSS flow action") > Cc: nelio.laranjeiro@6wind.com >=20 > Signed-off-by: Moti Haimovsky Applied to next-net-mlx, thanks.=20 > --- > v2: > * Modifications according to review by Adrien Mazarguil. > in reply to 1533130807-9183-1-git-send-email-motih@mellanox.com > v1: > * Added check for zero queues. > --- > drivers/net/mlx5/mlx5_flow.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > 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 { >=20 > 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, > +=09 "no queues were provided for This is OK as a temporary fix. We should plan to support better OOB experie= nce by using all the queues instead.=20 > RSS"); > if (rss->queue_num > priv->config.ind_table_max_size) > return rte_flow_error_set(error, ENOTSUP, >=20 > 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