From patchwork Sun Apr 25 17:45:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 427766 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=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED, 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 69A1AC433ED for ; Sun, 25 Apr 2021 17:45:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B48961288 for ; Sun, 25 Apr 2021 17:45:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231197AbhDYRqa (ORCPT ); Sun, 25 Apr 2021 13:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbhDYRq2 (ORCPT ); Sun, 25 Apr 2021 13:46:28 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24E78C061574 for ; Sun, 25 Apr 2021 10:45:48 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id w6so22911571pfc.8 for ; Sun, 25 Apr 2021 10:45:48 -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:in-reply-to:references; bh=GmqZPnUtxR9qOZTEX2Zr7wVobA/i8ZJXs7SDgr72vUI=; b=GdIaXjgKtz7ag9bNYz+8H3By5Us5nln+mDZZsL3TKz/n6JXBBuEWwhbBkqwNDNuBGs HZkBRbpe+eJmXJ8XT02jmyADvSN6XgEUgdrh4eyIvd5rtj9GBl+7vdAy+gdVf6dg5cDl 89Lv2vW9r+65aT+VQShNLZHLcqRYbdqgvGSBw= 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:in-reply-to :references; bh=GmqZPnUtxR9qOZTEX2Zr7wVobA/i8ZJXs7SDgr72vUI=; b=IUfiMdf8Zv2tmGEMDVgadV5iY4JwubMYUm/cgVvYOvoCvSKOFCSbtcKw4zNR75fYrb 7tT9pDvohfjNIsABCet0ReK5nrAC5s3tQNw705tbJD0vrVIq5R/TyM6FJrJRBlRB1T3g ziFVLZQ2CKSLqx1U7NYqgZAKQCWXI3C9Ol+3p5tIRlF/8mcSXrfAt5W4s3DzI/RePHCN 6M02TPUY2ny0PeoEcraBPO783XXDDSF8k0VfZ7867tIyt95Uw+jKFwsDV0yVwJsoTxQh CnCh5fodNZDtKAdybIq/cqLnPn3XK1GB636NWJ9n3dJ2VeeFf1ooqYp+aW/XcHi+/n3N 8t6A== X-Gm-Message-State: AOAM531QWwkA7siHBn11qCo+OTPlyo0BoDCSZgZevzl7S1xw8iyCN/h4 7EqlzNJhLuWhCD3Pjm0gfx+8Hg== X-Google-Smtp-Source: ABdhPJyOCgoLw4saGL14luiz6gLZ3i7zyEjBoZRG2JF7VeYc+Tt91BSV+zHVFfeu0QPl6/gW8ibxkw== X-Received: by 2002:a63:135d:: with SMTP id 29mr6774207pgt.83.1619372747365; Sun, 25 Apr 2021 10:45:47 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id t19sm14733553pjs.1.2021.04.25.10.45.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Apr 2021 10:45:46 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net-next v2 03/10] bnxt_en: Add support for fw managed link down feature. Date: Sun, 25 Apr 2021 13:45:20 -0400 Message-Id: <1619372727-19187-4-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1619372727-19187-1-git-send-email-michael.chan@broadcom.com> References: <1619372727-19187-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In the current code, the driver will not shutdown the link during IFDOWN if there are still VFs sharing the port. Newer firmware will manage the link down decision when the port is shared by VFs, so we can just call firmware to shutdown the port unconditionally and let firmware make the final decision. Reviewed-by: Edwin Peer Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index f08427b7dbe7..dcf1598afac2 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9495,7 +9495,8 @@ static int bnxt_hwrm_shutdown_link(struct bnxt *bp) if (!BNXT_SINGLE_PF(bp)) return 0; - if (pci_num_vf(bp->pdev)) + if (pci_num_vf(bp->pdev) && + !(bp->phy_flags & BNXT_PHY_FL_FW_MANAGED_LKDN)) return 0; bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_PORT_PHY_CFG, -1, -1); diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 6c4fb78c59fe..5835d8ca8c22 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -2014,6 +2014,7 @@ struct bnxt { #define BNXT_PHY_FL_SHARED_PORT_CFG PORT_PHY_QCAPS_RESP_FLAGS_SHARED_PHY_CFG_SUPPORTED #define BNXT_PHY_FL_PORT_STATS_NO_RESET PORT_PHY_QCAPS_RESP_FLAGS_CUMULATIVE_COUNTERS_ON_RESET #define BNXT_PHY_FL_NO_PHY_LPBK PORT_PHY_QCAPS_RESP_FLAGS_LOCAL_LPBK_NOT_SUPPORTED +#define BNXT_PHY_FL_FW_MANAGED_LKDN PORT_PHY_QCAPS_RESP_FLAGS_FW_MANAGED_LINK_DOWN u8 num_tests; struct bnxt_test_info *test_info;