From: Xueming Li Date: Mon, 4 Sep 2017 11:43:51 +0000 (+0800) Subject: net/mlx5: fix tunnel offload detection X-Git-Tag: spdx-start~2002 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=772d34356d72af2f5a3d483c83afb00d4cb4ae03;p=dpdk.git net/mlx5: fix tunnel offload detection 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: f5fde5205101 ("net/mlx5: add hardware checksum offload for tunnel packets") Cc: stable@dpdk.org Signed-off-by: Xueming Li Acked-by: Shahaf Shuler Acked-by: Nelio Laranjeiro --- diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index d7968f54cf..084df8832c 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -445,7 +445,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) 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 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) mps = MLX5_MPW_DISABLED; break; case PCI_DEVICE_ID_MELLANOX_CONNECTX4LX: + tunnel_en = 1; mps = MLX5_MPW; break; case PCI_DEVICE_ID_MELLANOX_CONNECTX5: