New upstream version 17.08
[deb_dpdk.git] / drivers / net / cxgbe / cxgbe_ethdev.c
index 598a744..7bca456 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2014-2016 Chelsio Communications.
+ *   Copyright(c) 2014-2017 Chelsio Communications.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -58,7 +58,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 +103,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;
                }
@@ -148,7 +148,7 @@ static void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,
                .nb_align = 1,
        };
 
-       device_info->pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
+       device_info->pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
        device_info->min_rx_bufsize = CXGBE_MIN_RX_BUFSIZE;
        device_info->max_rx_pktlen = CXGBE_MAX_RX_PKTLEN;
@@ -174,7 +174,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)
@@ -619,7 +619,7 @@ static int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 
        err = t4_sge_alloc_rxq(adapter, &rxq->rspq, false, eth_dev, msi_idx,
                               &rxq->fl, t4_ethrx_handler,
-                              t4_get_mps_bg_map(adapter, pi->tx_chan), mp,
+                              t4_get_tp_ch_map(adapter, pi->tx_chan), mp,
                               queue_idx, socket_id);
 
        dev_debug(adapter, "%s: err = %d; port_id = %d; cntxt_id = %u\n",
@@ -1010,7 +1010,7 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev)
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return 0;
 
-       pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
+       pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
        snprintf(name, sizeof(name), "cxgbeadapter%d", eth_dev->data->port_id);
        adapter = rte_zmalloc(name, sizeof(*adapter), 0);
@@ -1056,7 +1056,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,
 };