net/ixgbe: support 2.5G and 5G on X550
authorWei Dai <wei.dai@intel.com>
Mon, 31 Jul 2017 18:12:11 +0000 (02:12 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 31 Jul 2017 18:13:13 +0000 (20:13 +0200)
This patch adds support of 2.5G and 5G ethernet interface on X550.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.h

index 492de87..22171d8 100644 (file)
@@ -2642,9 +2642,22 @@ 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_X550_AUTONEG;
+                       break;
+               default:
+                       speed = IXGBE_LINK_SPEED_82599_AUTONEG;
+               }
        } else {
                if (*link_speeds & ETH_LINK_SPEED_10G)
                        speed |= IXGBE_LINK_SPEED_10GB_FULL;
@@ -3688,6 +3701,10 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
            hw->mac.type == ixgbe_mac_X550_vf) {
                dev_info->speed_capa |= ETH_LINK_SPEED_100M;
        }
+       if (hw->mac.type == ixgbe_mac_X550) {
+               dev_info->speed_capa |= ETH_LINK_SPEED_2_5G;
+               dev_info->speed_capa |= ETH_LINK_SPEED_5G;
+       }
 }
 
 static const uint32_t *
@@ -3967,6 +3984,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;
index 9e6ffc0..caa50c8 100644 (file)
@@ -33,6 +33,7 @@
 
 #ifndef _IXGBE_ETHDEV_H_
 #define _IXGBE_ETHDEV_H_
+#include "base/ixgbe_type.h"
 #include "base/ixgbe_dcb.h"
 #include "base/ixgbe_dcb_82599.h"
 #include "base/ixgbe_dcb_82598.h"
                return -ENOTSUP;\
 } while (0)
 
+/* Link speed for X550 auto negotiation */
+#define IXGBE_LINK_SPEED_X550_AUTONEG  (IXGBE_LINK_SPEED_100_FULL | \
+                                        IXGBE_LINK_SPEED_1GB_FULL | \
+                                        IXGBE_LINK_SPEED_2_5GB_FULL | \
+                                        IXGBE_LINK_SPEED_5GB_FULL | \
+                                        IXGBE_LINK_SPEED_10GB_FULL)
+
 /*
  * Information about the fdir mode.
  */