[dpdk-dev] [PATCH] net/mlx5: fix pmd crash in device probe

Xueming Li xuemingl at mellanox.com
Tue Jun 12 13:22:24 CEST 2018


This patch initializes counter descriptor struct before invoking Verbs
api to avoid segment fault.

Fixes: 9a761de8ea14 ("net/mlx5: flow counter support")
Cc: orika at mellanox.com

Signed-off-by: Xueming Li <xuemingl at mellanox.com>
---
 drivers/net/mlx5/mlx5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 216753ba6..cf9936ae2 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -708,7 +708,7 @@ mlx5_dev_spawn_one(struct rte_device *dpdk_dev,
 	unsigned int mprq_min_stride_num_n = 0;
 	unsigned int mprq_max_stride_num_n = 0;
 #ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
-	struct ibv_counter_set_description cs_desc;
+	struct ibv_counter_set_description cs_desc = { .counter_type = 0 };
 #endif
 	struct ether_addr mac;
 	char name[RTE_ETH_NAME_MAX_LEN];
-- 
2.13.3



More information about the dev mailing list