Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1038768iog; Wed, 15 Jun 2022 19:09:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s//vz26R3ZSaQVzYttxrv/ASGNFkqIIFmJdG6eFlZSP5DYajRMsba3bwVCtZq6iJI8/xBB X-Received: by 2002:a17:90b:18b:b0:1ea:79c7:d6fe with SMTP id t11-20020a17090b018b00b001ea79c7d6femr13354180pjs.214.1655345372605; Wed, 15 Jun 2022 19:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655345372; cv=none; d=google.com; s=arc-20160816; b=J6eFa4m5zovFvU3nFgunsuNspxj8bc+A2ZrsNpShTDLfqhmnVXiPiLQ0D2D4ZdO0mj pHgB9bpTCsPgf5poesnF1hu7flbsfsnXIA5tOsOClFMSg5WPO2Wji7Vbyzo/9JqNwslV SDuX4W4EhNhamxHhedfj4seJ+LtppDfzZy/203WhlkdlK75A/rRo7wpEa8+GioIjnJnV YbT6gsYP54uDYyAzcOHUc1wnP4qJB3c4NpxYrCusz7Zi50KlX1hWvVPwOAZYYjJsHl8V pS50jsjXgI/uR20dHMj4WWcySdHjkJE5hFsfvuHX507ck0atgMHaaMeM7q+ReF0PELfE Vf0w== 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=1aqAq+XFkynCEX1IOJMJtc5KNnVFho/fnRwjJW59dps=; b=ck6TNmZxTcmmW8+kWOLSNGs5wMo/kSYYKBStsa20j8oDTeekJTFL8RHs9s3vb4XjYC Rt+dInwMCSN6L0DiKBFgVYmE6FZM6q7tVdCy5x9cpsDWI3kzuXN0lMUhW8lVcEaa9G0v RMBcDIq4feK4+OiDnRAn8GNx1X9sgsNBw3bjF4GUrpcmLBp2VcBWqNRe+DNjatlhlZBK rbNMux84aNDJ3L4xfOfK0DXL0g6G5j2vXN3oBrfCOFJazjcYq2CmEs5BfZo3gjeAl/hk bpbp3vUhtmDxRmTMECdZUK2KHUbVpPF9W790yQ+3B6UCLlfPo/FB3M6MlFTiMtFIYMyF +p0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b="lZ71K/uX"; 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 g10-20020a63f40a000000b00408c34d632dsi900480pgi.157.2022.06.15.19.09.20; Wed, 15 Jun 2022 19:09:32 -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="lZ71K/uX"; 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 S1358470AbiFPCIJ (ORCPT + 99 others); Wed, 15 Jun 2022 22:08:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351052AbiFPCHj (ORCPT ); Wed, 15 Jun 2022 22:07:39 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A00D655B1; Wed, 15 Jun 2022 19:07:37 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 7C18A20C32A8; Wed, 15 Jun 2022 19:07:32 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7C18A20C32A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1655345252; bh=1aqAq+XFkynCEX1IOJMJtc5KNnVFho/fnRwjJW59dps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=lZ71K/uX07Ly/z8qKNTtkgDoI0XA8SrMM6DDkARCjZfJmWPCtA64LcOcICcPFCMGf vof8gNik7O3pq8KGCrB/H5G/obbbrxRGh8L4R56I1BxQfYtBgzq1u3nmJT3UWphrL9 Wze1j9SUaTs12+l8ySIPr+AmnM8tKmdkVHXTR8+A= 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 v4 07/12] net: mana: Export Work Queue functions for use by RDMA driver Date: Wed, 15 Jun 2022 19:07:15 -0700 Message-Id: <1655345240-26411-8-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1655345240-26411-1-git-send-email-longli@linuxonhyperv.com> References: <1655345240-26411-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 8e58abdce906..aca95c6ba8b3 100644 --- a/drivers/net/ethernet/microsoft/mana/mana.h +++ b/drivers/net/ethernet/microsoft/mana/mana.h @@ -571,6 +571,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 c18c358607a7..b769fccc076d 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -662,11 +662,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 = {}; @@ -715,9 +715,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 = {}; @@ -742,6 +743,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