From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0077.outbound.protection.outlook.com [104.47.0.77]) by dpdk.org (Postfix) with ESMTP id 7A84C288C; Sun, 25 Feb 2018 00:18:55 +0100 (CET) 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; bh=UwnCXxE0XGUimjCwqtfPa8BXVzKTnsk/9s6SOKpUuU0=; b=KzH9HKPp5dUKalywUo9SpcZ+8qfIPzzDpMrsy4mak+RR+nWGd9qsWjLmAzS7l9uvs1pXBgITQbo4rCj38KFAjH6K0xkN83zBL1uncHU03pVgQmKy1GOOTNLSMGxd8QHDVcmLin0swl7g+x6BFp/t1oVn2Bi1Rs03fS9pHfpAfKg= Received: from AM0PR0502MB3875.eurprd05.prod.outlook.com (52.133.48.17) by AM0PR0502MB3873.eurprd05.prod.outlook.com (52.133.48.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Sat, 24 Feb 2018 23:18:54 +0000 Received: from AM0PR0502MB3875.eurprd05.prod.outlook.com ([fe80::c146:f27f:8151:5631]) by AM0PR0502MB3875.eurprd05.prod.outlook.com ([fe80::c146:f27f:8151:5631%13]) with mapi id 15.20.0527.021; Sat, 24 Feb 2018 23:18:54 +0000 From: Ophir Munk To: Adrien Mazarguil CC: "dev@dpdk.org" , Thomas Monjalon , "Olga Shern" , "stable@dpdk.org" Thread-Topic: [PATCH v1] net/mlx4: fix RSS actions with no parameters Thread-Index: AQHTqxlt4A9rt/a7s0ifCqOGLUPP+KOyNzqAgAH3vyA= Date: Sat, 24 Feb 2018 23:18:54 +0000 Message-ID: References: <1519220318-19328-1-git-send-email-ophirmu@mellanox.com> <20180223165239.GL4256@6wind.com> In-Reply-To: <20180223165239.GL4256@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=ophirmu@mellanox.com; x-originating-ip: [217.132.112.161] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0502MB3873; 7:Bh/6jUONAxHYwaAPTnoKf7gCeDslaS2IDgKlmyDgjMezIVrhnR+FGMI04W+J4sg07dHSRQJINczVbk5LJ+OY9aupml5K/kJrLPR+YOA1zU4yPemOLfwOKNNqXdCl4L5Hp/g1OGSuo3Fb1a8ZAyYfLYNMh6M4HJNjhF/3v4ePoeW8n4BODrQSiJGd5IC8eVjBcLK+G7N92OzeBCC865pGuMqCrN08pdttsk250FtbiROX6qPLPbRWK92kD2opjarn x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: e57e0afc-0c2a-48d9-85a2-08d57bdcf8f6 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM0PR0502MB3873; x-ms-traffictypediagnostic: AM0PR0502MB3873: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501161)(52105095)(6055026)(6041288)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM0PR0502MB3873; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0502MB3873; x-forefront-prvs: 0593E261C4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(376002)(39860400002)(366004)(346002)(13464003)(189003)(199004)(106356001)(7696005)(99286004)(5250100002)(6916009)(102836004)(229853002)(14454004)(2950100002)(316002)(8676002)(81156014)(81166006)(76176011)(8936002)(5660300001)(26005)(186003)(59450400001)(6506007)(7736002)(53546011)(305945005)(6116002)(3846002)(2906002)(3280700002)(74316002)(53936002)(6246003)(55016002)(9686003)(25786009)(39060400002)(105586002)(4326008)(54906003)(6436002)(2900100001)(68736007)(3660700001)(478600001)(66066001)(86362001)(33656002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3873; H:AM0PR0502MB3875.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: y3CWynzhF441VnQQJNgR89xDqP71WL2kW+femBqM1hZfWbO2SDFzyz5X+3OzdrpDT1VteBH0E+LLd9E0zjOWlqIHzobKp3A8FvxAaew/fTc1f6xbB+7/bgYY4LQ4aA1KZBXHQ4z/k5+zmvYVsPU4/PJ7FEQ0vxOvoAhBeJRaZu0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: e57e0afc-0c2a-48d9-85a2-08d57bdcf8f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Feb 2018 23:18:54.1157 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3873 Subject: Re: [dpdk-stable] [PATCH v1] net/mlx4: fix RSS actions with no parameters 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: , X-List-Received-Date: Sat, 24 Feb 2018 23:18:55 -0000 Hi, Please see below > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Friday, February 23, 2018 6:53 PM > To: Ophir Munk > Cc: dev@dpdk.org; Thomas Monjalon ; Olga Shern > ; stable@dpdk.org > Subject: Re: [PATCH v1] net/mlx4: fix RSS actions with no parameters >=20 > On Wed, Feb 21, 2018 at 01:38:38PM +0000, Ophir Munk wrote: > > When creating an RSS flow with missing actions parameters, for example: > > flow create 0 ingress pattern / end actions rss / > > end > > > > testpmd aborts with segmentation fault. > > In the corrupted code mlx4_flow_prepare() accesses RSS action->conf > > pointer without verifying its validity. > > In case of missing RSS actions parameters this pointer is NULL and > > must not be accessed. >=20 > Problem is that testpmd is far from perfect and shouldn't feed PMDs with > invalid pointers in the first place. The configuration structure is not > documented as optional with actions that take one. >=20 > > The fix is to return an error in such cases "missing rss actions". > > > > Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support") > > Cc: stable@dpdk.org > > > > Signed-off-by: Ophir Munk >=20 > I suggest to fix this at once for all present and future PMDs in testpmd > directly. It may be added as a workaround in mlx4 but not as a fix since = the > cause is not in that PMD. >=20 I am not sure if missing rss queues in testpmd is not by design. For exampl= e a PMD can theoretically interpreted it as an rss default action to split traffic over all existing = device queues, or giving it any other meaning. The lack of rss queues should be left to the interpretation of the PMD.=20 For example: * ixgbe PMD seems to handle an NULL rss configuration pointer in its own wa= y * mlx5 PMD checks for this and return an error in such a case Changes to testpmd will have to be coordinated and accepted by all dpdk PMD= s. > > --- > > drivers/net/mlx4/mlx4_flow.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/net/mlx4/mlx4_flow.c > > b/drivers/net/mlx4/mlx4_flow.c index 2d55bfe..7a127a8 100644 > > --- a/drivers/net/mlx4/mlx4_flow.c > > +++ b/drivers/net/mlx4/mlx4_flow.c > > @@ -735,6 +735,10 @@ mlx4_flow_prepare(struct priv *priv, > > if (flow->rss) > > break; > > rss =3D action->conf; > > + if (!rss) { > > + msg =3D "missing rss actions"; > > + goto exit_action_not_supported; > > + } >=20 > This message may be understood as a lack of RSS action, while it is in fa= ct > present. This error can be more accurately described as: >=20 > "RSS action configuration wasn't provided" >=20 mlx5 PMD printout for missing rss queues is: "no valid queues" I suggest that both mlx4 and mlx5 print the same error for the same rss flo= w w/o queues. Do you confirm using mlx5 message printed above? > Note the same issue exists with the QUEUE action handled just prior to th= is > one and probably affects other PMDs as well. You really should consider > fixing testpmd instead. >=20 > -- > Adrien Mazarguil > 6WIND