[dpdk-dev] net/ixgbe: allow for setting 2.5G and 5G speeds on X550
Checks
Commit Message
This patch adds support for explicitly selecting 2.5G and 5G speeds on
X550.
Signed-off-by: Martin Weiser <martin.weiser@allegro-packets.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
Comments
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Martin Weiser
> Sent: Friday, January 26, 2018 5:30 PM
> To: Lu, Wenzhuo; Ananyev, Konstantin
> Cc: dev@dpdk.org; Martin Weiser
> Subject: [dpdk-dev] [PATCH] net/ixgbe: allow for setting 2.5G and 5G speeds on
> X550
>
> This patch adds support for explicitly selecting 2.5G and 5G speeds on X550.
>
> Signed-off-by: Martin Weiser <martin.weiser@allegro-packets.com>
It is a bit late for 18.02, I'd prefer to defer it to 18.05, after being well reviewed. Thanks!
/Helin
Hi,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Martin Weiser
> Sent: Friday, January 26, 2018 5:30 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Cc: dev@dpdk.org; Martin Weiser <martin.weiser@allegro-packets.com>
> Subject: [dpdk-dev] [PATCH] net/ixgbe: allow for setting 2.5G and 5G speeds
> on X550
>
> This patch adds support for explicitly selecting 2.5G and 5G speeds on X550.
>
> Signed-off-by: Martin Weiser <martin.weiser@allegro-packets.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Lu, Wenzhuo
> Sent: Monday, April 9, 2018 8:49 AM
> To: Martin Weiser; Ananyev, Konstantin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: allow for setting 2.5G and 5G
> speeds on X550
>
> Hi,
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Martin Weiser
> > Sent: Friday, January 26, 2018 5:30 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>
> > Cc: dev@dpdk.org; Martin Weiser <martin.weiser@allegro-packets.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbe: allow for setting 2.5G and 5G
> > speeds on X550
> >
> > This patch adds support for explicitly selecting 2.5G and 5G speeds on X550.
> >
> > Signed-off-by: Martin Weiser <martin.weiser@allegro-packets.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Applied to dpdk-next-net-intel, thanks!
/Helin
@@ -2480,6 +2480,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
uint32_t intr_vector = 0;
int err, link_up = 0, negotiate = 0;
uint32_t speed = 0;
+ uint32_t allowed_speeds = 0;
int mask = 0;
int status;
uint16_t vf, idx;
@@ -2628,9 +2629,21 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
if (err)
goto error;
+ switch (hw->mac.type) {
+ case ixgbe_mac_X550:
+ case ixgbe_mac_X550EM_x:
+ case ixgbe_mac_X550EM_a:
+ allowed_speeds = ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G |
+ ETH_LINK_SPEED_2_5G | ETH_LINK_SPEED_5G |
+ ETH_LINK_SPEED_10G;
+ break;
+ default:
+ allowed_speeds = ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G |
+ ETH_LINK_SPEED_10G;
+ }
+
link_speeds = &dev->data->dev_conf.link_speeds;
- if (*link_speeds & ~(ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G |
- ETH_LINK_SPEED_10G)) {
+ if (*link_speeds & ~allowed_speeds) {
PMD_INIT_LOG(ERR, "Invalid link setting");
goto error;
}
@@ -2656,6 +2669,10 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
} else {
if (*link_speeds & ETH_LINK_SPEED_10G)
speed |= IXGBE_LINK_SPEED_10GB_FULL;
+ if (*link_speeds & ETH_LINK_SPEED_5G)
+ speed |= IXGBE_LINK_SPEED_5GB_FULL;
+ if (*link_speeds & ETH_LINK_SPEED_2_5G)
+ speed |= IXGBE_LINK_SPEED_2_5GB_FULL;
if (*link_speeds & ETH_LINK_SPEED_1G)
speed |= IXGBE_LINK_SPEED_1GB_FULL;
if (*link_speeds & ETH_LINK_SPEED_100M)