From: Keith Wiles <keith.wiles@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [RFC PATCH 3/4 v2] Add the test file changes for common device support
Date: Mon, 13 Apr 2015 14:44:33 -0500 [thread overview]
Message-ID: <1428954274-26944-4-git-send-email-keith.wiles@intel.com> (raw)
In-Reply-To: <1428954274-26944-1-git-send-email-keith.wiles@intel.com>
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
---
app/test-pmd/config.c | 6 +-
app/test-pmd/testpmd.h | 4 +-
app/test/test_kni.c | 12 ++--
app/test/test_link_bonding.c | 24 ++++----
app/test/virtual_pmd.c | 106 +++++++++++++++++-----------------
examples/link_status_interrupt/main.c | 6 +-
6 files changed, 79 insertions(+), 79 deletions(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index f788ed5..6e70add 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -415,7 +415,7 @@ port_reg_off_is_invalid(portid_t port_id, uint32_t reg_off)
(unsigned)reg_off);
return 1;
}
- pci_len = ports[port_id].dev_info.pci_dev->mem_resource[0].len;
+ pci_len = ports[port_id].dev_info.di.pci_dev->mem_resource[0].len;
if (reg_off >= pci_len) {
printf("Port %d: register offset %u (0x%X) out of port PCI "
"resource (length=%"PRIu64")\n",
@@ -641,7 +641,7 @@ ring_dma_zone_lookup(const char *ring_name, uint8_t port_id, uint16_t q_id)
const struct rte_memzone *mz;
snprintf(mz_name, sizeof(mz_name), "%s_%s_%d_%d",
- ports[port_id].dev_info.driver_name, ring_name, port_id, q_id);
+ ports[port_id].dev_info.di.driver_name, ring_name, port_id, q_id);
mz = rte_memzone_lookup(mz_name);
if (mz == NULL)
printf("%s ring memory zoneof (port %d, queue %d) not"
@@ -698,7 +698,7 @@ ring_rx_descriptor_display(const struct rte_memzone *ring_mz,
memset(&dev_info, 0, sizeof(dev_info));
rte_eth_dev_info_get(port_id, &dev_info);
- if (strstr(dev_info.driver_name, "i40e") != NULL) {
+ if (strstr(dev_info.di.driver_name, "i40e") != NULL) {
/* 32 bytes RX descriptor, i40e only */
struct igb_ring_desc_32_bytes *ring =
(struct igb_ring_desc_32_bytes *)ring_mz->addr;
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 389fc24..af4e280 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -438,7 +438,7 @@ port_pci_reg_read(struct rte_port *port, uint32_t reg_off)
uint32_t reg_v;
reg_addr = (void *)
- ((char *)port->dev_info.pci_dev->mem_resource[0].addr +
+ ((char *)port->dev_info.di.pci_dev->mem_resource[0].addr +
reg_off);
reg_v = *((volatile uint32_t *)reg_addr);
return rte_le_to_cpu_32(reg_v);
@@ -453,7 +453,7 @@ port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v)
void *reg_addr;
reg_addr = (void *)
- ((char *)port->dev_info.pci_dev->mem_resource[0].addr +
+ ((char *)port->dev_info.di.pci_dev->mem_resource[0].addr +
reg_off);
*((volatile uint32_t *)reg_addr) = rte_cpu_to_le_32(reg_v);
}
diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 608901d..456dd65 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -387,8 +387,8 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp)
memset(&ops, 0, sizeof(ops));
rte_eth_dev_info_get(port_id, &info);
- conf.addr = info.pci_dev->addr;
- conf.id = info.pci_dev->id;
+ conf.addr = info.di.pci_dev->addr;
+ conf.id = info.di.pci_dev->id;
snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT);
/* core id 1 configured for kernel thread */
@@ -555,8 +555,8 @@ test_kni(void)
memset(&conf, 0, sizeof(conf));
memset(&ops, 0, sizeof(ops));
rte_eth_dev_info_get(port_id, &info);
- conf.addr = info.pci_dev->addr;
- conf.id = info.pci_dev->id;
+ conf.addr = info.di.pci_dev->addr;
+ conf.id = info.di.pci_dev->id;
conf.group_id = (uint16_t)port_id;
conf.mbuf_size = MAX_PACKET_SZ;
@@ -584,8 +584,8 @@ test_kni(void)
memset(&info, 0, sizeof(info));
memset(&ops, 0, sizeof(ops));
rte_eth_dev_info_get(port_id, &info);
- conf.addr = info.pci_dev->addr;
- conf.id = info.pci_dev->id;
+ conf.addr = info.di.pci_dev->addr;
+ conf.id = info.di.pci_dev->id;
conf.group_id = (uint16_t)port_id;
conf.mbuf_size = MAX_PACKET_SZ;
diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 8c24314..20e74c3 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -1179,7 +1179,7 @@ int test_lsc_interrupt_count;
static void
test_bonding_lsc_event_callback(uint8_t port_id __rte_unused,
- enum rte_eth_event_type type __rte_unused, void *param __rte_unused)
+ enum rte_dev_event_type type __rte_unused, void *param __rte_unused)
{
pthread_mutex_lock(&mutex);
test_lsc_interrupt_count++;
@@ -1231,7 +1231,7 @@ test_status_interrupt(void)
/* register link status change interrupt callback */
rte_eth_dev_callback_register(test_params->bonded_port_id,
- RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
+ RTE_DEV_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
&test_params->bonded_port_id);
slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
@@ -1298,7 +1298,7 @@ test_status_interrupt(void)
/* unregister lsc callback before exiting */
rte_eth_dev_callback_unregister(test_params->bonded_port_id,
- RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
+ RTE_DEV_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
&test_params->bonded_port_id);
/* Clean up and remove slaves from bonded device */
@@ -2031,7 +2031,7 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void)
/* Register link status change interrupt callback */
rte_eth_dev_callback_register(test_params->bonded_port_id,
- RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
+ RTE_DEV_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
&test_params->bonded_port_id);
/* link status change callback for first slave link up */
@@ -2059,7 +2059,7 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void)
/* Un-Register link status change interrupt callback */
rte_eth_dev_callback_unregister(test_params->bonded_port_id,
- RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
+ RTE_DEV_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
&test_params->bonded_port_id);
@@ -4590,7 +4590,7 @@ test_alb_change_mac_in_reply_sent(void)
}
ether_addr_copy(
- rte_eth_devices[test_params->bonded_port_id].data->mac_addrs,
+ ETH_DATA(&rte_eth_devices[test_params->bonded_port_id])->mac_addrs,
&bond_mac);
/*
@@ -4638,9 +4638,9 @@ test_alb_change_mac_in_reply_sent(void)
rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
slave_mac1 =
- rte_eth_devices[test_params->slave_port_ids[0]].data->mac_addrs;
+ ETH_DATA(&rte_eth_devices[test_params->slave_port_ids[0]])->mac_addrs;
slave_mac2 =
- rte_eth_devices[test_params->slave_port_ids[1]].data->mac_addrs;
+ ETH_DATA(&rte_eth_devices[test_params->slave_port_ids[1]])->mac_addrs;
/*
* Checking if packets are properly distributed on bonding ports. Packets
@@ -4703,7 +4703,7 @@ test_alb_reply_from_client(void)
}
ether_addr_copy(
- rte_eth_devices[test_params->bonded_port_id].data->mac_addrs,
+ ETH_DATA(&rte_eth_devices[test_params->bonded_port_id])->mac_addrs,
&bond_mac);
/*
@@ -4761,8 +4761,8 @@ test_alb_reply_from_client(void)
rte_eth_rx_burst(test_params->bonded_port_id, 0, pkts_sent, MAX_PKT_BURST);
rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0);
- slave_mac1 = rte_eth_devices[test_params->slave_port_ids[0]].data->mac_addrs;
- slave_mac2 = rte_eth_devices[test_params->slave_port_ids[1]].data->mac_addrs;
+ slave_mac1 = ETH_DATA(&rte_eth_devices[test_params->slave_port_ids[0]])->mac_addrs;
+ slave_mac2 = ETH_DATA(&rte_eth_devices[test_params->slave_port_ids[1]])->mac_addrs;
/*
* Checking if update ARP packets were properly send on slave ports.
@@ -4830,7 +4830,7 @@ test_alb_receive_vlan_reply(void)
}
ether_addr_copy(
- rte_eth_devices[test_params->bonded_port_id].data->mac_addrs,
+ ETH_DATA(&rte_eth_devices[test_params->bonded_port_id])->mac_addrs,
&bond_mac);
/*
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index f163562..6c290a2 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -61,7 +61,7 @@ struct virtual_ethdev_queue {
static int
virtual_ethdev_start_success(struct rte_eth_dev *eth_dev __rte_unused)
{
- eth_dev->data->dev_started = 1;
+ ETH_DATA(eth_dev)->dev_started = 1;
return 0;
}
@@ -69,17 +69,17 @@ virtual_ethdev_start_success(struct rte_eth_dev *eth_dev __rte_unused)
static int
virtual_ethdev_start_fail(struct rte_eth_dev *eth_dev __rte_unused)
{
- eth_dev->data->dev_started = 0;
+ ETH_DATA(eth_dev)->dev_started = 0;
return -1;
}
static void virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused)
{
void *pkt = NULL;
- struct virtual_ethdev_private *prv = eth_dev->data->dev_private;
+ struct virtual_ethdev_private *prv = _DD_PRIVATE(eth_dev);
- eth_dev->data->dev_link.link_status = 0;
- eth_dev->data->dev_started = 0;
+ ETH_DATA(eth_dev)->dev_link.link_status = 0;
+ ETH_DATA(eth_dev)->dev_started = 0;
while (rte_ring_dequeue(prv->rx_queue, &pkt) != -ENOENT)
rte_pktmbuf_free(pkt);
@@ -107,7 +107,7 @@ static void
virtual_ethdev_info_get(struct rte_eth_dev *dev __rte_unused,
struct rte_eth_dev_info *dev_info)
{
- dev_info->driver_name = virtual_ethdev_driver_name;
+ dev_info->di.driver_name = virtual_ethdev_driver_name;
dev_info->max_mac_addrs = 1;
dev_info->max_rx_pktlen = (uint32_t)2048;
@@ -116,7 +116,7 @@ virtual_ethdev_info_get(struct rte_eth_dev *dev __rte_unused,
dev_info->max_tx_queues = (uint16_t)512;
dev_info->min_rx_bufsize = 0;
- dev_info->pci_dev = NULL;
+ dev_info->di.pci_dev = NULL;
}
static int
@@ -134,10 +134,10 @@ virtual_ethdev_rx_queue_setup_success(struct rte_eth_dev *dev,
if (rx_q == NULL)
return -1;
- rx_q->port_id = dev->data->port_id;
+ rx_q->port_id = _DD_PORT(dev);
rx_q->queue_id = rx_queue_id;
- dev->data->rx_queues[rx_queue_id] = rx_q;
+ _DD(dev, rx_queues[rx_queue_id]) = rx_q;
return 0;
}
@@ -166,10 +166,10 @@ virtual_ethdev_tx_queue_setup_success(struct rte_eth_dev *dev,
if (tx_q == NULL)
return -1;
- tx_q->port_id = dev->data->port_id;
+ tx_q->port_id = _DD_PORT(dev);
tx_q->queue_id = tx_queue_id;
- dev->data->tx_queues[tx_queue_id] = tx_q;
+ _DD(dev, tx_queues[tx_queue_id]) = tx_q;
return 0;
}
@@ -197,8 +197,8 @@ static int
virtual_ethdev_link_update_success(struct rte_eth_dev *bonded_eth_dev,
int wait_to_complete __rte_unused)
{
- if (!bonded_eth_dev->data->dev_started)
- bonded_eth_dev->data->dev_link.link_status = 0;
+ if (!ETH_DATA(bonded_eth_dev)->dev_started)
+ ETH_DATA(bonded_eth_dev)->dev_link.link_status = 0;
return 0;
}
@@ -213,7 +213,7 @@ virtual_ethdev_link_update_fail(struct rte_eth_dev *bonded_eth_dev __rte_unused,
static void
virtual_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
{
- struct virtual_ethdev_private *dev_private = dev->data->dev_private;
+ struct virtual_ethdev_private *dev_private = _DD_PRIVATE(dev);
if (stats)
rte_memcpy(stats, &dev_private->eth_stats, sizeof(*stats));
@@ -222,7 +222,7 @@ virtual_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
static void
virtual_ethdev_stats_reset(struct rte_eth_dev *dev)
{
- struct virtual_ethdev_private *dev_private = dev->data->dev_private;
+ struct virtual_ethdev_private *dev_private = _DD_PRIVATE(dev);
void *pkt = NULL;
while (rte_ring_dequeue(dev_private->tx_queue, &pkt) == -ENOBUFS)
@@ -265,9 +265,9 @@ virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success)
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
if (success)
- vrtl_eth_dev->dev_ops->dev_start = virtual_ethdev_start_success;
+ ETH_OPS(vrtl_eth_dev, dev_start) = virtual_ethdev_start_success;
else
- vrtl_eth_dev->dev_ops->dev_start = virtual_ethdev_start_fail;
+ ETH_OPS(vrtl_eth_dev, dev_start) = virtual_ethdev_start_fail;
}
@@ -277,9 +277,9 @@ virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success)
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
if (success)
- vrtl_eth_dev->dev_ops->dev_configure = virtual_ethdev_configure_success;
+ ETH_OPS(vrtl_eth_dev, dev_configure) = virtual_ethdev_configure_success;
else
- vrtl_eth_dev->dev_ops->dev_configure = virtual_ethdev_configure_fail;
+ ETH_OPS(vrtl_eth_dev, dev_configure) = virtual_ethdev_configure_fail;
}
void
@@ -288,10 +288,10 @@ virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success)
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
if (success)
- vrtl_eth_dev->dev_ops->rx_queue_setup =
+ ETH_OPS(vrtl_eth_dev, rx_queue_setup) =
virtual_ethdev_rx_queue_setup_success;
else
- vrtl_eth_dev->dev_ops->rx_queue_setup =
+ ETH_OPS(vrtl_eth_dev, rx_queue_setup) =
virtual_ethdev_rx_queue_setup_fail;
}
@@ -301,10 +301,10 @@ virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success)
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
if (success)
- vrtl_eth_dev->dev_ops->tx_queue_setup =
+ ETH_OPS(vrtl_eth_dev, tx_queue_setup) =
virtual_ethdev_tx_queue_setup_success;
else
- vrtl_eth_dev->dev_ops->tx_queue_setup =
+ ETH_OPS(vrtl_eth_dev, tx_queue_setup) =
virtual_ethdev_tx_queue_setup_fail;
}
@@ -314,9 +314,9 @@ virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success)
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
if (success)
- vrtl_eth_dev->dev_ops->link_update = virtual_ethdev_link_update_success;
+ ETH_OPS(vrtl_eth_dev, link_update) = virtual_ethdev_link_update_success;
else
- vrtl_eth_dev->dev_ops->link_update = virtual_ethdev_link_update_fail;
+ ETH_OPS(vrtl_eth_dev, link_update) = virtual_ethdev_link_update_fail;
}
@@ -333,7 +333,7 @@ virtual_ethdev_rx_burst_success(void *queue __rte_unused,
pq_map = (struct virtual_ethdev_queue *)queue;
vrtl_eth_dev = &rte_eth_devices[pq_map->port_id];
- dev_private = vrtl_eth_dev->data->dev_private;
+ dev_private = _DD_PRIVATE(vrtl_eth_dev);
rx_count = rte_ring_dequeue_burst(dev_private->rx_queue, (void **) bufs,
nb_pkts);
@@ -368,9 +368,9 @@ virtual_ethdev_tx_burst_success(void *queue, struct rte_mbuf **bufs,
int i;
vrtl_eth_dev = &rte_eth_devices[tx_q->port_id];
- dev_private = vrtl_eth_dev->data->dev_private;
+ dev_private = _DD_PRIVATE(vrtl_eth_dev);
- if (!vrtl_eth_dev->data->dev_link.link_status)
+ if (!ETH_DATA(vrtl_eth_dev)->dev_link.link_status)
nb_pkts = 0;
else
nb_pkts = rte_ring_enqueue_burst(dev_private->tx_queue, (void **)bufs,
@@ -398,7 +398,7 @@ virtual_ethdev_tx_burst_fail(void *queue, struct rte_mbuf **bufs,
tx_q = (struct virtual_ethdev_queue *)queue;
vrtl_eth_dev = &rte_eth_devices[tx_q->port_id];
- dev_private = vrtl_eth_dev->data->dev_private;
+ dev_private = _DD_PRIVATE(vrtl_eth_dev);
if (dev_private->tx_burst_fail_count < nb_pkts) {
int successfully_txd = nb_pkts - dev_private->tx_burst_fail_count;
@@ -440,7 +440,7 @@ virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success)
struct virtual_ethdev_private *dev_private = NULL;
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
- dev_private = vrtl_eth_dev->data->dev_private;
+ dev_private = _DD_PRIVATE(vrtl_eth_dev);
if (success)
vrtl_eth_dev->tx_pkt_burst = virtual_ethdev_tx_burst_success;
@@ -458,7 +458,7 @@ virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id,
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
- dev_private = vrtl_eth_dev->data->dev_private;
+ dev_private = _DD_PRIVATE(vrtl_eth_dev);
dev_private->tx_burst_fail_count = packet_fail_count;
}
@@ -467,7 +467,7 @@ virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status)
{
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
- vrtl_eth_dev->data->dev_link.link_status = link_status;
+ ETH_DATA(vrtl_eth_dev)->dev_link.link_status = link_status;
}
void
@@ -476,9 +476,9 @@ virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id,
{
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
- vrtl_eth_dev->data->dev_link.link_status = link_status;
+ ETH_DATA(vrtl_eth_dev)->dev_link.link_status = link_status;
- _rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC);
+ _rte_eth_dev_callback_process(vrtl_eth_dev, RTE_DEV_EVENT_INTR_LSC);
}
int
@@ -487,7 +487,7 @@ virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id,
{
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
struct virtual_ethdev_private *dev_private =
- vrtl_eth_dev->data->dev_private;
+ _DD_PRIVATE(vrtl_eth_dev);
return rte_ring_enqueue_burst(dev_private->rx_queue, (void **)pkt_burst,
burst_length);
@@ -500,7 +500,7 @@ virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id,
struct virtual_ethdev_private *dev_private;
struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id];
- dev_private = vrtl_eth_dev->data->dev_private;
+ dev_private = _DD_PRIVATE(vrtl_eth_dev);
return rte_ring_dequeue_burst(dev_private->tx_queue, (void **)pkt_burst,
burst_length);
}
@@ -580,7 +580,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
goto err;
/* reserve an ethdev entry */
- eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI);
+ eth_dev = rte_eth_dev_allocate(name, RTE_DEV_PCI);
if (eth_dev == NULL)
goto err;
@@ -597,34 +597,34 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
eth_drv->pci_drv = (struct rte_pci_driver)(*pci_drv);
eth_dev->driver = eth_drv;
- eth_dev->data->nb_rx_queues = (uint16_t)1;
- eth_dev->data->nb_tx_queues = (uint16_t)1;
+ _DD(eth_dev, nb_rx_queues) = (uint16_t)1;
+ _DD(eth_dev, nb_tx_queues) = (uint16_t)1;
TAILQ_INIT(&(eth_dev->link_intr_cbs));
- eth_dev->data->dev_link.link_status = 0;
- eth_dev->data->dev_link.link_speed = ETH_LINK_SPEED_10000;
- eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
+ ETH_DATA(eth_dev)->dev_link.link_status = 0;
+ ETH_DATA(eth_dev)->dev_link.link_speed = ETH_LINK_SPEED_10000;
+ ETH_DATA(eth_dev)->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
- eth_dev->data->mac_addrs = rte_zmalloc(name, ETHER_ADDR_LEN, 0);
- if (eth_dev->data->mac_addrs == NULL)
+ ETH_DATA(eth_dev)->mac_addrs = rte_zmalloc(name, ETHER_ADDR_LEN, 0);
+ if (ETH_DATA(eth_dev)->mac_addrs == NULL)
goto err;
- memcpy(eth_dev->data->mac_addrs, mac_addr,
- sizeof(*eth_dev->data->mac_addrs));
+ memcpy(ETH_DATA(eth_dev)->mac_addrs, mac_addr,
+ sizeof(*ETH_DATA(eth_dev)->mac_addrs));
- eth_dev->data->dev_started = 0;
- eth_dev->data->promiscuous = 0;
- eth_dev->data->scattered_rx = 0;
- eth_dev->data->all_multicast = 0;
+ ETH_DATA(eth_dev)->dev_started = 0;
+ ETH_DATA(eth_dev)->promiscuous = 0;
+ ETH_DATA(eth_dev)->scattered_rx = 0;
+ ETH_DATA(eth_dev)->all_multicast = 0;
- eth_dev->data->dev_private = dev_private;
+ _DD_PRIVATE(eth_dev) = dev_private;
eth_dev->dev_ops = dev_ops;
/* Copy default device operation functions */
memcpy(eth_dev->dev_ops, &virtual_ethdev_default_dev_ops,
- sizeof(*eth_dev->dev_ops));
+ sizeof(struct eth_dev_ops));
eth_dev->pci_dev = pci_dev;
eth_dev->pci_dev->driver = ð_drv->pci_drv;
@@ -634,7 +634,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
eth_dev->rx_pkt_burst = virtual_ethdev_rx_burst_success;
eth_dev->tx_pkt_burst = virtual_ethdev_tx_burst_success;
- return eth_dev->data->port_id;
+ return _DD_PORT(eth_dev);
err:
if (pci_dev)
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index e6fb218..9e31028 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -516,14 +516,14 @@ lsi_parse_args(int argc, char **argv)
* void.
*/
static void
-lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+lsi_event_callback(uint8_t port_id, enum rte_dev_event_type type, void *param)
{
struct rte_eth_link link;
RTE_SET_USED(param);
printf("\n\nIn registered callback...\n");
- printf("Event type: %s\n", type == RTE_ETH_EVENT_INTR_LSC ? "LSC interrupt" : "unknown event");
+ printf("Event type: %s\n", type == RTE_DEV_EVENT_INTR_LSC ? "LSC interrupt" : "unknown event");
rte_eth_link_get_nowait(port_id, &link);
if (link.link_status) {
printf("Port %d Link Up - speed %u Mbps - %s\n\n",
@@ -703,7 +703,7 @@ main(int argc, char **argv)
* be registered will never be called.
*/
rte_eth_dev_callback_register(portid,
- RTE_ETH_EVENT_INTR_LSC, lsi_event_callback, NULL);
+ RTE_DEV_EVENT_INTR_LSC, lsi_event_callback, NULL);
rte_eth_macaddr_get(portid,
&lsi_ports_eth_addr[portid]);
--
2.3.0
next prev parent reply other threads:[~2015-04-13 19:44 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-13 19:44 [dpdk-dev] [RFC PATCH 0/4 v2] Extending DPDK with multiple " Keith Wiles
2015-04-13 19:44 ` [dpdk-dev] [RFC PATCH 1/4 v2] Adding the common device files for " Keith Wiles
2015-05-04 13:13 ` Marc Sune
2015-05-04 14:44 ` Wiles, Keith
2015-04-13 19:44 ` [dpdk-dev] [RFC PATCH 2/4 v2] Add the ethdev changes " Keith Wiles
2015-04-13 19:44 ` Keith Wiles [this message]
2015-04-13 19:44 ` [dpdk-dev] [RFC PATCH 4/4 v2] Update PMD files for new common " Keith Wiles
2015-04-17 15:16 ` [dpdk-dev] [RFC PATCH 0/4] pktdev Bruce Richardson
2015-04-17 15:16 ` [dpdk-dev] [RFC PATCH 1/4] Add example pktdev implementation Bruce Richardson
2015-04-20 11:26 ` Ananyev, Konstantin
2015-04-20 15:02 ` Bruce Richardson
2015-04-21 8:40 ` Ananyev, Konstantin
2015-04-21 9:23 ` Bruce Richardson
2015-04-17 15:16 ` [dpdk-dev] [RFC PATCH 2/4] Make ethdev explicitly a subclass of pktdev Bruce Richardson
2015-04-17 15:16 ` [dpdk-dev] [RFC PATCH 3/4] add support for a ring to be a pktdev Bruce Richardson
2015-04-17 17:31 ` Neil Horman
2015-04-18 0:00 ` Ouyang, Changchun
2015-04-20 10:32 ` Ananyev, Konstantin
2015-04-17 15:16 ` [dpdk-dev] [RFC PATCH 4/4] example app showing pktdevs used in a chain Bruce Richardson
2015-04-17 17:28 ` [dpdk-dev] [RFC PATCH 0/4] pktdev Neil Horman
2015-04-17 18:49 ` Marc Sune
2015-04-17 19:50 ` Wiles, Keith
2015-04-20 6:51 ` Marc Sune
2015-04-20 10:43 ` Bruce Richardson
2015-04-20 17:03 ` Marc Sune
2015-04-20 13:19 ` Wiles, Keith
2015-04-20 13:30 ` Wiles, Keith
2015-05-04 13:13 ` [dpdk-dev] [RFC PATCH 0/4 v2] Extending DPDK with multiple device support Marc Sune
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428954274-26944-4-git-send-email-keith.wiles@intel.com \
--to=keith.wiles@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).