DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed
@ 2019-12-03 16:59 Guinan Sun
  2019-12-03 16:59 ` [dpdk-dev] [PATCH 1/2] net/i40e: " Guinan Sun
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Guinan Sun @ 2019-12-03 16:59 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu, Qiming Yang, Beilei Xing, Guinan Sun

Setting exact link speed makes sense if auto-negotiation is
disabled. Fixed flag is required to disable auto-negotiation.

Guinan Sun (2):
  net/i40e: set fixed flag for exact link speed
  net/ixgbe: set fixed flag for exact link speed

 drivers/net/i40e/i40e_ethdev.c   | 17 +++++++----------
 drivers/net/ixgbe/ixgbe_ethdev.c | 20 +++++++-------------
 2 files changed, 14 insertions(+), 23 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH 1/2] net/i40e: set fixed flag for exact link speed
  2019-12-03 16:59 [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed Guinan Sun
@ 2019-12-03 16:59 ` Guinan Sun
  2019-12-03 16:59 ` [dpdk-dev] [PATCH 2/2] net/ixgbe: " Guinan Sun
  2019-12-19  5:27 ` [dpdk-dev] [PATCH 0/2] drivers/net: " Xu, Ting
  2 siblings, 0 replies; 5+ messages in thread
From: Guinan Sun @ 2019-12-03 16:59 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu, Qiming Yang, Beilei Xing, Guinan Sun

Setting exact link speed makes sense if auto-negotiation is
disabled. Fixed flag is required to disable auto-negotiation.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5999c964b..631400fdc 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2241,6 +2241,9 @@ i40e_apply_link_speed(struct rte_eth_dev *dev)
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_eth_conf *conf = &dev->data->dev_conf;
 
+	abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK |
+		     I40E_AQ_PHY_LINK_ENABLED;
+
 	if (conf->link_speeds == ETH_LINK_SPEED_AUTONEG) {
 		conf->link_speeds = ETH_LINK_SPEED_40G |
 				    ETH_LINK_SPEED_25G |
@@ -2248,11 +2251,12 @@ i40e_apply_link_speed(struct rte_eth_dev *dev)
 				    ETH_LINK_SPEED_10G |
 				    ETH_LINK_SPEED_1G |
 				    ETH_LINK_SPEED_100M;
+
+		abilities |= I40E_AQ_PHY_AN_ENABLED;
+	} else {
+		abilities &= ~I40E_AQ_PHY_AN_ENABLED;
 	}
 	speed = i40e_parse_link_speeds(conf->link_speeds);
-	abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK |
-		     I40E_AQ_PHY_AN_ENABLED |
-		     I40E_AQ_PHY_LINK_ENABLED;
 
 	return i40e_phy_conf_link(hw, abilities, speed, true);
 }
@@ -2271,13 +2275,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
 
 	hw->adapter_stopped = 0;
 
