[PATCH 07/44] net: mana: Export Work Queue functions for use by RDMA driver
authorLong Li <longli@microsoft.com>
Thu, 3 Nov 2022 19:16:23 +0000 (12:16 -0700)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 2 Aug 2025 13:13:02 +0000 (15:13 +0200)
RDMA device may need to create Ethernet device queues for use by Queue
Pair type RAW. This allows a user-mode context accesses Ethernet hardware
queues. Export the supporting functions for use by the RDMA driver.

Reviewed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Long Li <longli@microsoft.com>
Link: https://lore.kernel.org/r/1667502990-2559-6-git-send-email-longli@linuxonhyperv.com
Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
(cherry picked from commit 4c0ff7a106e16ab63e0b597557255c012f179578)
Signed-off-by: Bastian Blank <waldi@debian.org>
Gbp-Pq: Topic features/all/ethernet-microsoft
Gbp-Pq: Name 0007-net-mana-Export-Work-Queue-functions-for-use-by-RDMA.patch

drivers/net/ethernet/microsoft/mana/gdma_main.c
drivers/net/ethernet/microsoft/mana/mana.h
drivers/net/ethernet/microsoft/mana/mana_en.c

index 1b9b9c1be67917efc488477138ed2b458072cf3f..d15dc49d2e8cdba9617d7d64afd1e106fab719fb 100644 (file)
@@ -152,6 +152,7 @@ int mana_gd_send_request(struct gdma_context *gc, u32 req_len, const void *req,
 
        return mana_hwc_send_request(hwc, req_len, req, resp_len, resp);
 }
+EXPORT_SYMBOL_NS(mana_gd_send_request, NET_MANA);
 
 int mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length,
                         struct gdma_mem_info *gmi)
index 6ce11e5a9a001ca538b5f052335f1f750f8c3933..1f6f502dee3b235e0bdf5c7cf0a52a99f6e434fe 100644 (file)
@@ -638,6 +638,15 @@ struct mana_tx_package {
        struct gdma_posted_wqe_info wqe_info;
 };
 
+int mana_create_wq_obj(struct mana_port_context *apc,
+                      mana_handle_t vport,
+                      u32 wq_type, struct mana_obj_spec *wq_spec,
+                      struct mana_obj_spec *cq_spec,
+                      mana_handle_t *wq_obj);
+
+void mana_destroy_wq_obj(struct mana_port_context *apc, u32 wq_type,
+                        mana_handle_t wq_obj);
+
 int mana_cfg_vport(struct mana_port_context *apc, u32 protection_dom_id,
                   u32 doorbell_pg_id);
 void mana_uncfg_vport(struct mana_port_context *apc);
index 934b360145ac5216aeacb657d70639451d92ce10..ce73963faf067153deb04e7c7315a5780791b951 100644 (file)
@@ -793,11 +793,11 @@ out:
        return err;
 }
 
-static int mana_create_wq_obj(struct mana_port_context *apc,
-                             mana_handle_t vport,
-                             u32 wq_type, struct mana_obj_spec *wq_spec,
-                             struct mana_obj_spec *cq_spec,
-                             mana_handle_t *wq_obj)
+int mana_create_wq_obj(struct mana_port_context *apc,
+                      mana_handle_t vport,
+                      u32 wq_type, struct mana_obj_spec *wq_spec,
+                      struct mana_obj_spec *cq_spec,
+                      mana_handle_t *wq_obj)
 {
        struct mana_create_wqobj_resp resp = {};
        struct mana_create_wqobj_req req = {};
@@ -846,9 +846,10 @@ static int mana_create_wq_obj(struct mana_port_context *apc,
 out:
        return err;
 }
+EXPORT_SYMBOL_NS(mana_create_wq_obj, NET_MANA);
 
-static void mana_destroy_wq_obj(struct mana_port_context *apc, u32 wq_type,
-                               mana_handle_t wq_obj)
+void mana_destroy_wq_obj(struct mana_port_context *apc, u32 wq_type,
+                        mana_handle_t wq_obj)
 {
        struct mana_destroy_wqobj_resp resp = {};
        struct mana_destroy_wqobj_req req = {};
@@ -873,6 +874,7 @@ static void mana_destroy_wq_obj(struct mana_port_context *apc, u32 wq_type,
                netdev_err(ndev, "Failed to destroy WQ object: %d, 0x%x\n", err,
                           resp.hdr.status);
 }
+EXPORT_SYMBOL_NS(mana_destroy_wq_obj, NET_MANA);
 
 static void mana_destroy_eq(struct mana_context *ac)
 {