xref: /dpdk/drivers/net/mlx5/linux/mlx5_os.h (revision c1a320bf899e5ff8d3e3a4f291ee61c8a98a8bda)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2015 6WIND S.A.
3  * Copyright 2020 Mellanox Technologies, Ltd
4  */
5 
6 #ifndef RTE_PMD_MLX5_OS_H_
7 #define RTE_PMD_MLX5_OS_H_
8 
9 #include <net/if.h>
10 
11 /* verb enumerations translations to local enums. */
12 enum {
13 	MLX5_FS_NAME_MAX = IBV_SYSFS_NAME_MAX + 1,
14 	MLX5_FS_PATH_MAX = IBV_SYSFS_PATH_MAX + 1
15 };
16 
17 /* Maximal data of sendmsg message(in bytes). */
18 #define MLX5_SENDMSG_MAX 64
19 
20 #define MLX5_NAMESIZE IF_NAMESIZE
21 
22 int mlx5_auxiliary_get_ifindex(const char *sf_name);
23 
24 
25 enum mlx5_sw_parsing_offloads {
26 #ifdef HAVE_IBV_MLX5_MOD_SWP
27 	MLX5_SW_PARSING_CAP      = MLX5DV_SW_PARSING,
28 	MLX5_SW_PARSING_CSUM_CAP = MLX5DV_SW_PARSING_CSUM,
29 	MLX5_SW_PARSING_TSO_CAP  = MLX5DV_SW_PARSING_LSO,
30 #else
31 	MLX5_SW_PARSING_CAP      = 0,
32 	MLX5_SW_PARSING_CSUM_CAP = 0,
33 	MLX5_SW_PARSING_TSO_CAP  = 0,
34 #endif
35 };
36 
37 enum mlx5_tunnel_offloads {
38 #ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
39 	MLX5_TUNNELED_OFFLOADS_VXLAN_CAP  =
40 		MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN,
41 	MLX5_TUNNELED_OFFLOADS_GRE_CAP    =
42 		MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE,
43 	MLX5_TUNNELED_OFFLOADS_GENEVE_CAP =
44 		MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GENEVE,
45 #else
46 	MLX5_TUNNELED_OFFLOADS_VXLAN_CAP  = 0,
47 	MLX5_TUNNELED_OFFLOADS_GRE_CAP	  = 0,
48 	MLX5_TUNNELED_OFFLOADS_GENEVE_CAP = 0,
49 #endif
50 };
51 #endif /* RTE_PMD_MLX5_OS_H_ */
52