net/sfc: support link speeds up to 100G
authorAndrew Rybchenko <arybchenko@solarflare.com>
Wed, 21 Mar 2018 13:51:30 +0000 (13:51 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:44 +0000 (14:08 +0200)
Add 25G, 50G and 100G.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
drivers/net/sfc/sfc.c
drivers/net/sfc/sfc_ethdev.c
drivers/net/sfc/sfc_port.c

index e2ba720..e456bca 100644 (file)
@@ -82,14 +82,23 @@ sfc_phy_cap_from_link_speeds(uint32_t speeds)
                        phy_caps |=
                                (1 << EFX_PHY_CAP_1000FDX) |
                                (1 << EFX_PHY_CAP_10000FDX) |
-                               (1 << EFX_PHY_CAP_40000FDX);
+                               (1 << EFX_PHY_CAP_25000FDX) |
+                               (1 << EFX_PHY_CAP_40000FDX) |
+                               (1 << EFX_PHY_CAP_50000FDX) |
+                               (1 << EFX_PHY_CAP_100000FDX);
        }
        if (speeds & ETH_LINK_SPEED_1G)
                phy_caps |= (1 << EFX_PHY_CAP_1000FDX);
        if (speeds & ETH_LINK_SPEED_10G)
                phy_caps |= (1 << EFX_PHY_CAP_10000FDX);
+       if (speeds & ETH_LINK_SPEED_25G)
+               phy_caps |= (1 << EFX_PHY_CAP_25000FDX);
        if (speeds & ETH_LINK_SPEED_40G)
                phy_caps |= (1 << EFX_PHY_CAP_40000FDX);
+       if (speeds & ETH_LINK_SPEED_50G)
+               phy_caps |= (1 << EFX_PHY_CAP_50000FDX);
+       if (speeds & ETH_LINK_SPEED_100G)
+               phy_caps |= (1 << EFX_PHY_CAP_100000FDX);
 
        return phy_caps;
 }
index e140f8f..b1cacc2 100644 (file)
@@ -98,8 +98,14 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                dev_info->speed_capa |= ETH_LINK_SPEED_1G;
        if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_10000FDX)
                dev_info->speed_capa |= ETH_LINK_SPEED_10G;
+       if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_25000FDX)
+               dev_info->speed_capa |= ETH_LINK_SPEED_25G;
        if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_40000FDX)
                dev_info->speed_capa |= ETH_LINK_SPEED_40G;
+       if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_50000FDX)
+               dev_info->speed_capa |= ETH_LINK_SPEED_50G;
+       if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_100000FDX)
+               dev_info->speed_capa |= ETH_LINK_SPEED_100G;
 
        dev_info->max_rx_queues = sa->rxq_max;
        dev_info->max_tx_queues = sa->txq_max;
index 0272b55..fd267e1 100644 (file)
@@ -474,10 +474,22 @@ sfc_port_link_mode_to_info(efx_link_mode_t link_mode,
                link_info->link_speed  = ETH_SPEED_NUM_10G;
                link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
                break;
+       case EFX_LINK_25000FDX:
+               link_info->link_speed  = ETH_SPEED_NUM_25G;
+               link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
+               break;
        case EFX_LINK_40000FDX:
                link_info->link_speed  = ETH_SPEED_NUM_40G;
                link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
                break;
+       case EFX_LINK_50000FDX:
+               link_info->link_speed  = ETH_SPEED_NUM_50G;
+               link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
+               break;
+       case EFX_LINK_100000FDX:
+               link_info->link_speed  = ETH_SPEED_NUM_100G;
+               link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
+               break;
        default:
                SFC_ASSERT(B_FALSE);
                /* FALLTHROUGH */