From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BAA80A2EDB for ; Wed, 2 Oct 2019 07:55:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 653D81BE8B; Wed, 2 Oct 2019 07:54:43 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (unknown [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 5BE78316B for ; Wed, 2 Oct 2019 07:54:31 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 2437930D4EA; Tue, 1 Oct 2019 22:53:18 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 2437930D4EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1569995598; bh=6qa3z0q6AsXzGCWdQ7hQzCaMluZAz0Q0KUCuKcPUetM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NY169Fsxq4xuH+L1D0bR3vFQB5byMInmlgclzfkXPBgcRc0oN5GupnWovwIcShBXn 0Rw4xGpOdKrPQUBkr/IygpllzHHnNgbRodzkuqlLEr5BnnfkC9knsKBiCgeKXTiZR1 +NYOt8pKp1Ulpk1C2KfLS1V8AkdLnykub0ue6Vu8= Received: from localhost.localdomain (unknown [10.230.30.225]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 8C79114008C; Tue, 1 Oct 2019 22:54:28 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Santoshkumar Karanappa Rastapur Date: Tue, 1 Oct 2019 22:54:12 -0700 Message-Id: <20191002055423.99659-7-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20191002055423.99659-1-ajit.khaparde@broadcom.com> References: <20191002055423.99659-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 06/17] net/bnxt: fix 40G link failure for Thor X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Santoshkumar Karanappa Rastapur Link autonegotiation for 40G is not supported by Thor. Hence speed needs to be forced and autoneg disabled to configure 40G speed. Fixes: f8168ca0e690 ("net/bnxt: support thor controller") Reviewed-by: Ajit Khaparde Signed-off-by: Santoshkumar Karanappa Rastapur Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index b2033ea416..6e95acb89e 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -2679,11 +2679,27 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up) goto port_phy_cfg; autoneg = bnxt_check_eth_link_autoneg(dev_conf->link_speeds); + if (BNXT_CHIP_THOR(bp) && + dev_conf->link_speeds == ETH_LINK_SPEED_40G) { + /* 40G is not supported as part of media auto detect. + * The speed should be forced and autoneg disabled + * to configure 40G speed. + */ + PMD_DRV_LOG(INFO, "Disabling autoneg for 40G\n"); + autoneg = 0; + } + speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds); link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY; - /* Autoneg can be done only when the FW allows */ - if (autoneg == 1 && !(bp->link_info.auto_link_speed || - bp->link_info.force_link_speed)) { + /* Autoneg can be done only when the FW allows. + * When user configures fixed speed of 40G and later changes to + * any other speed, auto_link_speed/force_link_speed is still set + * to 40G until link comes up at new speed. + */ + if (autoneg == 1 && + !(!BNXT_CHIP_THOR(bp) && + (bp->link_info.auto_link_speed || + bp->link_info.force_link_speed))) { link_req.phy_flags |= HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG; link_req.auto_link_speed_mask = -- 2.20.1 (Apple Git-117)