pci: introduce library and driver
[dpdk.git] / drivers / net / cxgbe / cxgbe_ethdev.c
index 3fae185..b1405e5 100644 (file)
@@ -48,6 +48,7 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_pci.h>
+#include <rte_bus_pci.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
@@ -58,7 +59,6 @@
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_dev.h>
@@ -104,7 +104,8 @@ static uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                pkts_remain = nb_pkts - total_sent;
 
                for (pkts_sent = 0; pkts_sent < pkts_remain; pkts_sent++) {
-                       ret = t4_eth_xmit(txq, tx_pkts[total_sent + pkts_sent]);
+                       ret = t4_eth_xmit(txq, tx_pkts[total_sent + pkts_sent],
+                                         nb_pkts);
                        if (ret < 0)
                                break;
                }
@@ -174,7 +175,7 @@ static void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,
 
        device_info->rx_desc_lim = cxgbe_desc_lim;
        device_info->tx_desc_lim = cxgbe_desc_lim;
-       device_info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_40G;
+       cxgbe_get_speed_caps(pi, &device_info->speed_capa);
 }
 
 static void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)
@@ -338,6 +339,8 @@ static int cxgbe_dev_start(struct rte_eth_dev *eth_dev)
                        goto out;
        }
 
+       cxgbe_enable_rx_queues(pi);
+
        err = setup_rss(pi);
        if (err)
                goto out;
@@ -645,7 +648,7 @@ static void cxgbe_dev_rx_queue_release(void *q)
 /*
  * Get port statistics.
  */
-static void cxgbe_dev_stats_get(struct rte_eth_dev *eth_dev,
+static int cxgbe_dev_stats_get(struct rte_eth_dev *eth_dev,
                                struct rte_eth_stats *eth_stats)
 {
        struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private);
@@ -688,6 +691,7 @@ static void cxgbe_dev_stats_get(struct rte_eth_dev *eth_dev,
                eth_stats->q_obytes[i] = txq->stats.tx_bytes;
                eth_stats->q_errors[i] = txq->stats.mapping_err;
        }
+       return 0;
 }
 
 /*
@@ -1054,7 +1058,7 @@ static int eth_cxgbe_pci_remove(struct rte_pci_device *pci_dev)
 
 static struct rte_pci_driver rte_cxgbe_pmd = {
        .id_table = cxgb4_pci_tbl,
-       .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+       .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
        .probe = eth_cxgbe_pci_probe,
        .remove = eth_cxgbe_pci_remove,
 };