From patchwork Sat Apr 24 20:14:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12222767 X-Patchwork-Delegate: kuba@kernel.org 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.6 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,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 415A5C433ED for ; Sat, 24 Apr 2021 20:14:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2386061452 for ; Sat, 24 Apr 2021 20:14:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237272AbhDXUP0 (ORCPT ); Sat, 24 Apr 2021 16:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236954AbhDXUPY (ORCPT ); Sat, 24 Apr 2021 16:15:24 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CD36C061574 for ; Sat, 24 Apr 2021 13:14:46 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id lt13so15966001pjb.1 for ; Sat, 24 Apr 2021 13:14:46 -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=NuXQGt2tG7buHvin1cVs5elBPldLhxqqkV0aP3d1sdg=; b=U6ZpFjzFKNll9qrJtGsyL8g45uRuW+V//pspRlP147Z/QkNiZUpPmhswaJOeQgB86g 5RvTfsuFo1nUs13QfDz5GdKi14IpvvCzsJ5sZ+mqyCiMxlxbfoGQ8fAlruXX5mSjyx6e 7bjxIrVYUCqL+GiRIu0P2aMnNhFlsyn5RAzRY= 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=NuXQGt2tG7buHvin1cVs5elBPldLhxqqkV0aP3d1sdg=; b=RhLkx/JjAZ71VV39StBv3iPi0c6ESwJYo9+Waf9YF7DTemFMHAcdz82iqZJbdNbDmb H6YfWYo3v1+4Zy9q98jOeYBDAOkCBOnt7rzVtvs+TEGlDcX4Dryy6+DMXtToJG97EEeG 4JhOvbJYSIjQuJngHWUvsQDWLjus4AHQWMNyBHK2d+qVa0hVoeR5dAhFzZMA4Yq/FRD5 1aLz7ciW8Pm4p4R7GHCaiA7xmC3Ghd+fIDrwajrLGejBNC2l2Y+EgFPeqGw2oN3hEGuW CjCiThz+THGic11vKfAhZ8hGJNnESnfVM5ZCJ6uv6vZEwf9aRWzXPUAnf4hxrih08W1j aw/A== X-Gm-Message-State: AOAM530np9cRmyyycaSPIP8wrHUyMCCxoqWfI6fVNICETiY+vO8nhHJ4 hPoItOtp2MMLHRU4tZt9ga3RSYS3VnHRbs+4 X-Google-Smtp-Source: ABdhPJwlzVJKfd2QRLctumsni5cx7XYhT/HAxcNpF60doiqxBtUrpPLdgsJ7cH2tRnaX4wM7AmbLtw== X-Received: by 2002:a17:902:7603:b029:ec:f560:7d66 with SMTP id k3-20020a1709027603b02900ecf5607d66mr3804992pll.39.1619295284943; Sat, 24 Apr 2021 13:14:44 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id z29sm7914070pga.52.2021.04.24.13.14.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Apr 2021 13:14:44 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net-next 03/10] bnxt_en: Add support for fw managed link down feature. Date: Sat, 24 Apr 2021 16:14:24 -0400 Message-Id: <1619295271-30853-4-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1619295271-30853-1-git-send-email-michael.chan@broadcom.com> References: <1619295271-30853-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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;