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: 3937 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4101107wrt; Thu, 12 Jan 2023 12:57:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXs130EitJLNjBvBWgfP/EompFxLqO0xxPxstUXI882Nqg0sO0IOozxt/b2sDLadvxHeQ2gm X-Received: by 2002:a05:6402:5387:b0:499:b3b4:3572 with SMTP id ew7-20020a056402538700b00499b3b43572mr16847478edb.20.1673557060277; Thu, 12 Jan 2023 12:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673557060; cv=none; d=google.com; s=arc-20160816; b=HX7GYdTnTAEuFTtV+MWIoSKnzjfVCJRxBqnL4vnGa/DHDvsU9SGPxB237CVvk710+e 7XVWvKPPKR3AxnpymXx5Kabyra/R/l4wFjAtOy2LRA7XqNI/D8uyuLAJOyrqgGyZUpn9 yj5uWzB63SbCYpCAQ6wLX/dnQcpI/Ph52t67Z09CC4O3R7KxRRTegvw0jLNO1+AABfVq yuxx5+ldNXaOG2z6ZbzV6A80774BHsgwWe0XZR/JG2NAwetERLF1v8AdjXvyZCYAZpjo +pPYym9nkq7zOlhx5vt0vQNzEYAZjfuL1+OVX6aIXSWwbZSwS0v/iaU8fVa4Xfs7DjCw UvWQ== 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=7+cPgxNaGKkXnz11OYnsmoh4C3z6SCzcbiqdTPJA/Jc=; b=geK/NYuK4klsHwvzBz4wRbqtrhNKiNMcd8aBsvnYHI2VA/SoSl9KeTrjCWY99SH8ED nSyryibEf47+MYxr9hnUVpYnT64+Md9M5FIeBSS8Zb94J8NVC7WCxd13JhgFLH4KvsZU mesBaDRmk+Qk2RHdAn2kSeu98V9EvRH46QN8j/6AVA9+26zlCUp9EOqbydbeIhKA1rxW E1kjnqKlMrgt8gbcfcLZ1k4POL1TZ30M6uiBH0Q6f8zGPOsUZQm4qaZ6QyqP72KeyEzD pY7ua9URKyeuPfw0149sYZ6C7gE0ghBOVh85JWcFBIT83mb0AArq3I2BiUAOFO16XW71 d/iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=KbegEri1; 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 z17-20020aa7d411000000b0046aeca41c55si17107168edq.212.2023.01.12.12.57.15; Thu, 12 Jan 2023 12:57:39 -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=KbegEri1; 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 S240582AbjALUy5 (ORCPT + 99 others); Thu, 12 Jan 2023 15:54:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231891AbjALUxH (ORCPT ); Thu, 12 Jan 2023 15:53:07 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 354871C924 for ; Thu, 12 Jan 2023 12:29:46 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id jn22so21335560plb.13 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=7+cPgxNaGKkXnz11OYnsmoh4C3z6SCzcbiqdTPJA/Jc=; b=KbegEri154MQ00oPA9J1Ueyn1Tj9DA83i9rti9LY5IA0D0lMaw0LK50GCOni9mnJ9i 0OlwSb+9JDdA6lb3OLf/j5SOx6qtvlYpSly9AhffTd4BbzMfEjOo3TyqTeOpQx+IAVAH 392xH6zwVS+Al7YqCUw7gbB1wM0IBJNQw40rI= 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=7+cPgxNaGKkXnz11OYnsmoh4C3z6SCzcbiqdTPJA/Jc=; b=nbVXlS/kBmZUeOiUmN17jfgGbnz2N34MI8v1pzjg8OKd631uAmTXBZ5wBaowDhf0KF H40MwWhdCdu0vIigJN+i1+yMVpNw6C3hNpL1U8wMZRdq0/QUZwMeKzD5JGfa1kCVSPDr 6838wP+Zn89U4+SmU+rArxWM9sQV2whzC93Fcx+y9gT3UfVmjhTZsZmfFTV1r1FC51Rb uvpdLE/WSPSV3w+ZQmc0OnHO5Mls88T3BXGFKgn3NSUImKMgfoXjUV4/cmyGaXm7D3BS xokfg553Y8meJOVUYUUoiOol0O8t+ez1S/0D+PMjasl7bRZNP+sMa1sPY+DbQnTII4s6 rxSA== X-Gm-Message-State: AFqh2kppLieLkbsBMJybot0zr3a9HMOuWwfYhAvMLibLEhK0USCo8xwx ZKDvmQIjvLUmwRBVQhNsBXbPoA== 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 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?1754851768258137063?= X-GMAIL-MSGID: =?utf-8?q?1754851768258137063?= 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(-)