From patchwork Wed Nov 9 18:42:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 13037901 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 A30CCC43217 for ; Wed, 9 Nov 2022 18:42:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231348AbiKISm5 (ORCPT ); Wed, 9 Nov 2022 13:42:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbiKISmy (ORCPT ); Wed, 9 Nov 2022 13:42:54 -0500 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 841BE15719 for ; Wed, 9 Nov 2022 10:42:53 -0800 (PST) Received: by mail-qt1-x835.google.com with SMTP id z6so10880021qtv.5 for ; Wed, 09 Nov 2022 10:42:53 -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=WANutTBN77XFcbME/R23M56Yl33oSIy1dmxtuszDUVA=; b=QDyiIdYvD+b643fcQTF8z7qdDHzpO1KWP/HM3z+03kSR01j1WexUyZDdD57114DABy ieW1sv1NKluUoxpSZK9ar7Y/s1lSmrM9IgkCCq2i1alBXndEeOzks4k0PLjAPTGkUbtJ vByEq+POHXgrDO25RsH0hkmgTlmkDrUnaKhLQ= 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=WANutTBN77XFcbME/R23M56Yl33oSIy1dmxtuszDUVA=; b=jUOd0Z6pt1KbcGiwureRJHOWBkowJbF6l3WlzKEltrXPHJluyG054nzObrdFy3kXc8 1XDpJd1k3p3PTBPuMvL+g+qeLhFA0zs89lXkFSPatE8QmGkwB4xDJ3lt0x8JumBshO8J XmACxdSYj2CW8aXJc+la5mMReOsJWVDSH02Y0AxUnml4VkAekdXlXo43xxg8hXhj59FL ay3F1KWWC5ffbB7qi8Aph/hC7Hp4ZuFfYVdVBEQCLV4rH4pVvxmoEuIAl2yVt8SflMh7 KgaTppNUUmCGaVRpHc/eXwJ0qmYfs1ss59sMJPpnI4pggAsb4UFUenFT6QKS5qz/3F9x dr2g== X-Gm-Message-State: ACrzQf0RYQvhJM51RkkUWeJJhQPOPqx1Ee6dJKXmYae9U2ZLM95YzBPh C4GDhjeLSa2jqr4zeeHKFwzQyQ== X-Google-Smtp-Source: AMsMyM484h0AulVXaK27UHedJZYEWfddyn5js8QanSRgyiVVAmXtN9kcI0ITrZNRzeWTEX1E/t47uA== X-Received: by 2002:ac8:4d82:0:b0:3a5:1bae:a18f with SMTP id a2-20020ac84d82000000b003a51baea18fmr46763080qtw.265.1668019372642; Wed, 09 Nov 2022 10:42:52 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u17-20020a05622a011100b003a598fcddefsm4795108qtw.87.2022.11.09.10.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 10:42:51 -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 v4 0/6] Add Auxiliary driver support Date: Wed, 9 Nov 2022 10:42:38 -0800 Message-Id: <20221109184244.7032-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 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 Please apply. Thanks. Ajit Khaparde (5): 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 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 | 578 +++++++----------- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 8 + drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 388 ++++++------ drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 52 +- 6 files changed, 463 insertions(+), 582 deletions(-)