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: 13092401 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 31178C46467 for ; Sun, 8 Jan 2023 03:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231745AbjAHDCU (ORCPT ); Sat, 7 Jan 2023 22:02:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbjAHDCS (ORCPT ); Sat, 7 Jan 2023 22:02:18 -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 25508F005 for ; Sat, 7 Jan 2023 19:02:17 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id d83so1801534pfd.7 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=tO1KJNGwdfBKS0tf4q++XI4qHiRl2hvRXRSAbXcu9q4=; b=gB1iW0tgvRVtZ001gDEr16/wXaqjFTzs2Y6MIz8gHmedy1FU0n61gpWk2tJHvD9tQX g/lSpHbaJ66Y1cwWwHGYHtrwaU6z1chRMw1FsmFhiXWatBR6bgjvQlHVRkgOi95zZhep F4TQYziQ3DsQ+D5ZMqI58z1FM+1XgQWcNG0VU= 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=tO1KJNGwdfBKS0tf4q++XI4qHiRl2hvRXRSAbXcu9q4=; b=8K/s5WH2g515O7Z60mIykhs+0v8FeQz07RDRuUAvhDBGdZ4+/9Dx/uDwSquvQON/iG SYrIYUXYjDzR/F7r84HEqB16uH6ASHf05Al7YmRGuL6dqUGnp4I5h9yuS4cZFIDdvk+H naUz8ZnftBqZJlG4F0D69vrNmXMiJfvpF7ZlT+w49sghe53YdpWFpCb6p2CqlBKTbTJD 0RBV4kWMwqt1kPAm1ibTzh+MtoWq4ybDx3YERD3pdqZddyJ6uEuAk0M4si7GoSZNUifm P7/2LzINry1maTAd3ny+2ynQIdo5JAv7dIHGmqrY81GfgmPHGUij+Q2aVqoJQLJtWhrR xoEw== X-Gm-Message-State: AFqh2krRkY4WE1Da0+L/ghcfGjEu79YVvXrd5/umbrdKKLXuHV5yhUsa oeZJAAxVMbMH/Ge4l86Oyg0p6Q== 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: linux-rdma@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