Hi Wei,

> -----Original Message-----
> From: Dai, Wei
> Sent: Wednesday, July 26, 2017 5:30 AM
> To: Lu, Wenzhuo <wenzhuo...@intel.com>; Ananyev, Konstantin
> <konstantin.anan...@intel.com>
> Cc: dev@dpdk.org; Dai, Wei <wei....@intel.com>
> Subject: [PATCH v2] net/ixgbe: add support of 2.5G and 5G on X550
> 
> This patch adds support of 2.5G and 5G ethernet interface on X550.
> 
> Signed-off-by: Wei Dai <wei....@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 33 ++++++++++++++++++++++++++++++--
> -
>  1 file changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 194058f..60e1d5a 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2647,9 +2647,28 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
> 
>       speed = 0x0;
>       if (*link_speeds == ETH_LINK_SPEED_AUTONEG) {
> -             speed = (hw->mac.type != ixgbe_mac_82598EB) ?
> -                             IXGBE_LINK_SPEED_82599_AUTONEG :
> -                             IXGBE_LINK_SPEED_82598_AUTONEG;
> +             switch (hw->mac.type) {
> +             case ixgbe_mac_82598EB:
> +                     speed = IXGBE_LINK_SPEED_82598_AUTONEG;
> +                     break;
> +
> +             case ixgbe_mac_82599EB:
> +             case ixgbe_mac_X540:
> +                     speed = IXGBE_LINK_SPEED_82599_AUTONEG;
> +                     break;
> +
> +             case ixgbe_mac_X550:
> +             case ixgbe_mac_X550EM_x:
> +             case ixgbe_mac_X550EM_a:
> +                     speed = IXGBE_LINK_SPEED_100_FULL |
> +                             IXGBE_LINK_SPEED_1GB_FULL |
> +                             IXGBE_LINK_SPEED_10GB_FULL |
> +                             IXGBE_LINK_SPEED_2_5GB_FULL |
> +                             IXGBE_LINK_SPEED_5GB_FULL;
Thanks for the patch. It looks good to me. A suggestion, why not define a macro 
like IXGBE_LINK_SPEED_82599_AUTONEG for x550?

> +                     break;
> +             default:
> +                     speed = IXGBE_LINK_SPEED_82599_AUTONEG;
> +             }
>       } else {
>               if (*link_speeds & ETH_LINK_SPEED_10G)
>                       speed |= IXGBE_LINK_SPEED_10GB_FULL; @@ -
> 3972,6 +3991,14 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
>               link.link_speed = ETH_SPEED_NUM_1G;
>               break;
> 
> +     case IXGBE_LINK_SPEED_2_5GB_FULL:
> +             link.link_speed = ETH_SPEED_NUM_2_5G;
> +             break;
> +
> +     case IXGBE_LINK_SPEED_5GB_FULL:
> +             link.link_speed = ETH_SPEED_NUM_5G;
> +             break;
> +
>       case IXGBE_LINK_SPEED_10GB_FULL:
>               link.link_speed = ETH_SPEED_NUM_10G;
>               break;
> --
> 2.7.5

Reply via email to