From patchwork Wed Nov 9 18:42:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 13037910 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1815EC4332F for ; Wed, 9 Nov 2022 18:42:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231239AbiKISm4 (ORCPT ); Wed, 9 Nov 2022 13:42:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231201AbiKISmy (ORCPT ); Wed, 9 Nov 2022 13:42:54 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8777A15734 for ; Wed, 9 Nov 2022 10:42:53 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id e15so10884590qts.1 for ; Wed, 09 Nov 2022 10:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=xEysgaVorgUGGnt7y80wfaavjj96wATa61y+PRspUCA=; b=VF0dJkm+UpL1tL8Jk4hwF8XHX5BYsc294mzya0leNwsAhcsxNjC3v/1HQleX48SWqo 8c7jCsbGVsteNFxhqkDKnVXc9W1qOCweXDO4yi72sftUFdOKwC/fUd1RiRSsDVWaqMGg VsAUWAVvIyara80wmwrxCmAWYArFjd4d3i8KI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xEysgaVorgUGGnt7y80wfaavjj96wATa61y+PRspUCA=; b=yoXHF44PfS0B0z7T/+brcyZNRD5ULZdQos7PGVaqBRPddNRXZ4MS81dnwydsWizsmC qSTR8gZbsYV0OdNvw6JCh1I1HRUF6uCML6TA6NvdLT/+VYhyxDS3hxCMUHWNpb4arCjx wo+ohCNQg/nluDj9ie+IrTh4xkLeNNXKLlwSVPZi0xLXLp+1zPWS7M0ikjsIWc+9ts2x r3Uuz9Wif57na6lnHkLl/LB6melzAPsbgM2IB5Qb30KZytBxl2T9hUWrXVpCk7zWJGUO DbhnwoP8qEC1dTE2re4FBQQ0v8+Y6rqpprkXmeBiBEQtqU77JMroxa3OkTYLSoPD1wTc 9LkA== X-Gm-Message-State: ACrzQf23zz1PGQd89dSlZJuU16gGLp+sFxEvSRkHfKgkgyRqRsITmtai wsiijgVtZJAj6Ikp/F4n0ixzYw== X-Google-Smtp-Source: AMsMyM484h0AulVXaK27UHedJZYEWfddyn5js8QanSRgyiVVAmXtN9kcI0ITrZNRzeWTEX1E/t47uA== X-Received: by 2002:ac8:4d82:0:b0:3a5:1bae:a18f with SMTP id a2-20020ac84d82000000b003a51baea18fmr46763080qtw.265.1668019372642; Wed, 09 Nov 2022 10:42:52 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u17-20020a05622a011100b003a598fcddefsm4795108qtw.87.2022.11.09.10.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 10:42:51 -0800 (PST) From: Ajit Khaparde To: ajit.khaparde@broadcom.com Cc: andrew.gospodarek@broadcom.com, davem@davemloft.net, edumazet@google.com, jgg@ziepe.ca, kuba@kernel.org, leon@kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, michael.chan@broadcom.com, netdev@vger.kernel.org, pabeni@redhat.com, selvin.xavier@broadcom.com Subject: [PATCH v4 0/6] Add Auxiliary driver support Date: Wed, 9 Nov 2022 10:42:38 -0800 Message-Id: <20221109184244.7032-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Add auxiliary device driver for Broadcom devices. The bnxt_en driver will register and initialize an aux device if RDMA is enabled in the underlying device. The bnxt_re driver will then probe and initialize the RoCE interfaces with the infiniband stack. We got rid of the bnxt_en_ops which the bnxt_re driver used to communicate with bnxt_en. Similarly We have tried to clean up most of the bnxt_ulp_ops. In most of the cases we used the functions and entry points provided by the auxiliary bus driver framework. And now these are the minimal functions needed to support the functionality. We will try to work on getting rid of the remaining if we find any other viable option in future. v1->v2: - Incorporated review comments including usage of ulp_id & complex function indirections. - Used function calls provided by the auxiliary bus interface instead of proprietary calls. - Refactor code to remove ROCE driver's access to bnxt structure. v2->v3: - Addressed review comments including cleanup of some unnecessary wrappers - Fixed warnings seen during cross compilation v3->v4: - Cleaned up bnxt_ulp.c and bnxt_ulp.h further - Removed some more dead code - Sending the patchset as a standalone series Please apply. Thanks. Ajit Khaparde (5): bnxt_en: Add auxiliary driver support RDMA/bnxt_re: Use auxiliary driver interface bnxt_en: Remove usage of ulp_id bnxt_en: Use direct API instead of indirection bnxt_en: Use auxiliary bus calls over proprietary calls Hongguang Gao (1): bnxt_en: Remove struct bnxt access from RoCE driver drivers/infiniband/hw/bnxt_re/bnxt_re.h | 9 +- drivers/infiniband/hw/bnxt_re/main.c | 578 +++++++----------- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 8 + drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 388 ++++++------ drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 52 +- 6 files changed, 463 insertions(+), 582 deletions(-)