net/mlx5: support fine grain dynamic flag
[dpdk.git] / drivers / net / mlx5 / mlx5.c
index 3b8de8f..e5fc1d3 100644 (file)
@@ -48,6 +48,7 @@
 #include "mlx5_autoconf.h"
 #include "mlx5_mr.h"
 #include "mlx5_flow.h"
+#include "rte_pmd_mlx5.h"
 
 /* Device parameter to enable RX completion queue compression. */
 #define MLX5_RXQ_CQE_COMP_EN "rxq_cqe_comp_en"
@@ -1999,6 +2000,25 @@ mlx5_release_dbr(struct rte_eth_dev *dev, uint32_t umem_id, uint64_t offset)
        return ret;
 }
 
+int
+rte_pmd_mlx5_get_dyn_flag_names(char *names[], unsigned int n)
+{
+       static const char *const dynf_names[] = {
+               RTE_PMD_MLX5_FINE_GRANULARITY_INLINE,
+               RTE_MBUF_DYNFLAG_METADATA_NAME
+       };
+       unsigned int i;
+
+       if (n < RTE_DIM(dynf_names))
+               return -ENOMEM;
+       for (i = 0; i < RTE_DIM(dynf_names); i++) {
+               if (names[i] == NULL)
+                       return -EINVAL;
+               strcpy(names[i], dynf_names[i]);
+       }
+       return RTE_DIM(dynf_names);
+}
+
 /**
  * Check sibling device configurations.
  *