net/liquidio: set device speed capability info
authorShijith Thotton <shijith.thotton@caviumnetworks.com>
Thu, 25 May 2017 09:24:18 +0000 (14:54 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 12 Jun 2017 09:41:26 +0000 (10:41 +0100)
Add subsystem device id of CN23xx cards and expose speed capability of
devices. Update liquidio feature file to mark support.

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
doc/guides/nics/features/liquidio.ini
drivers/net/liquidio/base/lio_hw_defs.h
drivers/net/liquidio/lio_ethdev.c

index 49cc356..3bea03a 100644 (file)
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
 Link status event    = Y
 Jumbo frame          = Y
index 67eaa45..de58c7c 100644 (file)
 
 #define LIO_CN23XX_VF_VID      0x9712
 
+/* CN23xx subsystem device ids */
+#define PCI_SUBSYS_DEV_ID_CN2350_210   0x0004
+#define PCI_SUBSYS_DEV_ID_CN2360_210   0x0005
+#define PCI_SUBSYS_DEV_ID_CN2360_225   0x0006
+#define PCI_SUBSYS_DEV_ID_CN2350_225   0x0007
+
 /* --------------------------CONFIG VALUES------------------------ */
 
 /* CN23xx IQ configuration macros */
index 6fce88f..94caa90 100644 (file)
@@ -394,6 +394,25 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
                 struct rte_eth_dev_info *devinfo)
 {
        struct lio_device *lio_dev = LIO_DEV(eth_dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+
+       devinfo->pci_dev = pci_dev;
+
+       switch (pci_dev->id.subsystem_device_id) {
+       /* CN23xx 10G cards */
+       case PCI_SUBSYS_DEV_ID_CN2350_210:
+       case PCI_SUBSYS_DEV_ID_CN2360_210:
+               devinfo->speed_capa = ETH_LINK_SPEED_10G;
+               break;
+       /* CN23xx 25G cards */
+       case PCI_SUBSYS_DEV_ID_CN2350_225:
+       case PCI_SUBSYS_DEV_ID_CN2360_225:
+               devinfo->speed_capa = ETH_LINK_SPEED_25G;
+               break;
+       default:
+               lio_dev_err(lio_dev,
+                           "Unknown CN23XX subsystem device id. Not setting speed capability.\n");
+       }
 
        devinfo->max_rx_queues = lio_dev->max_rx_queues;
        devinfo->max_tx_queues = lio_dev->max_tx_queues;