From patchwork Fri Jan 20 06:05:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 13109221 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 439A5C38159 for ; Fri, 20 Jan 2023 06:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbjATGUs (ORCPT ); Fri, 20 Jan 2023 01:20:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbjATGUl (ORCPT ); Fri, 20 Jan 2023 01:20:41 -0500 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92699829AC for ; Thu, 19 Jan 2023 22:20:40 -0800 (PST) Received: by mail-qt1-x833.google.com with SMTP id a25so3446828qto.10 for ; Thu, 19 Jan 2023 22:20:40 -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=9TYz18avqSBC3TcX0ffuSXn5L4lPXlJi9Y4UE7ZmjsQ=; b=OXqwjmIiX/I0E5THKADqsHHqAa8UtpRZjYpUzNZKBREygR/eozNkrT5TPAoNcKe95t Ux5zdOhzgWuVejY+M2SuzePIEYhYNYgfVmZMh22CpBFR+rqXySrkYH3ARjvXNBRJcuKS Tg6OoY1DkYJEUNNuJe97RxNgAYmAEfgrABc48= 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=9TYz18avqSBC3TcX0ffuSXn5L4lPXlJi9Y4UE7ZmjsQ=; b=PA5L0LxfFQlXMKXm6fhBrqZ8Bkpfd0nBcIdUayW9rCFzrlgl7jvQN5sPSIzh/Q3QST fcobpMvwRdCMfU3U7BWiFiyy9LU+xlaDOU7I8fz/6xFuMVSFkWuN6chpQcOieVOuw2Q3 A2AWfo+wPQzU93zKlgZ61am0WbC0E0zhg7Rf+eAYtpIMHNxJPcNYnyufVoJpa0U/n9WW TA1YB9m+8zGF5o+ro/JknlWZbqRe2j/5kfKODj1TmfVW7MPi37rd92XUau2QfRvzIRD+ TVtHj4mTMGZsXZQ/OFETOLq9hTbjN7EKnac5aiPLXm77d0RLP3cQ6qGlA5IZ7Ha6iNA0 6JDg== X-Gm-Message-State: AFqh2kq81Zd94x15ueAauatoQwRqdVXuVFDTdYM4v+aIZjesybA6Ny2H Jo+pXC4gapDfmcwuKFPFUOm0pA== X-Google-Smtp-Source: AMrXdXv4mjktNFlsGj1V5kfSI/3x7iKmyV8Gp2HZ12WXvlG0vWCcHOJSKbAhW7Vq5xhr7fZxmnubgQ== X-Received: by 2002:ac8:5a95:0:b0:3a8:faf:296a with SMTP id c21-20020ac85a95000000b003a80faf296amr25332954qtc.54.1674195639266; Thu, 19 Jan 2023 22:20:39 -0800 (PST) Received: from localhost.localdomain ([2605:a601:a780:1400:641c:466b:fa8e:b05a]) by smtp.gmail.com with ESMTPSA id e26-20020ac845da000000b003a527d29a41sm6903273qto.75.2023.01.19.22.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 22:20:38 -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 v8 0/8] Add Auxiliary driver support Date: Thu, 19 Jan 2023 22:05:27 -0800 Message-Id: <20230120060535.83087-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. v7->v8: - Addressed various comments to remove unnecessary check for id, removed setting pointer to NULL after free, renamed private pointers to avoid confusing them with the auxiliary device names and refactored some code accordingly. - Auxiliary device will be released through auxiliary_device_uninit(); Commit message uses Leon's Reviewed-by from earlier version. Please apply. Thanks. The following are changes since commit 3ef4a8c8963b29813170177899f84ffb93f1a8f1 'Merge branch 'net-phy-remove-probe_capabilities' and are available in the git repository at: https://github.com/ajitkhaparde1/net-next/tree/aux-bus-v8 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/Kconfig | 1 + 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 | 506 +++++++------- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 52 +- 8 files changed, 494 insertions(+), 736 deletions(-)