net/mlx5: fix tunneling support query
authorTal Shnaiderman <talshn@nvidia.com>
Tue, 12 Oct 2021 12:45:45 +0000 (15:45 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Tue, 12 Oct 2021 13:29:34 +0000 (15:29 +0200)
commitc1a320bf899e5ff8d3e3a4f291ee61c8a98a8bda
tree6af476380bf2a8a7c8c22e2e406d339386dd6910
parentd47fe9dabc081b9cd7302172b6d9f252abf9f34e
net/mlx5: fix tunneling support query

Currently, the PMD decides if the tunneling offload
can enable VXLAN/GRE/GENEVE tunneled TSO support by checking
config->tunnel_en (single bit) and config->tso.

This is incorrect, the right way is to check the following
flags returned by the mlx5dv_query_device function:

MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN - if supported the offload
DEV_TX_OFFLOAD_VXLAN_TNL_TSO can be enabled.
MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE - if supported the offload
DEV_TX_OFFLOAD_GRE_TNL_TSO can be enabled.
MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GENEVE - if supported the offload
DEV_TX_OFFLOAD_GENEVE_TNL_TSO can be enabled.

The fix enables the offloads according to the correct
flags returned by the kernel.

Fixes: dbccb4cddcd2 ("net/mlx5: convert to new Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
drivers/net/mlx5/linux/mlx5_os.c
drivers/net/mlx5/linux/mlx5_os.h
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_txq.c
drivers/net/mlx5/windows/mlx5_os.h