Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1260244pxx; Tue, 27 Oct 2020 12:04:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3i74tBWSRoUhemj2aUjyFqqlnFnnPqE6BwMdvWQZIcVI+rNqliPcunAricnTuZXE7Xrf7 X-Received: by 2002:a17:906:39d1:: with SMTP id i17mr3811078eje.284.1603825491273; Tue, 27 Oct 2020 12:04:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603825491; cv=none; d=google.com; s=arc-20160816; b=t6g3Rnx1CBxn9nRiuHogpsFlLCV3MED2ZaRu8mdjNdM2WRCK49sDuP2a8sEh+kAD/l AEJjtYLY5Niq87dNvFzmabHwMN4k9qUWY6+XEippYghjDLB2qAwBHo9chbAAyWCT0yLj ihYbn8mxSVo/gfSZxvpWkf6KRVZlMCdTYDlEebh8fyTkyYt2n6FqCUuhKDsgon50pOVB OPsI14Q5b3oBN+EPBmItlaTk2EYAC5kIBXdZtIWbJXkZKCymbMKZ0iFu5fS+33P2zdp6 QEBUWLDqqXVe4FW8W+OnHbfsdU+phejaYmw8PawQjWOMLmfIsB0faI5b3W5orTzfAOs4 tsug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fdUEpWy2XKGN9/vQPfG/csz49P1R+dZ/7bsVTJviz3U=; b=ZT1h6uWtNe8tuBSi7bqJtUVbix12Q01EPuHzuKIX4FZdRHuSbZ+wWePmipF/PTfBVx cQkI1XEfoA5PRI1Hc6Rlo/hknOwWVAWw1nZXxh+knTKxdWrVqo3qXJHj7uyoto8ZFk7b WqNrEngwBMM0d9sm98fYnmZgLXVSco9toGLjoUODOYE6Eid/maiuBOlemoOt/PtmbhEb uv0g8a6SnDibSAiPBkYzEJB33UzMSsQeRXj+FGB/1Q2XgIxOsdSpTFIqLXiES0YC7ek6 02MA35Cj+yOvi/pWO49GJsVrmMy3bkXCoaOy74u/mu9dQYPUz0hsSXalKLOkpoOKjCjI LCug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yT4FoJ+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u28si1443274eda.437.2020.10.27.12.04.29; Tue, 27 Oct 2020 12:04:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yT4FoJ+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502108AbgJ0AjY (ORCPT + 99 others); Mon, 26 Oct 2020 20:39:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:51752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409361AbgJZXvQ (ORCPT ); Mon, 26 Oct 2020 19:51:16 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0446220878; Mon, 26 Oct 2020 23:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756275; bh=Y/cDPThKqS84ow/ZBVDLeQRXBsEmMETcZb/t0iXd9Rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yT4FoJ+5fc9l44A0t39WkSx9ss6R9Ive9FFK7dGOvP7+CYHC6UjS8EZ2I/Zs6hwQT M0prTsFOdpiij1BbJX2vMzrOR2mJJNnnCnLcxovG2RgUqftFFKR68uLXotZ5tYVRnN /QDhqZXP+xttANrG6IuTKOH3GKLwvM/tOnIxegzk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Michael Chan , Vasundhara Volam , Edwin Peer , Jakub Kicinski , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.9 107/147] bnxt_en: Log unknown link speed appropriately. Date: Mon, 26 Oct 2020 19:48:25 -0400 Message-Id: <20201026234905.1022767-107-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026234905.1022767-1-sashal@kernel.org> References: <20201026234905.1022767-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Chan [ Upstream commit 8eddb3e7ce124dd6375d3664f1aae13873318b0f ] If the VF virtual link is set to always enabled, the speed may be unknown when the physical link is down. The driver currently logs the link speed as 4294967295 Mbps which is SPEED_UNKNOWN. Modify the link up log message as "speed unknown" which makes more sense. Reviewed-by: Vasundhara Volam Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/1602493854-29283-7-git-send-email-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 7b7e8b7883c80..b2efdbcb0d52e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8744,6 +8744,11 @@ static void bnxt_report_link(struct bnxt *bp) u16 fec; netif_carrier_on(bp->dev); + speed = bnxt_fw_to_ethtool_speed(bp->link_info.link_speed); + if (speed == SPEED_UNKNOWN) { + netdev_info(bp->dev, "NIC Link is Up, speed unknown\n"); + return; + } if (bp->link_info.duplex == BNXT_LINK_DUPLEX_FULL) duplex = "full"; else @@ -8756,7 +8761,6 @@ static void bnxt_report_link(struct bnxt *bp) flow_ctrl = "ON - receive"; else flow_ctrl = "none"; - speed = bnxt_fw_to_ethtool_speed(bp->link_info.link_speed); netdev_info(bp->dev, "NIC Link is Up, %u Mbps %s duplex, Flow control: %s\n", speed, duplex, flow_ctrl); if (bp->flags & BNXT_FLAG_EEE_CAP) -- 2.25.1