From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20063.outbound.protection.outlook.com [40.107.2.63]) by dpdk.org (Postfix) with ESMTP id 558C3235 for ; Tue, 24 Jul 2018 07:50:11 +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=dOBMcXRJKN1viuEzm94mNK2dk2l+EpNYQQ9OTz0TaUM=; b=NkAztshXUbotKhWbN7lPkHe5JnAQvlRj6gwgBmP8Dxq7dchAd5ubTOMgd4JE+ij0M2L7sKiXhEaZBkmfYLwsAM3c2iCdE3nY2HCQVZBCeiJtxhQJxTPHSm5hUpUVe+78jwR6DeIm77mqp/SfEYcwkO6zwNtAm+LVAmBrBIar0RQ= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB3473.eurprd05.prod.outlook.com (10.171.187.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Tue, 24 Jul 2018 05:50:09 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::6d55:c970:605a:4106]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::6d55:c970:605a:4106%4]) with mapi id 15.20.0973.022; Tue, 24 Jul 2018 05:50:09 +0000 From: Ori Kam To: Yongseok Koh , Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix possible endless loop when clearing flow flags Thread-Index: AQHUIrLnUxOECIzLrUaOo6eqxJAfraSd3tQg Date: Tue, 24 Jul 2018 05:50:08 +0000 Message-ID: References: <20180723182744.1179-1-yskoh@mellanox.com> In-Reply-To: <20180723182744.1179-1-yskoh@mellanox.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=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3473; 6:YAQIsVnfqa3wTL+3mKaxDCpyo/+i+rgE1ESIO0ynT5UqhZt4qUTGn6iv/GmDAl06FiffOJIoZMO/Dc+QSYfLpgR86XWdnqT3Q+4PgKu3qFHj25qCBNFCIooH2rDcLWDKQif1qx5OIOXm6qfPss7H5mRC/Sr2lpV9URPpT6KP7rbzV8ydN77nbcIPAeoL8th0y6NaG+g2N7HNPdfmJQPA1NY3xHanBkn7UvZzzjUrNYtCI2fD50k7FSUkOPH7xH3ncYXyjfWEJ8/cYIN1Mx8khcsx6OG1h+4okx5EU48LPSlo5Mtvu7m75QA6PjnTtrA40Fx+oFx4uud5TEY11MJPHL7WvgPwkWb2XmpROOBQZxCLiCT/HYZGFRJjNw9cmda8HYc/eqgr22m+cNSsCBoKpRtuBDAtyV/pIDdKvAKDr0YtMZ0GLSWGug2Q2HDHQkvIcoqnLfkR1pHGMXpASXXSAA==; 5:CU/mEs3oQ1WJxeGIV65Rt2VCJ0CPe6RaLSvRLvpJ4h4kPLb6uQ4TnQ0HtEyP7qfiTaVFcvVnfvyXF1UMACD5fPcXCrMwzAbcvk5jjDuZI9mnRs1T2Hxt9vrZV5J22FlKHNCpAfqgSyk7aOr95VgDuXd6dZ6imlL6KyyaNr+6xDg=; 7:aLm2ajXB6pj2nYakKkoGtmHGEI6W8bYam/Z1H+fpzEr65RL+NhWTZdsj7fp34fNbvl3enazAUeXH4qYLAEQ2Gu2qqkfOE2b8CsS4Mzs4Wn2PdEItYNixOvEfviFjRxf/KHOzjoB+oTHwMlL7uKtd/pks1c69wYm2eWG+edkLACM9CCtnxPrtUPvcvEKbZJBzYcC9FQ7VOlcOZgyabGXDR8iD2Gujw6LXoBZa0hdkF7T9PymWNlshkYkmsQEDPHp9 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 27c1ed90-672b-4352-2a21-08d5f129508b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3473; x-ms-traffictypediagnostic: AM4PR05MB3473: 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:AM4PR05MB3473; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3473; x-forefront-prvs: 0743E8D0A6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(136003)(396003)(346002)(376002)(199004)(189003)(13464003)(76176011)(106356001)(97736004)(105586002)(11346002)(446003)(26005)(7696005)(102836004)(6506007)(66066001)(5250100002)(6436002)(256004)(8936002)(68736007)(55016002)(53546011)(2900100001)(305945005)(110136005)(74316002)(316002)(54906003)(6116002)(3846002)(99286004)(2906002)(229853002)(7736002)(81156014)(81166006)(86362001)(9686003)(25786009)(53936002)(6636002)(476003)(6246003)(4326008)(478600001)(5660300001)(486006)(33656002)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3473; H:AM4PR05MB3425.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-microsoft-antispam-message-info: Qzm5QUUZYDCfbX8FSGFen1ot57vL68baX2u8ExWqSAB7AI0hLmSfL4GwZ1f0gTvyQ6kQRSzR+UJYgr+xbSCYy2B30OdugCUIsMTV/TNqVU9STeFBKQi6O/pGBF5BMg4RPLLS3Z3UreehqyRGmsx5EeWpSFs3xkt4w/IRk8TM63Dj+XcN1LPgKk3hZt0eIGeb6rEq3Jmun6o/v9JC9ADeanlaFRMZx63xwxyZL+b54nm6o6XIdIoUXuuspD5Ab3Y6ZS/u5kyQvxLQolZ/uw/rL/VEF0vRbakcqak242fXXajjwBhHaGovLuP7rHAuixh8Hk9MYnyLUlGApHu9JKPpQSVWL55h1zeIVuKlM2Igvtk= 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: 27c1ed90-672b-4352-2a21-08d5f129508b X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2018 05:50:08.9643 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3473 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix possible endless loop when clearing flow flags 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: Tue, 24 Jul 2018 05:50:11 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yongseok Koh > Sent: Monday, July 23, 2018 9:28 PM > To: Shahaf Shuler > Cc: dev@dpdk.org; Yongseok Koh ; N=E9lio Laranjeiro > > Subject: [dpdk-dev] [PATCH] net/mlx5: fix possible endless loop when > clearing flow flags >=20 > If one of (*priv->rxqs)[] is null, the for loop can iterate infinitely as > idx can't be increased. >=20 > Fixes: cd24d526395e ("net/mlx5: add mark/flag flow action") > Cc: Nelio Laranjeiro >=20 > Signed-off-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5_flow.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 32854198b..c156f01eb 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -2762,22 +2762,20 @@ mlx5_flow_rxq_flags_clear(struct rte_eth_dev > *dev) > { > struct priv *priv =3D dev->data->dev_private; > unsigned int i; > - unsigned int idx; >=20 > - for (idx =3D 0, i =3D 0; idx !=3D priv->rxqs_n; ++i) { > + for (i =3D 0; i !=3D priv->rxqs_n; ++i) { > struct mlx5_rxq_ctrl *rxq_ctrl; > unsigned int j; >=20 > - if (!(*priv->rxqs)[idx]) > + if (!(*priv->rxqs)[i]) > continue; > - rxq_ctrl =3D container_of((*priv->rxqs)[idx], > + rxq_ctrl =3D container_of((*priv->rxqs)[i], > struct mlx5_rxq_ctrl, rxq); > rxq_ctrl->flow_mark_n =3D 0; > rxq_ctrl->rxq.mark =3D 0; > for (j =3D 0; j !=3D MLX5_FLOW_TUNNEL; ++j) > rxq_ctrl->flow_tunnels_n[j] =3D 0; > rxq_ctrl->rxq.tunnel =3D 0; > - ++idx; > } > } >=20 Acked-by: Ori Kam > -- > 2.11.0