#define ETH_RING_ACTION_CREATE "CREATE"
#define ETH_RING_ACTION_ATTACH "ATTACH"
+static const char *ring_ethdev_driver_name = "Ring PMD";
+
static const char *valid_arguments[] = {
ETH_RING_NUMA_NODE_ACTION_ARG,
NULL
struct ring_queue rx_ring_queues[RTE_PMD_RING_MAX_RX_RINGS];
struct ring_queue tx_ring_queues[RTE_PMD_RING_MAX_TX_RINGS];
+
+ struct ether_addr address;
};
-static struct ether_addr eth_addr = { .addr_bytes = {0} };
static const char *drivername = "Rings PMD";
static struct rte_eth_link pmd_link = {
.link_speed = 10000,
struct rte_pci_device *pci_dev = NULL;
struct pmd_internals *internals = NULL;
struct rte_eth_dev *eth_dev = NULL;
+ struct eth_driver *eth_drv = NULL;
+ struct rte_pci_id *id_table = NULL;
+
unsigned i;
/* do some parameter checking */
if (pci_dev == NULL)
goto error;
+ id_table = rte_zmalloc_socket(name, sizeof(*id_table), 0, numa_node);
+ if (id_table == NULL)
+ goto error;
+
internals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);
if (internals == NULL)
goto error;
if (eth_dev == NULL)
goto error;
+ eth_drv = rte_zmalloc_socket(name, sizeof(*eth_drv), 0, numa_node);
+ if (eth_drv == NULL)
+ goto error;
+
/* now put it all together
* - store queue data in internals,
* - store numa_node info in pci_driver
internals->tx_ring_queues[i].rng = tx_queues[i];
}
+ eth_drv->pci_drv.name = ring_ethdev_driver_name;
+ eth_drv->pci_drv.id_table = id_table;
+
pci_dev->numa_node = numa_node;
+ pci_dev->driver = ð_drv->pci_drv;
data->dev_private = internals;
data->port_id = eth_dev->data->port_id;
data->nb_rx_queues = (uint16_t)nb_rx_queues;
data->nb_tx_queues = (uint16_t)nb_tx_queues;
data->dev_link = pmd_link;
- data->mac_addrs = ð_addr;
+ data->mac_addrs = &internals->address;
- eth_dev ->data = data;
- eth_dev ->dev_ops = &ops;
- eth_dev ->pci_dev = pci_dev;
+ eth_dev->data = data;
+ eth_dev->driver = eth_drv;
+ eth_dev->dev_ops = &ops;
+ eth_dev->pci_dev = pci_dev;
+ TAILQ_INIT(&(eth_dev->callbacks));
/* finally assign rx and tx ops */
eth_dev->rx_pkt_burst = eth_ring_rx;