Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1416997iol; Sun, 12 Jun 2022 16:01:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBLjvqkM8UJPyFDsJ5rYXC/o8+loDpkv3BrNniv4o9SHTg+E2PMuEpRnzb/nB6TCsZwlTg X-Received: by 2002:a05:6402:401f:b0:433:406a:82c2 with SMTP id d31-20020a056402401f00b00433406a82c2mr20462836eda.289.1655074869580; Sun, 12 Jun 2022 16:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655074869; cv=none; d=google.com; s=arc-20160816; b=yXM8wVlsTUMIU3TKmnkp6CyPve5VmThDrpylBmJCUqSIkk0noYdDUgzAGKKodzTgo9 w1aWgzUrxB0t12kE3Y539b/mtoA+EUu7QczY8BgH/Eej8PwbY4KB4BJjEpuTGqetqGXl Xx/t/9Kpsln2HsYX/i9u+hFsQpfJWK4EWYfxMJvNKlmJhHVRJXXAI5/YyRAg3hAIM+Im tOp2wT2O4wqwlAy52gKmZPePMV7pr43Ys1W/3OLnKLE3t3KnytMFxpaw+S32YbbBXQeE FOTID4a4rE8+kSfFaksM/Fbl8/udjGxM7h/YVvCADEs4L1bIWUR6J784TGU1NryBVuFe Mj4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=3ScLvjNQcMYCgxRS6p+lyE5WVBXGFl6qYFOeNAEV4FA=; b=mBw1jmNRTVYoqN+10mOXvhTe18IOCXmviQ+Dt61IE3fJl9f9WaR4fCv9aziQ+ERmSw Hud9ixEKsrt7dt7ifSoL+kM+yFg/2uJfZ7LPMuiGt9/rOAcSaiZP88Na6vyFiFYl3zcK u5nGlPokEFIoQk5w52t1l5uhqzvy9NfCVM2XZk9B4vrNwQmQEUt5z2TleoS6kqZOODm7 AqjrifrRNzVKnhic+kE1VUwBIOP/LRUkDsPipq2hu9jXN7nV/aVwYC257vZ2k7aPGike em0UwLU3M8kGlnnyqL7MKxmvo38r5xNTsblO2OfkVt3BnR5Y0zBTcJtmF0VROwiDLAIi tgXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=R5xC1j5U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a1709064fc600b00718c7b4cbeasi669864ejw.991.2022.06.12.16.00.37; Sun, 12 Jun 2022 16:01:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=R5xC1j5U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236000AbiFLVP6 (ORCPT + 99 others); Sun, 12 Jun 2022 17:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236287AbiFLVPP (ORCPT ); Sun, 12 Jun 2022 17:15:15 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EC7E24C7A7; Sun, 12 Jun 2022 14:15:13 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 3598120C14CF; Sun, 12 Jun 2022 14:15:13 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3598120C14CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1655068513; bh=3ScLvjNQcMYCgxRS6p+lyE5WVBXGFl6qYFOeNAEV4FA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=R5xC1j5UyyTVLr4uVkGrce0T0mo307sdp8++8Kj0MtEX12a9LjZzbLNbc768bpoZF xcogHokLyaw+5aBqcsZVqnSbY/cwVQDafM8P+9Qk4hXG8rvPF22DYrfwKX8yGo9MRx lCPjVnuexeAKMTSQqx/KX9y65KBzBJNnTlUP/lpo= From: longli@linuxonhyperv.com To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Jason Gunthorpe , Leon Romanovsky , edumazet@google.com, shiraz.saleem@intel.com, Ajay Sharma Cc: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Long Li Subject: [Patch v3 07/12] net: mana: Export Work Queue functions for use by RDMA driver Date: Sun, 12 Jun 2022 14:14:49 -0700 Message-Id: <1655068494-16440-8-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1655068494-16440-1-git-send-email-longli@linuxonhyperv.com> References: <1655068494-16440-1-git-send-email-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li 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. Signed-off-by: Long Li --- drivers/net/ethernet/microsoft/mana/gdma_main.c | 1 + drivers/net/ethernet/microsoft/mana/mana.h | 9 +++++++++ drivers/net/ethernet/microsoft/mana/mana_en.c | 16 +++++++++------- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index 60cc1270b7d5..272facd272a4 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -125,6 +125,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(mana_gd_send_request); int mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length, struct gdma_mem_info *gmi) diff --git a/drivers/net/ethernet/microsoft/mana/mana.h b/drivers/net/ethernet/microsoft/mana/mana.h index 6aacbf42aeaf..e7719c861395 100644 --- a/drivers/net/ethernet/microsoft/mana/mana.h +++ b/drivers/net/ethernet/microsoft/mana/mana.h @@ -568,6 +568,15 @@ struct mana_adev { struct gdma_dev *mdev; }; +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); diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 235e63dcef5e..d530de74e554 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -651,11 +651,11 @@ static int mana_cfg_vport_steering(struct mana_port_context *apc, 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 = {}; @@ -704,9 +704,10 @@ static int mana_create_wq_obj(struct mana_port_context *apc, out: return err; } +EXPORT_SYMBOL_GPL(mana_create_wq_obj); -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 = {}; @@ -731,6 +732,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_GPL(mana_destroy_wq_obj); static void mana_destroy_eq(struct mana_context *ac) { -- 2.17.1