From patchwork Thu Jan 12 20:29:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 13099389 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 A1D4FC63797 for ; Thu, 12 Jan 2023 20:53:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240544AbjALUx4 (ORCPT ); Thu, 12 Jan 2023 15:53:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234765AbjALUxH (ORCPT ); Thu, 12 Jan 2023 15:53:07 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BFCD1C921 for ; Thu, 12 Jan 2023 12:29:46 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d15so21365255pls.6 for ; Thu, 12 Jan 2023 12:29:46 -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=9hAjA8C+hyDdtu2MQLNhFHaEPH8W1DKYFXi7D7K4ZtI=; b=MKuiClMU4IwVit7ezFtn/cV5JB79ncmiZoZHO7o/xpQ3sY2tzvI8jS9cCGtpG0UFP/ RNzOL8ZByxb5GlGbLqLDJUJYSJGNndDksms2byk9LOfg8MxdMlQP+M3BkYNG0nHQSWik tI9Q2GkQal+v45i55vh8z7QcKKK4tzIQDcWCc= 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=9hAjA8C+hyDdtu2MQLNhFHaEPH8W1DKYFXi7D7K4ZtI=; b=AIYg+T+Rrl0fjWLNllL8TyhkUgoXwKYmoNTeeMG/M2zVEoZzKbDuqBK+NWVtwwCGT5 W0Euh8i88tNECqLjVn35OHpKBqPn8qooJyaWOC76Na99R/K29czAykg16bKsJwXrugZB cDVTi4obuVDFB5NFEj+OZheJ04x57nACNdNp0SVv6bvR4Tqt0tlp3GIFIs1ptIuDaloJ 28a8T4HQxff00bv2JpCIKlXZGIjvI+2G5aQFlfx/2AWqGY7cm81YM5MvJhazpkh2D+Sv eeHKJoHEGAs3sr6ZlpVRDs+C6mS1VH1YAbrWUzreaw3GZxufAk8sVwBJfIqsppeHAeJg x+sg== X-Gm-Message-State: AFqh2krewkk8nq/tub5MjNtLGUeP5IkbP+jDigHroi3K7NSW/kyp62Fb Xqk4VwrGAA8iHfe2KNKGgGe0vw== X-Google-Smtp-Source: AMrXdXsMsXRnUWE3oubpq9lcu71Ou6zbVZgrdkLlgr3ci8hyefpkyvLc1dobAgiShuKFSk2KDCaoBA== X-Received: by 2002:a17:902:e1c4:b0:194:5de5:e0ad with SMTP id t4-20020a170902e1c400b001945de5e0admr3149996pla.47.1673555385123; Thu, 12 Jan 2023 12:29:45 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 129-20020a630887000000b004777c56747csm10283855pgi.11.2023.01.12.12.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:29:44 -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 net-next v7 0/8] Add Auxiliary driver support Date: Thu, 12 Jan 2023 12:29:31 -0800 Message-Id: <20230112202939.19562-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: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 v4->v5: - Removed the SRIOV config callback which bnxt_en driver was calling into bnxt_re driver. - Removed excessive checks for rdev and other pointers. v5->v6: - Removed excessive checks for dev and other pointers - Remove runtime interrupt vector allocation. bnxt_en preallocates interrupt vectors for bnxt_re to use. v6->v7: - Removed incorrect usage of inline - Updated Kconfig to select AUXILIARY BUS support - Addressed various comments including removal of unnecessary forward declaration, using static functions where possible, unnecessary jump, cleanup logic, etc.. - Added Leon's Reviewed-by, to the commit log in the patches, from previous version. Please apply. Thanks. The following are changes since commit 55b98837e37da723c8b73ec0b48fe68c682b57d7 Merge branch 'vsock-update-tools-and-error-handling' and are available in the git repository at: https://github.com/ajitkhaparde1/net-next/tree/aux-bus-v7 Ajit Khaparde (7): 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 RDMA/bnxt_re: Remove the sriov config callback bnxt_en: Remove runtime interrupt vector allocation Hongguang Gao (1): bnxt_en: Remove struct bnxt access from RoCE driver drivers/infiniband/hw/bnxt_re/bnxt_re.h | 10 +- drivers/infiniband/hw/bnxt_re/main.c | 635 +++++++----------- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 8 + .../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 7 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 489 ++++++-------- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 57 +- 7 files changed, 494 insertions(+), 723 deletions(-)