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 4DF63C636D3 for ; Tue, 31 Jan 2023 05:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbjAaF0M (ORCPT ); Tue, 31 Jan 2023 00:26:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbjAaF0I (ORCPT ); Tue, 31 Jan 2023 00:26:08 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55F3CCDF8 for ; Mon, 30 Jan 2023 21:26:07 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id cl23-20020a17090af69700b0022c745bfdc3so6746530pjb.3 for ; Mon, 30 Jan 2023 21:26:07 -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=lHxvfY/9mLckuNaFUI8MqQHR70TdRDF2XTsmF1CVRH8=; b=hn36V4OHze6prx5MOQcsRzPeyl6IMNx7ITX7661ZYoKyK+AGu5nykrHsIBxsWVfus6 87/FqarCSohBvx3X6iDSP96ZgUfdme31e2Qy5MBCvSSy4W4LDHzb3X5g1QSQTYUf1s86 hmoc9xTdw1tkXHW/0kD+Fn+j9mkvydvlQqT5c= 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=lHxvfY/9mLckuNaFUI8MqQHR70TdRDF2XTsmF1CVRH8=; b=p/bv0LybzwqgGBKth0mYn8ubPor6XDPmPkXCthdGMHgYCnIZ8cTdbMoUDxPx76XhxS pi9EpfJrm04zO8ODYk9SJbnQ/DHXRnAmCITYWWqpcbIHmrRsc3ZObhnG+whHrU2m80vc I2qYGoakJ1eOU8V+B/YMjUIPMQqmpZd1//8AgLCpYlvM3TGXvrJnQPnP1bl3QyU8Donv +BeDVBkAFPm3tfKOLNb4zoT/Yhq+XPzUmlN6ejknflwwtL1TBI6H9PQFgighAWA1MOM/ 6/2zoK+V7GFXScesmv/O5T4TWvjovxmUykMovws7fsKppoVkG3zg95ekHJXtn2nut7wr yv4g== X-Gm-Message-State: AO0yUKWFC7bjVq9VSciQClLQG4p7XQau+crYvFy4q0IP/B3WpUcjOCJ/ VN6ugem3QGg9+9wqp9I3PoabkQ== X-Google-Smtp-Source: AK7set86xY9Im8SIP7cDDmlXpN9cMSvbkKcNJeI+c9Mtry3zTrRCe3UI5bh2TCldcl3a70c8DfAYTw== X-Received: by 2002:a17:902:f1ca:b0:198:94cb:82a5 with SMTP id e10-20020a170902f1ca00b0019894cb82a5mr1866239plc.4.1675142766736; Mon, 30 Jan 2023 21:26:06 -0800 (PST) Received: from localhost.localdomain ([2605:a601:a780:1400:a879:b64b:d9bd:3c1]) by smtp.gmail.com with ESMTPSA id jk15-20020a170903330f00b001960cccc318sm2310106plb.121.2023.01.30.21.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 21:26:05 -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, gregkh@linuxfoundation.org Subject: [PATCH net-next v9 0/8] Add Auxiliary driver support Date: Mon, 30 Jan 2023 21:25:49 -0800 Message-Id: <20230131052557.99119-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000094e22005f388913a" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000094e22005f388913a Content-Transfer-Encoding: 8bit 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(); v8->v9: - Fixed the cleanup code to use the auxiliary driver release function to free allocated memory. This allows the cleanup to be performed once the device reference count drops to 0. - Refactored the code to address the above. Commit message uses Leon's Reviewed-by from earlier version. Please apply. Thanks. The following are changes since commit 90e8ca0abb05ada6c1e2710eaa21688dafca26f2 Merge branch 'devlink-next' and are available in the git repository at: https://github.com/ajitkhaparde1/net-next/tree/aux-bus-v9 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 | 9 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 8 + .../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 7 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 478 ++++++------- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 51 +- 8 files changed, 464 insertions(+), 735 deletions(-) -- 2.37.1 (Apple Git-137.1) --00000000000094e22005f388913a Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQdgYJKoZIhvcNAQcCoIIQZzCCEGMCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3NMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDB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