From patchwork Sun Jan 8 03:02:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 13092392 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 7872CC54EBD for ; Sun, 8 Jan 2023 03:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231592AbjAHDCU (ORCPT ); Sat, 7 Jan 2023 22:02:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231252AbjAHDCS (ORCPT ); Sat, 7 Jan 2023 22:02:18 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2558AF5B6 for ; Sat, 7 Jan 2023 19:02:17 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id s3so1292061pfd.12 for ; Sat, 07 Jan 2023 19:02:17 -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=zUlHBUgzeP5suOmxYavk4khBbjcoA6aGc5dHNtPAwYA=; b=FXpeNcsTuLSFsbDbg61tzVBEm26bC7ZnU+Gxzzhfqq6NGOWR9cItB/MnRO5mZjims1 MIa7vhS1FftqhyTm705bwrQD23zzEqPdqXqXgN8f7VdP0e5QmT4B0n8ZYZ7J4mN2oTLH K/V3qMHKcAhGXFBQNMcTcAxaLPsQ7xVZCtiMA= 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=zUlHBUgzeP5suOmxYavk4khBbjcoA6aGc5dHNtPAwYA=; b=uEfOMiz+4WTnDHX7xuMmjrczmT0P8my4hrDVZjcSULh1i8gQy4IMnyQXpuq/pqHXAd 8ISSFaRYauVTFawUHRn12sQ58bT1s+GmmFplnIPn/4W/mqmES8/W8GFriJIlrbyOqDBF p9T02+DRZJqPpS+xxv5UI5kCe+3WoDfb8U9rG4qIckACVjuueS4A0ak9DPmxwpfyYA6g r656dtzUtj/NVBH3GDJJAhzUvoyRSs7SmZuesrxFsc1oe1sVgfbBiqX7AFD5jx1jAMLA 7m5yZ70XLm8Qy6TyuOLGAijZWuxgPouQF2tW6ECPaPfEanGBNtKeQrious3ZhbT5K5tg CMAg== X-Gm-Message-State: AFqh2kp1dvkXX7EMt6+T1RcVoRP6jgibSISsR7bLoDdIQRCxJRaH0l0x Y++RsXGfdix4e0ucVPFLOsxnWg== X-Google-Smtp-Source: AMrXdXt6Ip54ke3Uy7L+Noa9ZN0NZbR8I9SJLqb6n3zk1IXsEgI0dZHQM62fm5QbK8KRYW2RHCP1Rw== X-Received: by 2002:a05:6a00:2164:b0:581:2f69:87ed with SMTP id r4-20020a056a00216400b005812f6987edmr42497009pff.34.1673146936362; Sat, 07 Jan 2023 19:02:16 -0800 (PST) Received: from localhost.localdomain ([2605:a601:a780:1400:1caf:227a:5e9d:33c3]) by smtp.gmail.com with ESMTPSA id 69-20020a621748000000b005810a54fdefsm3452148pfx.114.2023.01.07.19.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 19:02: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 0/8] Add Auxiliary driver support Date: Sat, 7 Jan 2023 19:02:00 -0800 Message-Id: <20230108030208.26390-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 Ajit Khaparde Dec 7, 2022, 9:53 AM to me, andrew.gospodarek, davem, edumazet, jgg, kuba, leon, linux-kernel, linux-rdma, michael.chan, netdev, pabeni, selvin.xavier 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. Please apply. Thanks. 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(-) Reviewed-by: Leon Romanovsky