From 8a177918c39b6a7f3a167370786dd4e8808debc8 Mon Sep 17 00:00:00 2001 From: Ori Kam Date: Mon, 30 Oct 2017 09:32:24 +0200 Subject: [PATCH] net/mlx5: fix adding counter when dev not started When adding count action to a drop flow rule while the device was not started, the counter was not saved in the flow. Fixes: 9a761de8ea14 ("net/mlx5: flow counter support") Signed-off-by: Ori Kam Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 1ea9d685fe..29c8e89ac8 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1700,13 +1700,13 @@ priv_flow_create_action_queue_drop(struct priv *priv, ++parser->drop_q.ibv_attr->num_of_specs; parser->drop_q.offset += size; flow->drxq.ibv_attr = parser->drop_q.ibv_attr; + if (parser->count) + flow->cs = parser->cs; if (!priv->dev->data->dev_started) return 0; parser->drop_q.ibv_attr = NULL; flow->drxq.ibv_flow = ibv_create_flow(priv->flow_drop_queue->qp, flow->drxq.ibv_attr); - if (parser->count) - flow->cs = parser->cs; if (!flow->drxq.ibv_flow) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "flow rule creation failure"); -- 2.20.1