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: 13099421 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 EBD0DC678D6 for ; Thu, 12 Jan 2023 20:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240363AbjALUyP (ORCPT ); Thu, 12 Jan 2023 15:54:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240345AbjALUxG (ORCPT ); Thu, 12 Jan 2023 15:53:06 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B741C907 for ; Thu, 12 Jan 2023 12:29:45 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id d9so21348863pll.9 for ; Thu, 12 Jan 2023 12:29:45 -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=fsSelyJBybYOCyzn04UolSc+4OBC8ESi2nOZ+uIl16o=; b=S5BEq5azSTyFCvyfaJIcUTgwgfN4d6VEf4V+4RoGC0XCF+wew28P7+BbMDj6ThfhuU 6Ex5XWeRY39KjTJsXI74hjzArKyr+yFxGIl/UV9joQu0st6wEJrnzNp+n6qn9oJTwAJj pLyS828rZcOzfuZahrbxKr6qhpNjWKl2I9QXU= 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=fsSelyJBybYOCyzn04UolSc+4OBC8ESi2nOZ+uIl16o=; b=HECSsrhuAC5XksJyXJOgCp8JhC4RJxwqmhhFYAeIM7ETN4vKwGik4VQZEBzL68Jr1G RbOkVXWSEoGec/pi4zIXSKk5cWXQdD6ozjoDjHz2qsp7+K1IJDkhzazw3NmUFweqTCFr Gs/alqHhm83ofQL2zW7IT8aolRe8yVRWb04ZkArnxtvuBaFO5cv8tz8YTGF8bBBBzHyH 94i1GOmLQDi63meYhUUNfBypXVyNquZC0SJfS4C+vsk3xlaDnv3/g78sCuyBc3XovdXi MChKkVz1P9Q+W58wX4U5ePOddzNAA/Us2eBRh8l4GTMMHlP2xJt8hGRggKnEnKPvkb+a UGbw== X-Gm-Message-State: AFqh2koRyZTImhIojvU1bKXIMecbz0KjL3h1kjaO1fDmZQe7NRfrLJSq Pe+FpU7nH6EwjRzxQq6NxhkkcQ== X-Google-Smtp-Source: AMrXdXsMsXRnUWE3oubpq9lcu71Ou6zbVZgrdkLlgr3ci8hyefpkyvLc1dobAgiShuKFSk2KDCaoBA== 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 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. 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(-)