[v1] net/mlx5: fix pmd crash in device probe

Message ID 20180612113811.8543-1-xuemingl@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Shahaf Shuler
Headers
Series [v1] net/mlx5: fix pmd crash in device probe |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xueming Li June 12, 2018, 11:38 a.m. UTC
  This patch initializes counter descriptor struct before invoking Verbs
api to avoid segment fault.

Fixes: 9a761de8ea14 ("net/mlx5: flow counter support")
Cc: orika@mellanox.com
Cc: stable@dpdk.org

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

Comments

Adrien Mazarguil June 13, 2018, 2:17 p.m. UTC | #1
On Tue, Jun 12, 2018 at 07:38:11PM +0800, Xueming Li wrote:
> This patch initializes counter descriptor struct before invoking Verbs
> api to avoid segment fault.
> 
> Fixes: 9a761de8ea14 ("net/mlx5: flow counter support")
> Cc: orika@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
  
Shahaf Shuler June 17, 2018, 8:05 a.m. UTC | #2
Wednesday, June 13, 2018 5:18 PM, Adrien Mazarguil:
> Subject: Re: [PATCH v1] net/mlx5: fix pmd crash in device probe
> 
> On Tue, Jun 12, 2018 at 07:38:11PM +0800, Xueming Li wrote:
> > This patch initializes counter descriptor struct before invoking Verbs
> > api to avoid segment fault.
> >
> > Fixes: 9a761de8ea14 ("net/mlx5: flow counter support")
> > Cc: orika@mellanox.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to next-net-mlx, thanks. 

> 
> --
> Adrien Mazarguil
> 6WIND
  

Patch

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index c933e274f..9ab965968 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -706,7 +706,7 @@  mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	int i;
 	struct mlx5dv_context attrs_out = {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
 
 	/* Prepare shared data between primary and secondary process. */