numam-dpdk/drivers/net/mlx5/linux/mlx5_os.h
Tal Shnaiderman c1a320bf89 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: dbccb4cddc ("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>
2021-10-12 15:29:34 +02:00

52 lines
1.3 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2015 6WIND S.A.
* Copyright 2020 Mellanox Technologies, Ltd
*/
#ifndef RTE_PMD_MLX5_OS_H_
#define RTE_PMD_MLX5_OS_H_
#include <net/if.h>
/* verb enumerations translations to local enums. */
enum {
MLX5_FS_NAME_MAX = IBV_SYSFS_NAME_MAX + 1,
MLX5_FS_PATH_MAX = IBV_SYSFS_PATH_MAX + 1
};
/* Maximal data of sendmsg message(in bytes). */
#define MLX5_SENDMSG_MAX 64
#define MLX5_NAMESIZE IF_NAMESIZE
int mlx5_auxiliary_get_ifindex(const char *sf_name);
enum mlx5_sw_parsing_offloads {
#ifdef HAVE_IBV_MLX5_MOD_SWP
MLX5_SW_PARSING_CAP = MLX5DV_SW_PARSING,
MLX5_SW_PARSING_CSUM_CAP = MLX5DV_SW_PARSING_CSUM,
MLX5_SW_PARSING_TSO_CAP = MLX5DV_SW_PARSING_LSO,
#else
MLX5_SW_PARSING_CAP = 0,
MLX5_SW_PARSING_CSUM_CAP = 0,
MLX5_SW_PARSING_TSO_CAP = 0,
#endif
};
enum mlx5_tunnel_offloads {
#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
MLX5_TUNNELED_OFFLOADS_VXLAN_CAP =
MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN,
MLX5_TUNNELED_OFFLOADS_GRE_CAP =
MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE,
MLX5_TUNNELED_OFFLOADS_GENEVE_CAP =
MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GENEVE,
#else
MLX5_TUNNELED_OFFLOADS_VXLAN_CAP = 0,
MLX5_TUNNELED_OFFLOADS_GRE_CAP = 0,
MLX5_TUNNELED_OFFLOADS_GENEVE_CAP = 0,
#endif
};
#endif /* RTE_PMD_MLX5_OS_H_ */