net/mlx5: support tunnel RSS level
[dpdk.git] / drivers / net / mlx5 / mlx5_glue.c
index 8f500be..cd27163 100644 (file)
@@ -1,12 +1,18 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright 2018 6WIND S.A.
- * Copyright 2018 Mellanox Technologies, Ltd.
+ * Copyright 2018 Mellanox Technologies, Ltd
  */
 
 #include <errno.h>
 #include <stddef.h>
 #include <stdint.h>
 
+/*
+ * Not needed by this file; included to work around the lack of off_t
+ * definition for mlx5dv.h with unpatched rdma-core versions.
+ */
+#include <sys/types.h>
+
 /* Verbs headers do not support -pedantic. */
 #ifdef PEDANTIC
 #pragma GCC diagnostic ignored "-Wpedantic"
@@ -307,7 +313,23 @@ mlx5_glue_dv_init_obj(struct mlx5dv_obj *obj, uint64_t obj_type)
        return mlx5dv_init_obj(obj, obj_type);
 }
 
+static struct ibv_qp *
+mlx5_glue_dv_create_qp(struct ibv_context *context,
+                      struct ibv_qp_init_attr_ex *qp_init_attr_ex,
+                      struct mlx5dv_qp_init_attr *dv_qp_init_attr)
+{
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+       return mlx5dv_create_qp(context, qp_init_attr_ex, dv_qp_init_attr);
+#else
+       (void)context;
+       (void)qp_init_attr_ex;
+       (void)dv_qp_init_attr;
+       return NULL;
+#endif
+}
+
 const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){
+       .version = MLX5_GLUE_VERSION,
        .fork_init = mlx5_glue_fork_init,
        .alloc_pd = mlx5_glue_alloc_pd,
        .dealloc_pd = mlx5_glue_dealloc_pd,
@@ -349,4 +371,5 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){
        .dv_query_device = mlx5_glue_dv_query_device,
        .dv_set_context_attr = mlx5_glue_dv_set_context_attr,
        .dv_init_obj = mlx5_glue_dv_init_obj,
+       .dv_create_qp = mlx5_glue_dv_create_qp,
 };