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: 13067470 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 E9B85C47089 for ; Wed, 7 Dec 2022 17:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbiLGRxS (ORCPT ); Wed, 7 Dec 2022 12:53:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbiLGRxR (ORCPT ); Wed, 7 Dec 2022 12:53:17 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 806D12A97A for ; Wed, 7 Dec 2022 09:53:16 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id a14so14080465pfa.1 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=swtkDqCMzGL7KJODaWK5a3S51Xy+2PbXBnaSciPTN5w=; b=OIl4qrdp9nxLSjicrZzyqoQAKB6RjpJqCR7oRv9l8k6IwRxKHwk0dA1n73kcMsqHu5 9sb+xmyugkWOeBP6Jz01KuL7EgRMhl8TJMu5Tr+pu5TxyAfLMZSFgOBCu9URKY7WlW0U JaI2JaibcRRqfNe5aulg0mkPBccr9/4D4GC3k= 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=swtkDqCMzGL7KJODaWK5a3S51Xy+2PbXBnaSciPTN5w=; b=n2UIZopqsfb58RXkt2hlL3bTeKbx8nPFjQxoxEiVK7eKBke2sjQqYAeiEZevaM0mXm eTzKQVc7HXI3Hc4UarnK8vGODQ3pN9HEmwmKpId4q4Y9cmkY3EesfxU/kH/Q6Wzbra0e hnxN2K5mefSmdPJYq2LkacZQbkfC9w9f26woPid2XL/6OlBbKMh91uN82lqB0FRwjAME Ykpq0J3lJ4ZoHUKMqnxyVxWERX9528fIhxyLa+zhaSyudaephB4S88rXn2PgpvwOlhoD 79+mC2RHZ8BWLFISUh1LfprlrJ0+FyZrpgFEbH6lJuIb3QJEdE2j3TmYdJrMH8e4zgW+ 1Htw== X-Gm-Message-State: ANoB5pmO0FkA+7FAI4x/C4YYl+NrKu7yxDOac04ufzsUDkKJtgpy7FTc lTBTS8nb0jMWJxrojpDGkW3dUA== X-Google-Smtp-Source: AA0mqf4saveSfSsdHGRXE01QkPkXCTTTEG0gyd+5J6EyHwudyKeLq3ip2HNmR+gJrQhyfZGNi8XIxw== 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 Precedence: bulk List-ID: X-Mailing-List: netdev@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 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(-)