PMD driver got random tunnel_en value on ConnextX-4LX NIC, depends on
compile optimization level. The variable was not initialized and
detection logic was absent.

Fixes: 578ff15e ("net/mlx5: add hardware checksum offload for tunnel
packets")

Signed-off-by: Xueming Li <xuemi...@mellanox.com>
Acked-by: Shahaf Shuler <shah...@mellanox.com>
---
 drivers/net/mlx5/mlx5.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index d7968f5..084df88 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -445,7 +445,7 @@ struct mlx5_args {
        struct ibv_device_attr device_attr;
        unsigned int sriov;
        unsigned int mps;
-       unsigned int tunnel_en;
+       unsigned int tunnel_en = 0;
        int idx;
        int i;
 
@@ -503,6 +503,7 @@ struct mlx5_args {
                        mps = MLX5_MPW_DISABLED;
                        break;
                case PCI_DEVICE_ID_MELLANOX_CONNECTX4LX:
+                       tunnel_en = 1;
                        mps = MLX5_MPW;
                        break;
                case PCI_DEVICE_ID_MELLANOX_CONNECTX5:
-- 
1.8.3.1

Reply via email to