[v2] net/ixgbe: enable 10Mb/s link setup for x553

Message ID 1553847345-54013-1-git-send-email-wei.zhao1@intel.com
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series
  • [v2] net/ixgbe: enable 10Mb/s link setup for x553
Related show

Checks

Context Check Description
ci/mellanox-Performance-Testing fail Performance Testing issues
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Zhao1, Wei March 29, 2019, 8:15 a.m.
There is need to eanble 10Mb/s link foixgbe NIC of x553.
This new device has own device id of 0x15E4 and 0x15E5, so
ixgbe PMD driver need to special check when setup link for
these two types of device.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

v2:
delete test code and change permit link speed
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Stillwell Jr, Paul M March 29, 2019, 6:46 p.m. | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wei Zhao
> Sent: Friday, March 29, 2019 1:16 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [dpdk-dev] [PATCH v2] net/ixgbe: enable 10Mb/s link setup for x553
> 
> There is need to eanble 10Mb/s link foixgbe NIC of x553.

Couple of typos, how about:

Enable 10Mb/s link for ixgbe x553.

> This new device has own device id of 0x15E4 and 0x15E5, so ixgbe PMD driver
> need to special check when setup link for these two types of device.
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 
> ---
> 
> v2:
> delete test code and change permit link speed
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 97e1021..0aef577 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2701,6 +2701,10 @@ static int eth_ixgbevf_pci_remove(struct
> rte_pci_device *pci_dev)
>  		allowed_speeds = ETH_LINK_SPEED_100M |
> ETH_LINK_SPEED_1G |
>  			ETH_LINK_SPEED_2_5G |  ETH_LINK_SPEED_5G |
>  			ETH_LINK_SPEED_10G;
> +		if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
> +				hw->device_id ==
> IXGBE_DEV_ID_X550EM_A_1G_T_L)
> +			allowed_speeds = ETH_LINK_SPEED_10M |
> +				ETH_LINK_SPEED_100M |
> ETH_LINK_SPEED_1G;
>  		break;
>  	default:
>  		allowed_speeds = ETH_LINK_SPEED_100M |
> ETH_LINK_SPEED_1G | @@ -2742,6 +2746,8 @@ static int
> eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
>  			speed |= IXGBE_LINK_SPEED_1GB_FULL;
>  		if (*link_speeds & ETH_LINK_SPEED_100M)
>  			speed |= IXGBE_LINK_SPEED_100_FULL;
> +		if (*link_speeds & ETH_LINK_SPEED_10M)
> +			speed |= IXGBE_LINK_SPEED_10_FULL;
>  	}
> 
>  	err = ixgbe_setup_link(hw, speed, link_up); @@ -4061,8 +4067,12
> @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct
> rte_eth_dev *dev,
>  	switch (link_speed) {
>  	default:
>  	case IXGBE_LINK_SPEED_UNKNOWN:
> +		if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
> +			hw->device_id ==
> IXGBE_DEV_ID_X550EM_A_1G_T_L)
> +			link.link_speed = ETH_SPEED_NUM_10M;
> +		else
> +			link.link_speed = ETH_SPEED_NUM_100M;
>  		link.link_duplex = ETH_LINK_FULL_DUPLEX;
> -		link.link_speed = ETH_SPEED_NUM_100M;
>  		break;
> 
>  	case IXGBE_LINK_SPEED_100_FULL:
> --
> 1.8.3.1
Zhao1, Wei April 1, 2019, 6:32 a.m. | #2
> -----Original Message-----
> From: Stillwell Jr, Paul M
> Sent: Saturday, March 30, 2019 2:47 AM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: RE: [dpdk-dev] [PATCH v2] net/ixgbe: enable 10Mb/s link setup for
> x553
> 
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Wei Zhao
> > Sent: Friday, March 29, 2019 1:16 AM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> > Subject: [dpdk-dev] [PATCH v2] net/ixgbe: enable 10Mb/s link setup for
> > x553
> >
> > There is need to eanble 10Mb/s link foixgbe NIC of x553.
> 
> Couple of typos, how about:
> 
> Enable 10Mb/s link for ixgbe x553.


