DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thierry Herbelot <thierry.herbelot@6wind.com>
To: dev@dpdk.org
Cc: Laurent Hardy <laurent.hardy@6wind.com>,
	stable@dpdk.org, Thomas Monjalon <thomas@monjalon.net>
Subject: [dpdk-dev] [PATCH 19.11 V2 07/12] net/i40e: set speed to undefined for default case in link update
Date: Wed,  7 Aug 2019 17:09:16 +0200	[thread overview]
Message-ID: <22c111c3cd1eff557a5ea95997ba1033d9d31b5f.1565190405.git.thierry.herbelot@6wind.com> (raw)
In-Reply-To: <cover.1565190405.git.thierry.herbelot@6wind.com>
In-Reply-To: <cover.1565190405.git.thierry.herbelot@6wind.com>

From: Laurent Hardy <laurent.hardy@6wind.com>

During PF/VF link update, a default speed value of 100M will be set
if get_link_info has failed or speed is unknown.

Consequently if PF is put in no-carrier state, VFs will switch to
"in carrier" state due to a link up + a link speed set to 100M
(default value if no speed detected).

To be consistent with linux drivers on which PF and VFs are in
same carrier state, sets default speed to undefined (instead of 100M)
and updates a link status of VF only if link is up and speed is
different from undefined.

Fixes: 4861cde46116 ('i40e: new poll mode driver')
Cc: stable@dpdk.org

Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
---
 drivers/net/i40e/i40e_ethdev.c    | 4 ++--
 drivers/net/i40e/i40e_ethdev_vf.c | 8 +++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5250..76abe8209a10 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2743,7 +2743,7 @@ update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
 		status = i40e_aq_get_link_info(hw, enable_lse,
 						&link_status, NULL);
 		if (unlikely(status != I40E_SUCCESS)) {
-			link->link_speed = ETH_SPEED_NUM_100M;
+			link->link_speed = ETH_SPEED_NUM_NONE;
 			link->link_duplex = ETH_LINK_FULL_DUPLEX;
 			PMD_DRV_LOG(ERR, "Failed to get link info");
 			return;
@@ -2777,7 +2777,7 @@ update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
 		link->link_speed = ETH_SPEED_NUM_40G;
 		break;
 	default:
-		link->link_speed = ETH_SPEED_NUM_100M;
+		link->link_speed = ETH_SPEED_NUM_NONE;
 		break;
 	}
 }
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 308fb9835ab1..bf707e57b29b 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2143,13 +2143,15 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,
 		new_link.link_speed = ETH_SPEED_NUM_40G;
 		break;
 	default:
-		new_link.link_speed = ETH_SPEED_NUM_100M;
+		new_link.link_speed = ETH_SPEED_NUM_NONE;
 		break;
 	}
 	/* full duplex only */
 	new_link.link_duplex = ETH_LINK_FULL_DUPLEX;
-	new_link.link_status = vf->link_up ? ETH_LINK_UP :
-					     ETH_LINK_DOWN;
+	new_link.link_status = vf->link_up &&
+				new_link.link_speed != ETH_SPEED_NUM_NONE
+				? ETH_LINK_UP
+				: ETH_LINK_DOWN;
 	new_link.link_autoneg =
 		!(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED);
 
-- 
2.11.0


  parent reply	other threads:[~2019-08-07 15:11 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 14:37 [dpdk-dev] [PATCH 19.11 00/12] Miscellaneous fixes Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 01/12] net/ixgbevf: fix stats update after a PF reset Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 02/12] ethdev: fix description of tx descriptor status Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 03/12] net/e1000: fix Tx descriptor status api (igb) Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 04/12] net/e1000: fix Tx descriptor status api (em) Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 05/12] net/ixgbe: fix Tx descriptor status api Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 06/12] net/i40e: " Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 07/12] net/i40e: set speed to undefined for default case in link update Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 08/12] virtio: fix rx stats with vectorized functions Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 09/12] virtio: get all pending rx packets " Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 10/12] drivers/crypto/openssl: use a local copy for the session contexts Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 11/12] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop Thierry Herbelot
2019-08-07 14:37 ` [dpdk-dev] [PATCH 19.11 12/12] drivers/crypto/octeontx: enable unbinding for the OcteonTx crypto engines Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 00/12] Miscellaneous fixes Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 " Thierry Herbelot
2019-08-08 13:19     ` Thierry Herbelot
2019-08-08 14:34       ` Thomas Monjalon
2019-10-10 13:01         ` David Marchand
2019-10-10 13:12           ` Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 01/12] net/ixgbevf: fix stats update after a PF reset Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 02/12] ethdev: fix description of tx descriptor status Thierry Herbelot
2019-08-08 10:37     ` Andrew Rybchenko
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 03/12] net/e1000: fix Tx descriptor status api (igb) Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 04/12] net/e1000: fix Tx descriptor status api (em) Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 05/12] net/ixgbe: fix Tx descriptor status api Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 06/12] net/i40e: " Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 07/12] net/i40e: set speed to undefined for default case in link update Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 08/12] virtio: fix rx stats with vectorized functions Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 09/12] virtio: get all pending rx packets " Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 10/12] drivers/crypto/openssl: use a local copy for the session contexts Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 11/12] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop Thierry Herbelot
2019-08-08  8:22   ` [dpdk-dev] [PATCH 19.11 V3 12/12] drivers/crypto/octeontx: enable unbinding for the OcteonTx crypto engines Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 01/12] net/ixgbevf: fix stats update after a PF reset Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 02/12] ethdev: fix description of tx descriptor status Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 03/12] net/e1000: fix Tx descriptor status api (igb) Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 04/12] net/e1000: fix Tx descriptor status api (em) Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 05/12] net/ixgbe: fix Tx descriptor status api Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 06/12] net/i40e: " Thierry Herbelot
2019-08-07 15:09 ` Thierry Herbelot [this message]
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 08/12] virtio: fix rx stats with vectorized functions Thierry Herbelot
2019-08-08  5:15   ` [dpdk-dev] [dpdk-stable] " Tiwei Bie
2019-08-08  7:35     ` Thibaut Collet
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 09/12] virtio: get all pending rx packets " Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 10/12] drivers/crypto/openssl: use a local copy for the session contexts Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 11/12] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop Thierry Herbelot
2019-08-07 15:09 ` [dpdk-dev] [PATCH 19.11 V2 12/12] drivers/crypto/octeontx: enable unbinding for the OcteonTx crypto engines Thierry Herbelot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22c111c3cd1eff557a5ea95997ba1033d9d31b5f.1565190405.git.thierry.herbelot@6wind.com \
    --to=thierry.herbelot@6wind.com \
    --cc=dev@dpdk.org \
    --cc=laurent.hardy@6wind.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).