drivers: copy fake PCI device info to ethdev data
[dpdk.git] / drivers / net / af_packet / rte_eth_af_packet.c
index cac26e5..c7d5522 100644 (file)
@@ -5,7 +5,7 @@
  *
  *   Originally based upon librte_pmd_pcap code:
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   Copyright(c) 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -220,7 +220,8 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
        }
 
        /* kick-off transmits */
-       sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0);
+       if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1)
+               return 0; /* error sending -- no packets transmitted */
 
        pkt_q->framenum = framenum;
        pkt_q->tx_pkts += num_tx;
@@ -655,8 +656,8 @@ rte_pmd_init_internals(const char *name,
        /*
         * now put it all together
         * - store queue data in internals,
-        * - store numa_node info in pci_driver
-        * - point eth_dev_data to internals and pci_driver
+        * - store numa_node in eth_dev
+        * - point eth_dev_data to internals
         * - and point eth_dev structure to new eth_dev_data structure
         */
 
@@ -674,6 +675,11 @@ rte_pmd_init_internals(const char *name,
        (*eth_dev)->data = data;
        (*eth_dev)->dev_ops = &ops;
        (*eth_dev)->pci_dev = pci_dev;
+       (*eth_dev)->driver = NULL;
+       (*eth_dev)->data->dev_flags = 0;
+       (*eth_dev)->data->drv_name = drivername;
+       (*eth_dev)->data->kdrv = RTE_KDRV_NONE;
+       (*eth_dev)->data->numa_node = numa_node;
 
        return 0;