common/mlx5: wrap memory allocation on Linux
[dpdk.git] / drivers / common / mlx5 / mlx5_devx_cmds.h
index 553b26c..726e9f5 100644 (file)
@@ -8,6 +8,14 @@
 #include "mlx5_glue.h"
 #include "mlx5_prm.h"
 
+/*
+ * Defines the amount of retries to allocate the first UAR in the page.
+ * OFED 5.0.x and Upstream rdma_core before v29 returned the NULL as
+ * UAR base address if UAR was not the first object in the UAR page.
+ * It caused the PMD failure and we should try to get another UAR
+ * till we get the first one with non-NULL base address returned.
+ */
+#define MLX5_ALLOC_UAR_RETRY 32
 
 /* This is limitation of libibverbs: in length variable type is u16. */
 #define MLX5_DEVX_MAX_KLM_ENTRIES ((UINT16_MAX - \
@@ -20,7 +28,8 @@ struct mlx5_devx_mkey_attr {
        uint32_t pd;
        uint32_t log_entity_size;
        uint32_t pg_access:1;
-       uint32_t relaxed_ordering:1;
+       uint32_t relaxed_ordering_write:1;
+       uint32_t relaxed_ordering_read:1;
        struct mlx5_klm *klm_array;
        int klm_num;
 };