1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright 2021 6WIND S.A. 3 * Copyright 2021 Mellanox Technologies, Ltd 4 */ 5 6 #ifndef RTE_PMD_MLX5_COMMON_DEFS_H_ 7 #define RTE_PMD_MLX5_COMMON_DEFS_H_ 8 9 #include "mlx5_autoconf.h" 10 11 /* Size of per-queue MR cache array for linear search. */ 12 #define MLX5_MR_CACHE_N 8 13 14 /* Size of MR cache table for binary search. */ 15 #define MLX5_MR_BTREE_CACHE_N 256 16 17 /* 18 * Defines the amount of retries to allocate the first UAR in the page. 19 * OFED 5.0.x and Upstream rdma_core before v29 returned the NULL as 20 * UAR base address if UAR was not the first object in the UAR page. 21 * It caused the PMD failure and we should try to get another UAR 22 * till we get the first one with non-NULL base address returned. 23 */ 24 #define MLX5_ALLOC_UAR_RETRY 32 25 26 /* Environment variable to control the doorbell register mapping. */ 27 #define MLX5_SHUT_UP_BF "MLX5_SHUT_UP_BF" 28 #if defined(RTE_ARCH_ARM64) 29 #define MLX5_SHUT_UP_BF_DEFAULT "0" 30 #else 31 #define MLX5_SHUT_UP_BF_DEFAULT "1" 32 #endif 33 34 /* Default PMD specific parameter value. */ 35 #define MLX5_ARG_UNSET (-1) 36 37 /* MLX5_SQ_DB_NC supported values. */ 38 #define MLX5_SQ_DB_CACHED 0 39 #define MLX5_SQ_DB_NCACHED 1 40 #define MLX5_SQ_DB_HEURISTIC 2 41 42 /* Fields of memory mapping type in offset parameter of mmap() */ 43 #define MLX5_UAR_MMAP_CMD_SHIFT 8 44 #define MLX5_UAR_MMAP_CMD_MASK 0xff 45 46 #ifndef HAVE_MLX5DV_MMAP_GET_NC_PAGES_CMD 47 #define MLX5_MMAP_GET_NC_PAGES_CMD 3 48 #endif 49 50 #define MLX5_VDPA_MAX_RETRIES 20 51 #define MLX5_VDPA_USEC 1000 52 53 #endif /* RTE_PMD_MLX5_COMMON_DEFS_H_ */ 54