-	if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) {
-		PMD_INIT_LOG(ERR,
-		"Invalid link_speeds for port %u, autonegotiation disabled",
-			      dev->data->port_id);
-		return -EINVAL;
-	}
-
 	rte_intr_disable(intr_handle);
 
 	if ((rte_intr_cap_multiple(intr_handle) ||
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/ixgbe: set fixed flag for exact link speed
  2019-12-03 16:59 [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed Guinan Sun
  2019-12-03 16:59 ` [dpdk-dev] [PATCH 1/2] net/i40e: " Guinan Sun
@ 2019-12-03 16:59 ` Guinan Sun
  2019-12-19  5:27 ` [dpdk-dev] [PATCH 0/2] drivers/net: " Xu, Ting
  2 siblings, 0 replies; 5+ messages in thread
From: Guinan Sun @ 2019-12-03 16:59 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu, Qiming Yang, Beilei Xing, Guinan Sun

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1774 bytes --]

Setting exact link speed makes sense if auto-negotiation is
disabled. Fixed flag is required to disable auto-negotiation.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 2c6fd0f13..e1ab1dcab 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2558,17 +2558,6 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
-	/* IXGBE devices don't support:
-	*    - half duplex (checked afterwards for valid speeds)
-	*    - fixed speed: TODO implement
-	*/
-	if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) {
-		PMD_INIT_LOG(ERR,
-		"Invalid link_speeds for port %u, fix speed not supported",
-				dev->data->port_id);
-		return -EINVAL;
-	}
-
 	/* Stop the link setup handler before resetting the HW. */
 	rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev);
 
@@ -2724,7 +2713,11 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 	}
 
 	link_speeds = &dev->data->dev_conf.link_speeds;
-	if (*link_speeds & ~allowed_speeds) {
+
+	/* Ignore autoneg flag bit and check the validity of 
+	 * link_speed 
+	 */
+	if (((*link_speeds) >> 1) & ~(allowed_speeds >> 1)) {
 		PMD_INIT_LOG(ERR, "Invalid link setting");
 		goto error;
 	}
@@ -4133,7 +4126,8 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 	link.link_status = ETH_LINK_DOWN;
 	link.link_speed = ETH_SPEED_NUM_NONE;
 	link.link_duplex = ETH_LINK_HALF_DUPLEX;
-	link.link_autoneg = ETH_LINK_AUTONEG;
+	link.link_autoneg = !(dev->data->dev_conf.link_speeds &
+			ETH_LINK_SPEED_FIXED);
 
 	hw->mac.get_link_status = true;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed
  2019-12-03 16:59 [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed Guinan Sun
  2019-12-03 16:59 ` [dpdk-dev] [PATCH 1/2] net/i40e: " Guinan Sun
  2019-12-03 16:59 ` [dpdk-dev] [PATCH 2/2] net/ixgbe: " Guinan Sun
@ 2019-12-19  5:27 ` Xu, Ting
  2020-01-06  4:59   ` Ye Xiaolong
  2 siblings, 1 reply; 5+ messages in thread
From: Xu, Ting @ 2019-12-19  5:27 UTC (permalink / raw)
  To: Sun, GuinanX, dev; +Cc: Lu, Wenzhuo, Yang, Qiming, Xing, Beilei, Sun, GuinanX



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guinan Sun
> Sent: Wednesday, December 4, 2019 12:59 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Sun, GuinanX
> <guinanx.sun@intel.com>
> Subject: [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed
> 
> Setting exact link speed makes sense if auto-negotiation is disabled. Fixed flag
> is required to disable auto-negotiation.
> 
> Guinan Sun (2):
>   net/i40e: set fixed flag for exact link speed
>   net/ixgbe: set fixed flag for exact link speed
> 
>  drivers/net/i40e/i40e_ethdev.c   | 17 +++++++----------
>  drivers/net/ixgbe/ixgbe_ethdev.c | 20 +++++++-------------
>  2 files changed, 14 insertions(+), 23 deletions(-)
> 
> --
> 2.17.1

Reviewed-by: Ting Xu <ting.xu@intel.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed
  2019-12-19  5:27 ` [dpdk-dev] [PATCH 0/2] drivers/net: " Xu, Ting
@ 2020-01-06  4:59   ` Ye Xiaolong
  0 siblings, 0 replies; 5+ messages in thread
From: Ye Xiaolong @ 2020-01-06  4:59 UTC (permalink / raw)
  To: Xu, Ting; +Cc: Sun, GuinanX, dev, Lu, Wenzhuo, Yang, Qiming, Xing, Beilei

On 12/19, Xu, Ting wrote:
>
>
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Guinan Sun
>> Sent: Wednesday, December 4, 2019 12:59 AM
>> To: dev@dpdk.org
>> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
>> <qiming.yang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Sun, GuinanX
>> <guinanx.sun@intel.com>
>> Subject: [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed
>> 
>> Setting exact link speed makes sense if auto-negotiation is disabled. Fixed flag
>> is required to disable auto-negotiation.
>> 
>> Guinan Sun (2):
>>   net/i40e: set fixed flag for exact link speed
>>   net/ixgbe: set fixed flag for exact link speed
>> 
>>  drivers/net/i40e/i40e_ethdev.c   | 17 +++++++----------
>>  drivers/net/ixgbe/ixgbe_ethdev.c | 20 +++++++-------------
>>  2 files changed, 14 insertions(+), 23 deletions(-)
>> 
>> --
>> 2.17.1
>
>Reviewed-by: Ting Xu <ting.xu@intel.com>
>

Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>

Applied to dpdk-next-net-intel, Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-06  5:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 16:59 [dpdk-dev] [PATCH 0/2] drivers/net: set fixed flag for exact link speed Guinan Sun
2019-12-03 16:59 ` [dpdk-dev] [PATCH 1/2] net/i40e: " Guinan Sun
2019-12-03 16:59 ` [dpdk-dev] [PATCH 2/2] net/ixgbe: " Guinan Sun
2019-12-19  5:27 ` [dpdk-dev] [PATCH 0/2] drivers/net: " Xu, Ting
2020-01-06  4:59   ` Ye Xiaolong

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).