From patchwork Thu Apr 1 06:57:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 12177385 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78107C43616 for ; Thu, 1 Apr 2021 06:58:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66E7960FE3 for ; Thu, 1 Apr 2021 06:58:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233496AbhDAG5l (ORCPT ); Thu, 1 Apr 2021 02:57:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:42476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233240AbhDAG5e (ORCPT ); Thu, 1 Apr 2021 02:57:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 39AF9600EF; Thu, 1 Apr 2021 06:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617260253; bh=Hlopmtsyvj627ObnwAtg6OK1EI2+m3QH4PNmFvmzOEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J4oKu90sRm73B9P9VhFHwHVH8yCRTvH2SnbILbdRfoJOpOtSm+ypSqGyuMm/ZhTaX UgXEQMqzmheTtEDOxp+rm7BMdHcgEeAce3MAFoEHQrbKKoxM+dLMRyG9pP6GA5WgB6 GcILW9f18/+grLMj97djFaW6vL3XWfO07MKh93MDkz4ePLpwGmy820mEbwPnR8Vub1 34QBsE3ybWhAwUw2faYBdoCAeV4ePswSHK6e96rFFHOQ2URRibkwByuFBWkFGehI98 /6Aq/SjWImjuKETOOp+QHafs6SLWHs/V63Daa4u8syUjRlyIHveHfUlbpVuAIOK/BI UNUVL18YOJRiw== From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , "David S. Miller" , Devesh Sharma , Jakub Kicinski , linux-rdma@vger.kernel.org, Michael Chan , Naresh Kumar PBS , netdev@vger.kernel.org, Selvin Xavier , Somnath Kotur , Sriharsha Basavapatna Subject: [PATCH rdma-next v2 2/5] RDMA/bnxt_re: Create direct symbolic link between bnxt modules Date: Thu, 1 Apr 2021 09:57:12 +0300 Message-Id: <20210401065715.565226-3-leon@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210401065715.565226-1-leon@kernel.org> References: <20210401065715.565226-1-leon@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Leon Romanovsky Convert indirect probe call to its direct equivalent to create symbols link between RDMA and netdev modules. This will give us an ability to remove custom module reference counting that doesn't belong to the driver. Signed-off-by: Leon Romanovsky Acked-By: Devesh Sharma --- drivers/infiniband/hw/bnxt_re/main.c | 7 +------ drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 -- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 - drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 1 + 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index b30d37f0bad2..140c54ee5916 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -610,15 +610,10 @@ static void bnxt_re_dev_unprobe(struct net_device *netdev, static struct bnxt_en_dev *bnxt_re_dev_probe(struct net_device *netdev) { - struct bnxt *bp = netdev_priv(netdev); struct bnxt_en_dev *en_dev; struct pci_dev *pdev; - /* Call bnxt_en's RoCE probe via indirect API */ - if (!bp->ulp_probe) - return ERR_PTR(-EINVAL); - - en_dev = bp->ulp_probe(netdev); + en_dev = bnxt_ulp_probe(netdev); if (IS_ERR(en_dev)) return en_dev; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index a680fd9c68ea..3f0e4bde5dc9 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -12859,8 +12859,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (!BNXT_CHIP_P4_PLUS(bp)) bp->flags |= BNXT_FLAG_DOUBLE_DB; - bp->ulp_probe = bnxt_ulp_probe; - rc = bnxt_init_mac_addr(bp); if (rc) { dev_err(&pdev->dev, "Unable to initialize mac address.\n"); diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 1259e68cba2a..eb0314d7a9b1 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -1745,7 +1745,6 @@ struct bnxt { (BNXT_CHIP_P4(bp) || BNXT_CHIP_P5(bp)) struct bnxt_en_dev *edev; - struct bnxt_en_dev * (*ulp_probe)(struct net_device *); struct bnxt_napi **bnapi; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c index 64dbbb04b043..a918e374f3c5 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c @@ -491,3 +491,4 @@ struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev) } return bp->edev; } +EXPORT_SYMBOL(bnxt_ulp_probe);