From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4B081A0524 for ; Fri, 5 Feb 2021 12:34:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45B6A188763; Fri, 5 Feb 2021 12:34:07 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id 3034E188A18 for ; Fri, 5 Feb 2021 12:34:06 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id c4so7271061wru.9 for ; Fri, 05 Feb 2021 03:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VYd9YmE/yWDGHw4laL1Jw45+DBe6ACmVDusNnf01u8w=; b=cusd8YMh/uCzItP90a6VaewlxEfa36oVcJ1tixsbiM7twJLlkl8FcfP2DbmjuurjTz wFkOt7PwbZuks6Gau0c2r68rE6Lo27WCgtFkhA3XSCSDzddNxBomGY7IRVlWWmn0EwPb zaywjnAYwaiKSNewRoKJ9n4JMX/sgCinfgnNcHL4HcKts+o7XE92pYXRlkRLQt85Ltho PNOBNiDUOU31nb/S+6abgsQ1SCjvgzUrdF7B2O8T5Ptdeu/k5aq1c7cqpkmKgrDB+yxe fsQl/qqC9JX/QUqr62ruYPt7cQ55il3FUvCuc7i/8cmnyqIDsM0m5Q3GuBwEIgXdu6Jg hQww== 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:mime-version:content-transfer-encoding; bh=VYd9YmE/yWDGHw4laL1Jw45+DBe6ACmVDusNnf01u8w=; b=TbgFI2W23AI5zUkH33lBdoHnv6mD+AmqXqY/dMT3YR1XDukMakP7jFwpBjxN+2p2e1 KDzZycvA4U4U6Rio6ps87lL/p5jCRnIBmkskAexshtu1MkFX0Il2HsT3k7fuuQC3GJD8 1mpxW76zXulfxxsOD/xzyu2FGA8b2QIRgs4oNhFghV4ZTl8VUHcFRtnZTLMOib6RuEE7 WEYu+43iLZ9AUfD/L5Zy1hHXY6Pt+qffKtnuko+miMmBPKSEQjVM9x6iWynadYuwTMd1 Cl+TnXU0yF2MyC3acKVYkh2LOJG7cmsVn1AhcNQNVCNNiccvfrn+dLWFq9fKTJvD9wHx I+AQ== X-Gm-Message-State: AOAM532cU64vEjDp51+1VM6tbHDuTgdKTgcGWJWz1d40W2GxxIC9Sfen LnLgRCjBd0+F1VsMZLvR8vteOd6Ajtac0SC3 X-Google-Smtp-Source: ABdhPJzU/sPltgtKszNtcNAi3IXpUdtQEQe1GqB3jG0gn9sWgXcZcJpf3g9fCTLk5xuDL3o8PHqR+g== X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr4377079wru.178.1612524846004; Fri, 05 Feb 2021 03:34:06 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id x13sm3413693wmc.27.2021.02.05.03.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:34:05 -0800 (PST) From: luca.boccassi@gmail.com To: Andrew Boyer Cc: dpdk stable Date: Fri, 5 Feb 2021 11:17:34 +0000 Message-Id: <20210205111920.1272063-168-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ionic: fix link speed and autonegotiation' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a457b9a8d853a924067e536b4f2e819c6884e8bc Thanks. Luca Boccassi --- >From a457b9a8d853a924067e536b4f2e819c6884e8bc Mon Sep 17 00:00:00 2001 From: Andrew Boyer Date: Mon, 11 Jan 2021 11:02:09 -0800 Subject: [PATCH] net/ionic: fix link speed and autonegotiation [ upstream commit 0dad8b3d4cbca12907f6bf7b4204ac7de6e76aeb ] Don't assume autoneg in link_update(). Always call ionic_dev_cmd_port_autoneg() in start(). This allows the client to specify the link settings. Fixes: 598f6726390f ("net/ionic: add basic port operations") Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_ethdev.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 68a6e630c8..fe778043eb 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -289,7 +289,10 @@ ionic_dev_link_update(struct rte_eth_dev *eth_dev, /* Initialize */ memset(&link, 0, sizeof(link)); - link.link_autoneg = ETH_LINK_AUTONEG; + + if (adapter->idev.port_info->config.an_enable) { + link.link_autoneg = ETH_LINK_AUTONEG; + } if (!adapter->link_up) { /* Interface is down */ @@ -901,7 +904,8 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev); struct ionic_adapter *adapter = lif->adapter; struct ionic_dev *idev = &adapter->idev; - uint32_t allowed_speeds; + uint32_t speed = 0, allowed_speeds; + uint8_t an_enable; int err; IONIC_PRINT_CALL(); @@ -925,11 +929,23 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) return err; } - if (eth_dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - uint32_t speed = ionic_parse_link_speeds(dev_conf->link_speeds); + /* Configure link */ + an_enable = (dev_conf->link_speeds & ETH_LINK_SPEED_FIXED) == 0; - if (speed) - ionic_dev_cmd_port_speed(idev, speed); + ionic_dev_cmd_port_autoneg(idev, an_enable); + err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT); + if (err) + IONIC_PRINT(WARNING, "Failed to %s autonegotiation", + an_enable ? "enable" : "disable"); + + if (!an_enable) + speed = ionic_parse_link_speeds(dev_conf->link_speeds); + if (speed) { + ionic_dev_cmd_port_speed(idev, speed); + err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT); + if (err) + IONIC_PRINT(WARNING, "Failed to set link speed %u", + speed); } ionic_dev_link_update(eth_dev, 0); -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:36.784624307 +0000 +++ 0168-net-ionic-fix-link-speed-and-autonegotiation.patch 2021-02-05 11:18:29.122697128 +0000 @@ -1 +1 @@ -From 0dad8b3d4cbca12907f6bf7b4204ac7de6e76aeb Mon Sep 17 00:00:00 2001 +From a457b9a8d853a924067e536b4f2e819c6884e8bc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0dad8b3d4cbca12907f6bf7b4204ac7de6e76aeb ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 838e93ef75..2face7c635 100644 +index 68a6e630c8..fe778043eb 100644 @@ -24 +25 @@ -@@ -276,7 +276,10 @@ ionic_dev_link_update(struct rte_eth_dev *eth_dev, +@@ -289,7 +289,10 @@ ionic_dev_link_update(struct rte_eth_dev *eth_dev, @@ -34,3 +35,3 @@ - if (!adapter->link_up || - !(lif->state & IONIC_LIF_F_UP)) { -@@ -869,7 +872,8 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) + if (!adapter->link_up) { + /* Interface is down */ +@@ -901,7 +904,8 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) @@ -46 +47 @@ -@@ -896,11 +900,23 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) +@@ -925,11 +929,23 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)