summaryrefslogtreecommitdiff
path: root/drivers/net/pcap
diff options
context:
space:
mode:
authorJan Blunck <jblunck@infradead.org>2017-04-11 17:44:13 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2017-04-14 15:41:50 +0200
commit5d2aa461cbcae1b5ede5cee0b0b3a1228c4afc59 (patch)
treecdbb28e8aafa97df84700f068c5bcc7578c8a328 /drivers/net/pcap
parentdda987315ca27a8db7d7127b3634ae5227357ba2 (diff)
downloaddpdk-next-eventdev-5d2aa461cbcae1b5ede5cee0b0b3a1228c4afc59.zip
dpdk-next-eventdev-5d2aa461cbcae1b5ede5cee0b0b3a1228c4afc59.tar.gz
dpdk-next-eventdev-5d2aa461cbcae1b5ede5cee0b0b3a1228c4afc59.tar.xz
vdev: use generic vdev struct for probe and remove
This is a preparation to embed the generic rte_device into the rte_eth_dev also for virtual devices. Signed-off-by: Jan Blunck <jblunck@infradead.org> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Diffstat (limited to 'drivers/net/pcap')
-rw-r--r--drivers/net/pcap/rte_eth_pcap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 075e3be..05cbd47 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -936,8 +936,9 @@ eth_from_pcaps(const char *name, struct pmd_devargs *rx_queues,
}
static int
-pmd_pcap_probe(const char *name, const char *params)
+pmd_pcap_probe(struct rte_vdev_device *dev)
{
+ const char *name;
unsigned int is_rx_pcap = 0, is_tx_pcap = 0;
struct rte_kvargs *kvlist;
struct pmd_devargs pcaps = {0};
@@ -945,13 +946,14 @@ pmd_pcap_probe(const char *name, const char *params)
int single_iface = 0;
int ret;
+ name = rte_vdev_device_name(dev);
RTE_LOG(INFO, PMD, "Initializing pmd_pcap for %s\n", name);
gettimeofday(&start_time, NULL);
start_cycles = rte_get_timer_cycles();
hz = rte_get_timer_hz();
- kvlist = rte_kvargs_parse(params, valid_arguments);
+ kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_arguments);
if (kvlist == NULL)
return -1;
@@ -1035,18 +1037,18 @@ free_kvlist:
}
static int
-pmd_pcap_remove(const char *name)
+pmd_pcap_remove(struct rte_vdev_device *dev)
{
struct rte_eth_dev *eth_dev = NULL;
RTE_LOG(INFO, PMD, "Closing pcap ethdev on numa socket %u\n",
rte_socket_id());
- if (name == NULL)
+ if (!dev)
return -1;
/* reserve an ethdev entry */
- eth_dev = rte_eth_dev_allocated(name);
+ eth_dev = rte_eth_dev_allocated(rte_vdev_device_name(dev));
if (eth_dev == NULL)
return -1;