vdpa/mlx5: fix completion queue initialization
authorXueming Li <xuemingl@mellanox.com>
Mon, 27 Jul 2020 14:29:53 +0000 (14:29 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 29 Jul 2020 22:41:23 +0000 (00:41 +0200)
Vdpa device failed to initialize 2nd VQ during setup. From FW syndrome,
unsupported CQE size was specified in CQ initialization attributes.

The unsupported CQE size comes from uninitialized stack struct data, and
the struct has new fields defined recently which are not initialized in
vdpa code.

This patch initializes cq creation attributes with zero to avoid such
random data.

Fixes: 79a7e409a2f6 ("common/mlx5: prepare support of packet pacing")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/vdpa/mlx5/mlx5_vdpa_event.c

index 0414c91..2080d61 100644 (file)
@@ -121,7 +121,7 @@ static int
 mlx5_vdpa_cq_create(struct mlx5_vdpa_priv *priv, uint16_t log_desc_n,
                    int callfd, struct mlx5_vdpa_cq *cq)
 {
-       struct mlx5_devx_cq_attr attr;
+       struct mlx5_devx_cq_attr attr = {0};
        size_t pgsize = sysconf(_SC_PAGESIZE);
        uint32_t umem_size;
        uint16_t event_nums[1] = {0};