From patchwork Sat Aug 28 21:58:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12463635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,MIME_NO_TEXT, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B14AC432BE for ; Sat, 28 Aug 2021 21:58:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC70D60E93 for ; Sat, 28 Aug 2021 21:58:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232262AbhH1V7j (ORCPT ); Sat, 28 Aug 2021 17:59:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbhH1V7i (ORCPT ); Sat, 28 Aug 2021 17:59:38 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A80BC061756 for ; Sat, 28 Aug 2021 14:58:47 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id h9so22038843ejs.4 for ; Sat, 28 Aug 2021 14:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=iqFaHhr+uhTni4oJ8D5ocjXl0dGyvdZYXl0ZFwoYNzs=; b=Lq1/xOqOdvCvxNTtkPb6lwRQm272pkOL5BqdRBRtXhf6JHVaDws2SXjH9JXZVx65O0 QfrUJ1uhpnJ6mu98AAGvrwr65fjg6m8QhHnhyb2Np/dNi/sUDYyQdTIGFlRKDG5s6luT 7F/l90C6hpkw6cjfVzHgZ3DLlSetppUMNOFmA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iqFaHhr+uhTni4oJ8D5ocjXl0dGyvdZYXl0ZFwoYNzs=; b=Og2b9mXnitRMv+9OXeRjTWxbxn6cPq/bAaMLDXkbcoiKFuP63azYreQNdBXhZ0On0e tqtXDZzEtKEF9F4hWT5ReJFTBCAGtlqVZNVNmKVwHNzwBCJKJMNHPz8dA77trZDa9M1W d65i9ZquIcf9Rz+3k8RWSe75rzKfRuMbyFI5gigbz8T4Qf3Ssm/FXZdBs+5ASo3xXtt3 7oPh4eJEnUlyoERQ1fuxQUOO1uJo/Ez+OBrJVXJq7MDlJngcWFyl4wc9DDS6Encsbkpv +1I9m45OmWXh5z2HueNdLi1meZ3wmcFcAY1SPtyM4fyZzObwEreHMiV++2E2IZz9sbAI /XrA== X-Gm-Message-State: AOAM5334ocb/I4m1lDah8b26NnA8oklJ6SoBTkOfe5BuDg0dHeQBm244 aU8j/3NygVHuw5XJe74Tv8DM9w== X-Google-Smtp-Source: ABdhPJzCYOFYn/PGWDy3hFoKYAzYcLBIaX5g5zD9kZxzKQO3TudnGKwxowgysujn1DmpEJHU+0Vp8w== X-Received: by 2002:a17:906:4c42:: with SMTP id d2mr17110840ejw.301.1630187925692; Sat, 28 Aug 2021 14:58:45 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id cf11sm5361239edb.65.2021.08.28.14.58.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Aug 2021 14:58:44 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, edwin.peer@broadcom.com, gospo@broadcom.com Subject: [PATCH net-next 00/11] bnxt_en: Implement new driver APIs to send FW messages Date: Sat, 28 Aug 2021 17:58:19 -0400 Message-Id: <1630187910-22252-1-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The current driver APIs to send messages to the firmware allow only one outstanding message in flight. There is only one buffer for the firmware response for each firmware channel. To send a firmware message, all callers must take a mutex and it is released after the firmware response has been read. This scheme does not allow multiple firmware messages in flight. Firmware may take a long time to respond to some messages (e.g. NVRAM related ones) and this causes the mutex to be held for a long time, blocking other callers. This patchset intoduces the new driver APIs to address the above shortcomings. All callers are then updated to use the new APIs. Edwin Peer (11): bnxt_en: remove DMA mapping for KONG response bnxt_en: Refactor the HWRM_VER_GET firmware calls bnxt_en: move HWRM API implementation into separate file bnxt_en: introduce new firmware message API based on DMA pools bnxt_en: discard out of sequence HWRM responses bnxt_en: add HWRM request assignment API bnxt_en: add support for HWRM request slices bnxt_en: use link_lock instead of hwrm_cmd_lock to protect link_info bnxt_en: update all firmware calls to use the new APIs bnxt_en: remove legacy HWRM interface bnxt_en: support multiple HWRM commands in flight drivers/net/ethernet/broadcom/bnxt/Makefile | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2129 ++++++++--------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 101 +- drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 185 +- .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 81 +- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 548 +++-- .../net/ethernet/broadcom/bnxt/bnxt_hwrm.c | 763 ++++++ .../net/ethernet/broadcom/bnxt/bnxt_hwrm.h | 145 ++ drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 130 +- .../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 457 ++-- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 264 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 31 +- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 62 +- 13 files changed, 2901 insertions(+), 1997 deletions(-) create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.h