ethdev: initialize more fields on allocation
[dpdk.git] / drivers / net / cxgbe / cxgbe_main.c
index 684a761..9e8402b 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2014-2015 Chelsio Communications.
+ *   Copyright(c) 2014-2016 Chelsio Communications.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -1150,7 +1150,7 @@ int cxgbe_probe(struct adapter *adapter)
                 */
 
                /* reserve an ethdev entry */
-               pi->eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI);
+               pi->eth_dev = rte_eth_dev_allocate(name);
                if (!pi->eth_dev)
                        goto out_free;
 
@@ -1169,7 +1169,8 @@ allocate_mac:
                pi->eth_dev->dev_ops = adapter->eth_dev->dev_ops;
                pi->eth_dev->tx_pkt_burst = adapter->eth_dev->tx_pkt_burst;
                pi->eth_dev->rx_pkt_burst = adapter->eth_dev->rx_pkt_burst;
-               TAILQ_INIT(&pi->eth_dev->link_intr_cbs);
+
+               rte_eth_copy_pci_info(pi->eth_dev, pi->eth_dev->pci_dev);
 
                pi->eth_dev->data->mac_addrs = rte_zmalloc(name,
                                                           ETHER_ADDR_LEN, 0);