From patchwork Sun Aug 29 07:34:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12463761 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.0 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 55804C432BE for ; Sun, 29 Aug 2021 07:35:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 353F460F3A for ; Sun, 29 Aug 2021 07:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234805AbhH2HgO (ORCPT ); Sun, 29 Aug 2021 03:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbhH2HgM (ORCPT ); Sun, 29 Aug 2021 03:36:12 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 035C4C061756 for ; Sun, 29 Aug 2021 00:35:21 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id lc21so23751229ejc.7 for ; Sun, 29 Aug 2021 00:35:20 -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=zbpdcRPANqwsAPhkJ8+VSKBsECabICTeyv1uEHsvzIc=; b=PSOCzuC6h436tZZpQDScFdzvrFxMDILjLU/Qz9jCOTPZJqWT0H25Tj82c82jmrcvKE Tfl+jJT840jDNAvqso3Pcd8gkvYuraap4hFyV2+rkuyqnr/38zyeW9EcIHECFMbtEten RORd2M+d5ONtpyR0mE0yNaiI4r0vXE8RS+Yn8= 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=zbpdcRPANqwsAPhkJ8+VSKBsECabICTeyv1uEHsvzIc=; b=VC+IBE+GLEtwqrNhxuZmiaAMxqO9deScMV/sKGBMeZsYyQ8W1oP9miQZzihT0uF9fj nEoTH5Of1tqp9Tcvmxiog9TRsHgJw/uXWbUxlXWm9V5Rp98HHp9DT2C35eha/QQ5Nw3X ooa9EuXVlMPc7FVleEU+kVtdgbAQOKwj947WxI+Ea2kTDcnLZalGIZcTZtPKoAMRvy7h PxwDLtLRyTUyGqxC/Lo5gBuN7djQbnnLPX3whiTt/HK/h/IWH8cLN6NJ6ORpsReY3UVP csJJn5j2Ae77zj2Ljk8hHl0phum3E0zK5NC53KqatDdwqrPcxla6d/w5kr6Pfzu8+khh p67g== X-Gm-Message-State: AOAM533uEx16w1cuzAwlplLh/NeZHsM3WmEn+616RgIHdnGtghgQeuwq si/vSoawipbXHp3vy3ZdXaMiGw== X-Google-Smtp-Source: ABdhPJzbzRakea2Y5g3Xt6YHBiDi8pB6eMO1Bu3UwZp9EX+rPghwyneNAcbCXQD2yqBUZRtxOQyn6Q== X-Received: by 2002:a17:906:585a:: with SMTP id h26mr19291997ejs.31.1630222518918; Sun, 29 Aug 2021 00:35:18 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id dy7sm984007edb.38.2021.08.29.00.35.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Aug 2021 00:35:18 -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 v2 00/11] bnxt_en: Implement new driver APIs to send FW messages Date: Sun, 29 Aug 2021 03:34:55 -0400 Message-Id: <1630222506-19532-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. The new APIs are compatible with new and old firmware. But the new deferred firmware response mechanism will require newer firmware in order to allow multiple outstanding firmware commands. All callers are updated to use the new APIs. v2: Patch 4 and patch 9 updated to fix issues reported by test robot 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 | 2133 ++++++++--------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 105 +- 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 | 455 ++-- 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, 2906 insertions(+), 1998 deletions(-) create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.h