From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70074.outbound.protection.outlook.com [40.107.7.74]) by dpdk.org (Postfix) with ESMTP id AB01D235 for ; Mon, 23 Jul 2018 20:27:59 +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=6IeKuSXNRa69/0DI1DD1cezhRJ362bByN6/QMYDXjnM=; b=SPF2PAFoTaVhAeLWGHGC7m9O/YBodS7EyWd018nlIa6iBXRvHb4NRyNmIdYVRVcpRMsOf3bqcQeesA3sJrGGcHS5sv66I0GMDWZF0cmequKJi0LlGQLziAC1SMM75CXtaV+oFCvz4+cmsHxgrpoJsfQCMcSAKniF4f1dFQYOUBs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by DB6PR0501MB2037.eurprd05.prod.outlook.com (2603:10a6:4:6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Mon, 23 Jul 2018 18:27:56 +0000 From: Yongseok Koh To: shahafs@mellanox.com Cc: dev@dpdk.org, Yongseok Koh , Nelio Laranjeiro Date: Mon, 23 Jul 2018 11:27:44 -0700 Message-Id: <20180723182744.1179-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BN6PR2001CA0025.namprd20.prod.outlook.com (2603:10b6:405:16::11) To DB6PR0501MB2037.eurprd05.prod.outlook.com (2603:10a6:4:6::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9676ccbb-1d02-4db7-2996-08d5f0ca0389 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2037; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2037; 3:EQ3mfnZeZbTBBp/WIyKHb1NxTsQOhbjBAtugd4e3qKMhTDzWERQynwD1ndA2sVpwA0GB286TXrHEok/Zme6X7jwntPs6ikmSFa40l+8qKoJ23Ip1NIuynbB04Bw1dQGGfLFXjbuVpPUwqH6SMqoV+IBEn4KdBdW2YBFHkNn1dUyy1r8zfl1LoBI+e+gnjLUEggFTSmfTOKyf4KuTtwIS07Rkdmhz0FDGzvSGz9/LyIgvG9jo7SLpR5WNrw+Qgc4W; 25:jkMP4WvDX5ecbZT2+Rn0/68qMq7tBuHCdp7QVYvYBhEGJiEbktSWOSFoOldvVc58nvYju9PThF0bekOLsw9mWfVnMQEKeQffpQdCO+AgXGGTbHHORLTF3SDdNLmgjPpvcwMn/DBioZsYDAIp6e1OVMQHVaDWchKrB0swTW2MzC7tdiXucstR6XN74brVUnx8cza/kUx3SOJskf0cTZI3gVf3m+NogKq5mXm69eqMEKu5Kr4H4mvPiq4qOMVa59bCxBobgwiZiiCexHQGJNpMl7/pz+7bOBU59jIM/YMSH6Ai9g942YpdRALNrzJ2BwLVFdlN3rhb7YUrqI0geN3VKg==; 31:mZlHaB89M4HXimOEi4q7miDbW4jTFZ3D9Lsl57PxwPHpMqjPm31HbMLddinlgTcScpa8Nssu5E/v6gzZDvZlkCgyWhjae6e1ljLh5K8VmTDPy5iKHFfrXCZ9gl6Qbn5aUQ06m1Y8Uy7/UQPlFUkTItb1taJ1N07rLeObI/edhJhJfTpOjFNNryPJGZki1aS0AQ2xDj8CmmSWHvsFf8kn3TnjEfs+2eeiErz7va0aVhk= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2037: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2037; 20:4Eghiwd3eAr2DAzwJjK2VlH4H8Rts24hOYxDIzPFFxig3hhbGl3gnew7+amFS/9bXsO4U/JiPObc5oKbEYDy00MSRYNLGbEaF+OeByyVi8257kiZlEK7Spb9XrFLIMHLdmfi3OrC0K1hUJDaDVT6FfiNKx9RhIVT1mUMQL44c0BPQw00ShNF05TQeH0Bsh0+/glB6cor/TJtZwdAZi74+H5miqtrwJSioT6M8gD+E18U1hWywzcHP/1lC+0l4KSf1QBR3ClpndrshxeaakHfmdQSdiLu+Pdl5qq8HZCAOVC62oV57EntYvbizFs9BZIkLM7ITkl+IlkQ5sGQFeVds0SOnJuB0yWXmtpBfuNlE3WdqkSxrJE34gcnA1slQyOW/6jZ9spJdKZlm2JuBH7nnAT9kxmXfifmLxXSFmaF3TMDT9qZ8FYhPihOHO0WroXoM/T1TA/CsyBo3j2V9xY6GNwO15ACUtjfIrQ2lAarFFh9JQFIABNv83mky7ESLcIr; 4:49mwzb0f3Di6TdM6rSh917iBqMXoYXYUrJhFudCtqMDLIIgLtfH9Yai2ub/aTJpdhZAK5nVsSUhh9KKfUuPUjDCCZr7m4XDj9ZqADz3IfkKkEL72lKE00F7Hnf1YKEEZ4xwLR+yNtOfbSQ+zq4X+7463A67qSuSvBAWz8K/7KuZN0xhQFD7znm+SSS4sjCsmnuEVXNMsKfZsN5CGpJ/+yAOMBIdz1qwlqp4AtnKsaDf26yaVZpqt4qcHZfZ9BZeZRTxWu8PNNYVyZCUzbmQtYQ== 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)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DB6PR0501MB2037; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2037; X-Forefront-PRVS: 0742443479 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(366004)(376002)(346002)(396003)(189003)(199004)(36756003)(66066001)(7736002)(1076002)(50226002)(2351001)(6116002)(2906002)(3846002)(2361001)(8676002)(476003)(86362001)(486006)(956004)(47776003)(25786009)(5660300001)(2616005)(478600001)(16526019)(6636002)(305945005)(53936002)(16586007)(316002)(81166006)(81156014)(69596002)(68736007)(1857600001)(54906003)(26005)(6666003)(50466002)(37006003)(386003)(21086003)(106356001)(97736004)(55016002)(105586002)(8936002)(34206002)(4326008)(7696005)(48376002)(52116002)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2037; H:mellanox.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-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2037; 23:NkLmzp7h9Rt4jGHWw3z8cBx+XpEACriJwnhqAvJ?= =?us-ascii?Q?lhwqrxPHqSGT0eTk+2cwdQ98eMnp244bafJkWzmQm2j8uWC4iLr+GsNKVVX7?= =?us-ascii?Q?5x61w6nYCPV0bNUtJ8Y0Rqbj9XiKuKZWfzkxvYdSZSVN+jXiL63VoPrve7OS?= =?us-ascii?Q?lWdZiBwfIu58RukaU2ZtqVKN2mP1xlNovZo4pxSjMf2CEjg/2pvV8XUf/tN/?= =?us-ascii?Q?z9wJEfUoFDAGBpZyKAMjqM0oLFqoNmkRJictmR0EtKLJrCzeQnlf0r5dT0wL?= =?us-ascii?Q?+8xfR6gxar92z4IsV37huXc8+r8b5viQre3gxYMSXPkiwQS1ih5wiLh3MInw?= =?us-ascii?Q?xK7HERmUPmWZm9f+RPVvPdmiuzzI51iNzww0cF7FQ4XMODJFdIv7kLNKlj0X?= =?us-ascii?Q?sidE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G/tIFekXgI+AkHaOAfAcC3cIm/YGXFCGG0NzMydB3KhM02Z0umqobilZ/nMFfd9sYhGyBJjRk4Bo71oEvkje5IqhYW4JMKQmnfPt8rRXLDzILsiWPkhjkt1dQp31Db24s6VCUPPfrKRNlxIAFaQg3RFhAagk0gff1I0uG+dtbJ9EGMkibfh2CYfFyEEDDg+rqaBghLugP1X/vpmVe+b1QbkPwVW7GvZcnWLlZmC9rvvHFoxOLARmhkT1S SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2018 18:27:56.6017 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9676ccbb-1d02-4db7-2996-08d5f0ca0389 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2037 Subject: [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: Mon, 23 Jul 2018 18:28:00 -0000 If one of (*priv->rxqs)[] is null, the for loop can iterate infinitely as idx can't be increased. Fixes: cd24d526395e ("net/mlx5: add mark/flag flow action") Cc: Nelio Laranjeiro Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 = dev->data->dev_private; unsigned int i; - unsigned int idx; - for (idx = 0, i = 0; idx != priv->rxqs_n; ++i) { + for (i = 0; i != priv->rxqs_n; ++i) { struct mlx5_rxq_ctrl *rxq_ctrl; unsigned int j; - if (!(*priv->rxqs)[idx]) + if (!(*priv->rxqs)[i]) continue; - rxq_ctrl = container_of((*priv->rxqs)[idx], + rxq_ctrl = container_of((*priv->rxqs)[i], struct mlx5_rxq_ctrl, rxq); rxq_ctrl->flow_mark_n = 0; rxq_ctrl->rxq.mark = 0; for (j = 0; j != MLX5_FLOW_TUNNEL; ++j) rxq_ctrl->flow_tunnels_n[j] = 0; rxq_ctrl->rxq.tunnel = 0; - ++idx; } } -- 2.11.0