From patchwork Wed Dec 7 17:53:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 2738 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp328314wrr; Wed, 7 Dec 2022 10:01:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GUBDCcRX/L/QO78z8DG/+DAP8ukrBHHS/pHXxjyvE6nEHkiAA5PeSU/uQNnTzT1rmonSF X-Received: by 2002:a63:a05:0:b0:42b:42fb:3da1 with SMTP id 5-20020a630a05000000b0042b42fb3da1mr85699710pgk.538.1670436093555; Wed, 07 Dec 2022 10:01:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670436093; cv=none; d=google.com; s=arc-20160816; b=rnH0i7J4OQXvFEex5vQJMetc73mq07tklVOAHE7J3Shv1m6PHcCcvKKoW7hPlwYvhd 7oZSUy6D1H28yjcpKk+oUvFgEaAjXRXK5md/lMUXFGHNxaP78lMtD2IRSyyxW3jmVmQj Yoxv7MekRDGJhQZ9CMERUtwb7CQubdnn/wNt69Vp1+BdNA9rRcQIUgVeUkpUJr0pnzbQ D/FnFzd+wbkRHjbgKqYVOPrULctY/cf74u65rDzwP2FpxT7Kw3ocdckJchbgqcxSZZ0T jBNW/VcjFgWCCDNmfFDCG7iXqGhMWz2FGU+850vN2n4VGWzJkWpcQ5uub4S3Gnpp9XgZ b8jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=C6TuiOJ5Qjy8IFXYJ9dzgG08cmK79TR9w40CEbBW2mw=; b=pDEYqP8yZjVG2yE7F3KjQ9h0Pyfl8ExD4tnIBEX7vko1eSis/aZV9F+ke1RHXyJxZq MH3LewgzeLTjJQUkNXI3bwFrq6hfZG46vvMWliK9evnH+9ipamb3JRlwwOejSnAjNbNd fjZL7qOY0aoct+oKtRHrDUFaxqb3qQ+TwaXYzoyVGs8hwqDaiZnh18SN7VdaZV/X6+K+ aaSUzME8ctLi55jChJ0Lm/EUVcjyU5tv1t2AyoV2AqMQUPPS8TqKkoYKNW92/3aKMFI1 oYELRCQNo6R15DfevqKY8zz1mv5tHDooV/byIRNLlWMLkavz0Nl/33eS1gdvZNvJJUZ5 UyKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=AlkikFmm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a170902e88a00b0018554535de8si16025112plg.83.2022.12.07.10.01.18; Wed, 07 Dec 2022 10:01:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=AlkikFmm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230140AbiLGRxU (ORCPT + 99 others); Wed, 7 Dec 2022 12:53:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbiLGRxR (ORCPT ); Wed, 7 Dec 2022 12:53:17 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80A3A2D1DF for ; Wed, 7 Dec 2022 09:53:16 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id t18so7787913pfq.13 for ; Wed, 07 Dec 2022 09:53:16 -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=C6TuiOJ5Qjy8IFXYJ9dzgG08cmK79TR9w40CEbBW2mw=; b=AlkikFmmpqlfGXi5ZeP18jImv/gaAFYBjijBbhRT58axlyJSKnwC6PUHfE2UfSpWAl y3hWvnL+pfWGF4bj2KE+unXswg3zzTfv6NfHdo73AsCQYbhnNcZR+SM9Np5Vo0eaR25F rQc87UIaMsukNU3e8is3/1z13Q1rR6lYs0IPc= 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=C6TuiOJ5Qjy8IFXYJ9dzgG08cmK79TR9w40CEbBW2mw=; b=icMCNPoqJ6Uo+w4Esx0snxbljfdU/jR8tyZhJFZWb9PGniU72hUz9vPAcHVqfZh3Tx wiZp2xN171TTGn9md9LqQc6VeX2alG4RosZFiV9e13ZL9Nk71SdGD1yLaq0VgpFCSUTe fIB2ms6SdrTC5hlSTX1chYlczEnZ/3vEglEsPTirT9U472Vop8PdpNWlyEkZgPCSvn0G ATZdyIX/1/U+syoWTvzdVtK2kFlEI51kOcJjMSHHfmWD2MUdVgEEyWY6C5Dj1umYpZat DdlrdAkG7ZljGW2dTaWdIP1vQX/kS5/nUBVFb8aV+b05PXACd205jPazv8A4twZjTOvR 7J0g== X-Gm-Message-State: ANoB5png9Q/BwoEmOVXIdwSYrsh4G1XCRuSEkzp98Bjx/oegOoWGvm+h 2oJ0ikb1Dtasrq3FW0uf7b6u9A== X-Received: by 2002:aa7:8c0b:0:b0:577:5b2:5ee7 with SMTP id c11-20020aa78c0b000000b0057705b25ee7mr13870971pfd.74.1670435595883; Wed, 07 Dec 2022 09:53:15 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id l6-20020a622506000000b005748aca80fesm13862242pfl.32.2022.12.07.09.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 09:53:14 -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 v5 0/7] Add Auxiliary driver support Date: Wed, 7 Dec 2022 09:53:03 -0800 Message-Id: <20221207175310.23656-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MIME_NO_TEXT, RCVD_IN_DNSWL_NONE,SORTED_RECIPS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749045112358972378?= X-GMAIL-MSGID: =?utf-8?q?1751579197622942114?= 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. Please apply. Thanks. Ajit Khaparde (6): 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 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 | 591 +++++++----------- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 8 + .../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 7 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 413 ++++++------ drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 53 +- 7 files changed, 490 insertions(+), 601 deletions(-)