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: 13067482 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 73F44C352A1 for ; Wed, 7 Dec 2022 17:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230134AbiLGRxS (ORCPT ); Wed, 7 Dec 2022 12:53:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230130AbiLGRxR (ORCPT ); Wed, 7 Dec 2022 12:53:17 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815862E6B3 for ; Wed, 7 Dec 2022 09:53:16 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id c13so11015382pfp.5 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=RGBMmu2uQqcF1fAw4kCcjM4anc5pZX6DdwEHpOqq+fU=; b=XQFiw8RPX4ly2hTJl4auq+iG7Of3HU74kj8OQzyR35VmQnhkG0IkVXfUCqW39n3F4k qvHTbfJkZi3edc3J/aTcn76F99yF0wT2qpaIKGXFVSzNlgXSbMccgh+gj8m8mdTaFX9N vk5aaJcUb1o+/sJn1pxwLQR2/vzlmLRg3llGQ= 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=RGBMmu2uQqcF1fAw4kCcjM4anc5pZX6DdwEHpOqq+fU=; b=Tul2Y8bttW32kdLAO6P4WCycG+/tmv463MIRfaQc1rftAQwgqAvqNF59YnpgoyVqsx q30LRtN8uC9sEeLIVGHYwG0n7ROfECekmeauR+DBxmzbsK3fFyfhqW6Mq0OTo2JUH+i3 rbnFmnqMI8mB49YACLSBkV+4Y2vrLSYGtWDyEChwTv0FCTDpZVz6xsu5yafBPiwI/Kt5 dXqZjfkcaWxRTDs2Oq5sCgNYicFW0R5qUje4RqSNgXFOVcb+IfM2Smh2V9hVP8uEIry3 PGpcMVwrHRepVfmXrcDkxYN/of6V+GBZg5KPp5Lb4Sp9KJcPSZR5WtGAYhoZY7mjNSvy 95zw== X-Gm-Message-State: ANoB5pkUntWacnz06Xsrwa4JCt3YdnRG93tq5V5kym/qQtL0DjxVV6oA 6lnsTMBRTX6lPNZGLteGhLgTSw== 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: linux-rdma@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(-)