From: Ori Kam Date: Mon, 30 Oct 2017 07:32:24 +0000 (+0200) Subject: net/mlx5: fix adding counter when dev not started X-Git-Tag: spdx-start~979 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8a177918c39b6a7f3a167370786dd4e8808debc8;p=dpdk.git 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 --- 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");