Good,  update in v2

> 
> > This new device has own device id of 0x15E4 and 0x15E5, so ixgbe PMD
> > driver need to special check when setup link for these two types of device.
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> >
> > ---
> >
> > v2:
> > delete test code and change permit link speed
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index 97e1021..0aef577 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -2701,6 +2701,10 @@ static int eth_ixgbevf_pci_remove(struct
> > rte_pci_device *pci_dev)
> >  		allowed_speeds = ETH_LINK_SPEED_100M |
> ETH_LINK_SPEED_1G |
> >  			ETH_LINK_SPEED_2_5G |  ETH_LINK_SPEED_5G |
> >  			ETH_LINK_SPEED_10G;
> > +		if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
> > +				hw->device_id ==
> > IXGBE_DEV_ID_X550EM_A_1G_T_L)
> > +			allowed_speeds = ETH_LINK_SPEED_10M |
> > +				ETH_LINK_SPEED_100M |
> > ETH_LINK_SPEED_1G;
> >  		break;
> >  	default:
> >  		allowed_speeds = ETH_LINK_SPEED_100M |
> ETH_LINK_SPEED_1G | @@
> > -2742,6 +2746,8 @@ static int eth_ixgbevf_pci_remove(struct
> > rte_pci_device *pci_dev)
> >  			speed |= IXGBE_LINK_SPEED_1GB_FULL;
> >  		if (*link_speeds & ETH_LINK_SPEED_100M)
> >  			speed |= IXGBE_LINK_SPEED_100_FULL;
> > +		if (*link_speeds & ETH_LINK_SPEED_10M)
> > +			speed |= IXGBE_LINK_SPEED_10_FULL;
> >  	}
> >
> >  	err = ixgbe_setup_link(hw, speed, link_up); @@ -4061,8 +4067,12
> @@
> > static int ixgbevf_dev_xstats_get_names(__rte_unused struct
> > rte_eth_dev *dev,
> >  	switch (link_speed) {
> >  	default:
> >  	case IXGBE_LINK_SPEED_UNKNOWN:
> > +		if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
> > +			hw->device_id ==
> > IXGBE_DEV_ID_X550EM_A_1G_T_L)
> > +			link.link_speed = ETH_SPEED_NUM_10M;
> > +		else
> > +			link.link_speed = ETH_SPEED_NUM_100M;
> >  		link.link_duplex = ETH_LINK_FULL_DUPLEX;
> > -		link.link_speed = ETH_SPEED_NUM_100M;
> >  		break;
> >
> >  	case IXGBE_LINK_SPEED_100_FULL:
> > --
> > 1.8.3.1

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 97e1021..0aef577 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2701,6 +2701,10 @@  static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 		allowed_speeds = ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G |
 			ETH_LINK_SPEED_2_5G |  ETH_LINK_SPEED_5G |
 			ETH_LINK_SPEED_10G;
+		if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
+				hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L)
+			allowed_speeds = ETH_LINK_SPEED_10M |
+				ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G;
 		break;
 	default:
 		allowed_speeds = ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G |
@@ -2742,6 +2746,8 @@  static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 			speed |= IXGBE_LINK_SPEED_1GB_FULL;
 		if (*link_speeds & ETH_LINK_SPEED_100M)
 			speed |= IXGBE_LINK_SPEED_100_FULL;
+		if (*link_speeds & ETH_LINK_SPEED_10M)
+			speed |= IXGBE_LINK_SPEED_10_FULL;
 	}
 
 	err = ixgbe_setup_link(hw, speed, link_up);
@@ -4061,8 +4067,12 @@  static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 	switch (link_speed) {
 	default:
 	case IXGBE_LINK_SPEED_UNKNOWN:
+		if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
+			hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L)
+			link.link_speed = ETH_SPEED_NUM_10M;
+		else
+			link.link_speed = ETH_SPEED_NUM_100M;
 		link.link_duplex = ETH_LINK_FULL_DUPLEX;
-		link.link_speed = ETH_SPEED_NUM_100M;
 		break;
 
 	case IXGBE_LINK_SPEED_100_FULL: