summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_flow.c
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2018-07-23 11:27:44 -0700
committerThomas Monjalon <thomas@monjalon.net>2018-07-26 14:05:52 +0200
commitc20d4a70caa5c64520addae5f2e867f911b3aa18 (patch)
treed1beb0eec7f8ef9fa88f8195a980de53baf9623d /drivers/net/mlx5/mlx5_flow.c
parent5366074b019aaf1a27eb5912b928496e871f73c4 (diff)
downloaddpdk-next-eventdev-c20d4a70caa5c64520addae5f2e867f911b3aa18.zip
dpdk-next-eventdev-c20d4a70caa5c64520addae5f2e867f911b3aa18.tar.gz
dpdk-next-eventdev-c20d4a70caa5c64520addae5f2e867f911b3aa18.tar.xz
net/mlx5: fix endless loop when clearing flow flags
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") Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Ori Kam <orika@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_flow.c')
-rw-r--r--drivers/net/mlx5/mlx5_flow.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 3285419..c156f01 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;
}
}