From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id B38065A3E for ; Sat, 25 Feb 2017 11:28:41 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id g10so4580840wrg.0 for ; Sat, 25 Feb 2017 02:28:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=12B8tnUe8SwfWsC3rLtg/Xd6PbMxfTyQ/kP2gUxS2Q4=; b=B+MoAy9TNlKOZ51saLwZsQqRDln4YadyDEBZtU3ePkMrOIniUnSQFxpCrhM9HLO5kp 2iiOVZTFqxCq/J6LTPK105O98kafuMTMMnh06+bfdb2YfsYL0qhDGU+eaqMArrgEDoyn Cs7WL3D/SZ0ZaK9QqZSvzEztDf/xL/r9C2I+qF0HBAjBeTEc+PuUYbmDX3vDW//fydgl Is5xTPAwSkrWqpooftu35oXo0z8KdOCsdGl+HeiKWPpa0fh25nvSylSuwwLLg67bR5l8 9eyMrWQ85ds6HY9FnQ20iyPOrZIgPCOi/ooYdAMa4faf2IdrWVHFm6b1UqKUqgExnRxN JIeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=12B8tnUe8SwfWsC3rLtg/Xd6PbMxfTyQ/kP2gUxS2Q4=; b=XPzeLKfnz547vl5EaC2PpnkbIWFJFc9T44k9Y854H8+6slro2gyJA2UdnimpoOzR6Y VUv4PRjOqVKt4L/ynViS6F+c7+CSXrZG/lh96kCv1IZIhR/Zax1+oQ3ALyeWn7ud8jlg gLc9bohNPqaWnws0cJe0YXTZWEOhdyeu2qM+buZI/zwm+8lm4dlfzGb4F3u/xQ7tc3sQ TeKKm6iKTiQ1n/kw3sdyvBaPhMuaoegwYNYD3jFkne1Nsfq42q25j3t0pzXurwiifEQY WjQYZZyOAjwOEfn3jzjRqoPoE6MCG5cUmN4hnqDxl9gq5a3ej65+Xs/xC61wmBBm2TrN os7w== X-Gm-Message-State: AMke39mjQZysWUzi4GiGFCx5d/FVpSB8uU0mro77x1jSfxfyc80To3AI11ojDi4I2oSPUg== X-Received: by 10.223.177.207 with SMTP id r15mr6408845wra.201.1488018521325; Sat, 25 Feb 2017 02:28:41 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id e72sm5830893wma.16.2017.02.25.02.28.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Feb 2017 02:28:40 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Cc: david.marchand@6wind.com, shreyansh.jain@nxp.com, ferruh.yigit@intel.com Date: Sat, 25 Feb 2017 11:28:16 +0100 Message-Id: <1488018496-995-11-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488018496-995-1-git-send-email-jblunck@infradead.org> References: <1488018496-995-1-git-send-email-jblunck@infradead.org> In-Reply-To: <1487600262-14382-1-git-send-email-jblunck@infradead.org> References: <1487600262-14382-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v3 10/10] eal: make virtual driver probe and remove take rte_vdev_device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 10:28:41 -0000 This is a preparation to embed the generic rte_device into the rte_eth_dev also for virtual devices. Signed-off-by: Jan Blunck --- drivers/crypto/null/null_crypto_pmd.c | 18 ++++++++++++------ drivers/net/af_packet/rte_eth_af_packet.c | 11 ++++++----- drivers/net/bonding/rte_eth_bond_pmd.c | 13 +++++++++---- drivers/net/mpipe/mpipe_tilegx.c | 10 ++++++---- drivers/net/null/rte_eth_null.c | 13 ++++++++----- drivers/net/pcap/rte_eth_pcap.c | 12 +++++++----- drivers/net/ring/rte_eth_ring.c | 9 +++++++-- drivers/net/tap/rte_eth_tap.c | 10 +++++++--- drivers/net/vhost/rte_eth_vhost.c | 10 +++++++--- drivers/net/virtio/virtio_user_ethdev.c | 18 +++++++----------- drivers/net/xenvirt/rte_eth_xenvirt.c | 9 +++++---- lib/librte_eal/common/eal_common_vdev.c | 7 +++---- lib/librte_eal/common/include/rte_vdev.h | 4 ++-- 13 files changed, 86 insertions(+), 58 deletions(-) diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index ed5a9fc..51d6de0 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -218,8 +218,7 @@ cryptodev_null_create(struct rte_crypto_vdev_init_params *init_params) /** Initialise null crypto device */ static int -cryptodev_null_probe(const char *name, - const char *input_args) +cryptodev_null_probe(struct rte_vdev_device *dev) { struct rte_crypto_vdev_init_params init_params = { RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, @@ -228,10 +227,11 @@ cryptodev_null_probe(const char *name, {0} }; - rte_cryptodev_parse_vdev_init_params(&init_params, input_args); + rte_cryptodev_parse_vdev_init_params(&init_params, + rte_vdev_device_args(dev)); - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, - init_params.socket_id); + RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", + rte_vdev_device_name(dev), init_params.socket_id); if (init_params.name[0] != '\0') RTE_LOG(INFO, PMD, " User defined name = %s\n", init_params.name); @@ -256,9 +256,15 @@ cryptodev_null_remove(const char *name) return 0; } +static int +cryptodev_null_remove_dev(struct rte_vdev_device *dev) +{ + return cryptodev_null_remove(rte_vdev_device_name(dev)); +} + static struct rte_vdev_driver cryptodev_null_pmd_drv = { .probe = cryptodev_null_probe, - .remove = cryptodev_null_remove + .remove = cryptodev_null_remove_dev, }; RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv); diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 2f87553..77536e8 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -923,8 +923,9 @@ rte_eth_from_packet(const char *name, } static int -rte_pmd_af_packet_probe(const char *name, const char *params) +rte_pmd_af_packet_probe(struct rte_vdev_device *dev) { + const char *name = rte_vdev_device_name(dev); unsigned numa_node; int ret = 0; struct rte_kvargs *kvlist; @@ -934,7 +935,7 @@ rte_pmd_af_packet_probe(const char *name, const char *params) numa_node = rte_socket_id(); - kvlist = rte_kvargs_parse(params, valid_arguments); + kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_arguments); if (kvlist == NULL) { ret = -1; goto exit; @@ -961,7 +962,7 @@ rte_pmd_af_packet_probe(const char *name, const char *params) } static int -rte_pmd_af_packet_remove(const char *name) +rte_pmd_af_packet_remove(struct rte_vdev_device *dev) { struct rte_eth_dev *eth_dev = NULL; struct pmd_internals *internals; @@ -970,11 +971,11 @@ rte_pmd_af_packet_remove(const char *name) RTE_LOG(INFO, PMD, "Closing AF_PACKET ethdev on numa socket %u\n", rte_socket_id()); - if (name == NULL) + if (dev == NULL) return -1; /* find the 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; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index f3ac9e2..6c03920 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2230,16 +2230,19 @@ const struct eth_dev_ops default_dev_ops = { }; static int -bond_probe(const char *name, const char *params) +bond_probe(struct rte_vdev_device *dev) { + const char *name; struct bond_dev_private *internals; struct rte_kvargs *kvlist; uint8_t bonding_mode, socket_id; int arg_count, port_id; + name = rte_vdev_device_name(dev); RTE_LOG(INFO, EAL, "Initializing pmd_bond for %s\n", name); - kvlist = rte_kvargs_parse(params, pmd_bond_init_valid_arguments); + kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), + pmd_bond_init_valid_arguments); if (kvlist == NULL) return -1; @@ -2297,13 +2300,15 @@ bond_probe(const char *name, const char *params) } static int -bond_remove(const char *name) +bond_remove(struct rte_vdev_device *dev) { + const char *name; int ret; - if (name == NULL) + if (!dev) return -EINVAL; + name = rte_vdev_device_name(dev); RTE_LOG(INFO, EAL, "Uninitializing pmd_bond for %s\n", name); /* free link bonding eth device */ diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c index 7bbd168..572c0a5 100644 --- a/drivers/net/mpipe/mpipe_tilegx.c +++ b/drivers/net/mpipe/mpipe_tilegx.c @@ -1622,15 +1622,17 @@ rte_pmd_mpipe_probe_common(struct rte_vdev_driver *drv, const char *ifname, } static int -rte_pmd_mpipe_xgbe_probe(const char *ifname, const char *params __rte_unused) +rte_pmd_mpipe_xgbe_probe(struct rte_vdev_device *dev) { - return rte_pmd_mpipe_probe_common(&pmd_mpipe_xgbe_drv, ifname, params); + return rte_pmd_mpipe_probe_common(&pmd_mpipe_xgbe_drv, + rte_vdev_device_name(dev), rte_vdev_device_args(dev)); } static int -rte_pmd_mpipe_gbe_probe(const char *ifname, const char *params __rte_unused) +rte_pmd_mpipe_gbe_probe(struct rte_vdev_device *dev) { - return rte_pmd_mpipe_probe_common(&pmd_mpipe_gbe_drv, ifname, params); + return rte_pmd_mpipe_probe_common(&pmd_mpipe_gbe_drv, + rte_vdev_device_name(dev), rte_vdev_device_args(dev)); } static struct rte_vdev_driver pmd_mpipe_xgbe_drv = { diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 57203e2..f4242b0 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -608,17 +608,20 @@ get_packet_copy_arg(const char *key __rte_unused, } static int -rte_pmd_null_probe(const char *name, const char *params) +rte_pmd_null_probe(struct rte_vdev_device *dev) { + const char *name, *params; unsigned numa_node; unsigned packet_size = default_packet_size; unsigned packet_copy = default_packet_copy; struct rte_kvargs *kvlist = NULL; int ret; - if (name == NULL) + if (!dev) return -EINVAL; + name = rte_vdev_device_name(dev); + params = rte_vdev_device_args(dev); RTE_LOG(INFO, PMD, "Initializing pmd_null for %s\n", name); numa_node = rte_socket_id(); @@ -660,18 +663,18 @@ rte_pmd_null_probe(const char *name, const char *params) } static int -rte_pmd_null_remove(const char *name) +rte_pmd_null_remove(struct rte_vdev_device *dev) { struct rte_eth_dev *eth_dev = NULL; - if (name == NULL) + if (!dev) return -EINVAL; RTE_LOG(INFO, PMD, "Closing null ethdev on numa socket %u\n", rte_socket_id()); /* find the 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; diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 7f0b650..ab9cde1 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 @@ pmd_pcap_probe(const char *name, const char *params) } 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; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 6f9cc1a..62606e7 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -502,12 +502,16 @@ static int parse_kvlist (const char *key __rte_unused, const char *value, void * } static int -rte_pmd_ring_probe(const char *name, const char *params) +rte_pmd_ring_probe(struct rte_vdev_device *dev) { + const char *name, *params; struct rte_kvargs *kvlist = NULL; int ret = 0; struct node_action_list *info = NULL; + name = rte_vdev_device_name(dev); + params = rte_vdev_device_args(dev); + RTE_LOG(INFO, PMD, "Initializing pmd_ring for %s\n", name); if (params == NULL || params[0] == '\0') { @@ -577,8 +581,9 @@ rte_pmd_ring_probe(const char *name, const char *params) } static int -rte_pmd_ring_remove(const char *name) +rte_pmd_ring_remove(struct rte_vdev_device *dev) { + const char *name = rte_vdev_device_name(dev); struct rte_eth_dev *eth_dev = NULL; struct pmd_internals *internals = NULL; struct ring_queue *r = NULL; diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index efc4426..941150f 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -741,13 +741,17 @@ set_interface_speed(const char *key __rte_unused, /* Open a TAP interface device. */ static int -rte_pmd_tap_probe(const char *name, const char *params) +rte_pmd_tap_probe(struct rte_vdev_device *dev) { + const char *name, *params; int ret; struct rte_kvargs *kvlist = NULL; int speed; char tap_name[RTE_ETH_NAME_MAX_LEN]; + name = rte_vdev_device_name(dev); + params = rte_vdev_device_args(dev); + speed = ETH_SPEED_NUM_10G; snprintf(tap_name, sizeof(tap_name), "%s%d", DEFAULT_TAP_NAME, tap_unit++); @@ -797,7 +801,7 @@ rte_pmd_tap_probe(const char *name, const char *params) /* detach a TAP device. */ static int -rte_pmd_tap_remove(const char *name) +rte_pmd_tap_remove(struct rte_vdev_device *dev) { struct rte_eth_dev *eth_dev = NULL; struct pmd_internals *internals; @@ -807,7 +811,7 @@ rte_pmd_tap_remove(const char *name) rte_socket_id()); /* find the ethdev entry */ - eth_dev = rte_eth_dev_allocated(name); + eth_dev = rte_eth_dev_allocated(rte_vdev_device_name(dev)); if (!eth_dev) return 0; diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index e98cffd..d0d0474 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -1156,8 +1156,9 @@ open_int(const char *key __rte_unused, const char *value, void *extra_args) } static int -rte_pmd_vhost_probe(const char *name, const char *params) +rte_pmd_vhost_probe(struct rte_vdev_device *dev) { + const char *name; struct rte_kvargs *kvlist = NULL; int ret = 0; char *iface_name; @@ -1166,9 +1167,10 @@ rte_pmd_vhost_probe(const char *name, const char *params) int client_mode = 0; int dequeue_zero_copy = 0; + name = rte_vdev_device_name(dev); RTE_LOG(INFO, PMD, "Initializing pmd_vhost for %s\n", name); - kvlist = rte_kvargs_parse(params, valid_arguments); + kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_arguments); if (kvlist == NULL) return -1; @@ -1219,11 +1221,13 @@ rte_pmd_vhost_probe(const char *name, const char *params) } static int -rte_pmd_vhost_remove(const char *name) +rte_pmd_vhost_remove(struct rte_vdev_device *dev) { + const char *name; struct rte_eth_dev *eth_dev = NULL; unsigned int i; + name = rte_vdev_device_name(dev); RTE_LOG(INFO, PMD, "Un-Initializing pmd_vhost for %s\n", name); /* find an ethdev entry */ diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 0b226ac..42ad8a2 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -338,7 +338,7 @@ virtio_user_eth_dev_free(struct rte_eth_dev *eth_dev) * Returns 0 on success. */ static int -virtio_user_pmd_probe(const char *name, const char *params) +virtio_user_pmd_probe(struct rte_vdev_device *dev) { struct rte_kvargs *kvlist = NULL; struct rte_eth_dev *eth_dev; @@ -350,13 +350,7 @@ virtio_user_pmd_probe(const char *name, const char *params) char *mac_addr = NULL; int ret = -1; - if (!params || params[0] == '\0') { - PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio_user", - VIRTIO_USER_ARG_QUEUE_SIZE); - goto end; - } - - kvlist = rte_kvargs_parse(params, valid_args); + kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_args); if (!kvlist) { PMD_INIT_LOG(ERR, "error when parsing param"); goto end; @@ -418,7 +412,7 @@ virtio_user_pmd_probe(const char *name, const char *params) goto end; } - eth_dev = virtio_user_eth_dev_alloc(name); + eth_dev = virtio_user_eth_dev_alloc(rte_vdev_device_name(dev)); if (!eth_dev) { PMD_INIT_LOG(ERR, "virtio_user fails to alloc device"); goto end; @@ -452,15 +446,17 @@ virtio_user_pmd_probe(const char *name, const char *params) /** Called by rte_eth_dev_detach() */ static int -virtio_user_pmd_remove(const char *name) +virtio_user_pmd_remove(struct rte_vdev_device *vdev) { + const char *name; struct rte_eth_dev *eth_dev; struct virtio_hw *hw; struct virtio_user_dev *dev; - if (!name) + if (!vdev) return -EINVAL; + name = rte_vdev_device_name(vdev); PMD_DRV_LOG(INFO, "Un-Initializing %s", name); eth_dev = rte_eth_dev_allocated(name); if (!eth_dev) diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c index 19bc09a..6ec8c08 100644 --- a/drivers/net/xenvirt/rte_eth_xenvirt.c +++ b/drivers/net/xenvirt/rte_eth_xenvirt.c @@ -726,7 +726,7 @@ eth_dev_xenvirt_free(const char *name, const unsigned numa_node) /*TODO: Support multiple process model */ static int -rte_pmd_xenvirt_probe(const char *name, const char *params) +rte_pmd_xenvirt_probe(struct rte_vdev_device *dev) { if (virtio_idx == 0) { if (xenstore_init() != 0) { @@ -738,14 +738,15 @@ rte_pmd_xenvirt_probe(const char *name, const char *params) return -1; } } - eth_dev_xenvirt_create(name, params, rte_socket_id(), DEV_CREATE); + eth_dev_xenvirt_create(rte_vdev_device_name(dev), + rte_vdev_device_args(dev), rte_socket_id(), DEV_CREATE); return 0; } static int -rte_pmd_xenvirt_remove(const char *name) +rte_pmd_xenvirt_remove(struct rte_vdev_device *dev) { - eth_dev_xenvirt_free(name, rte_socket_id()); + eth_dev_xenvirt_free(rte_vdev_device_name(dev), rte_socket_id()); if (virtio_idx == 0) { if (xenstore_uninit() != 0) diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 7215b50..3ee24b1 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -75,7 +75,6 @@ static int vdev_probe_all_drivers(struct rte_vdev_device *dev) { const char *name = rte_vdev_device_name(dev); - const char *args = rte_vdev_device_args(dev); struct rte_vdev_driver *driver; int ret; @@ -89,7 +88,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev) if (!strncmp(driver->driver.name, name, strlen(driver->driver.name))) { dev->device.driver = &driver->driver; - ret = driver->probe(name, args); + ret = driver->probe(dev); if (ret) dev->device.driver = NULL; return ret; @@ -102,7 +101,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev) !strncmp(driver->driver.alias, name, strlen(driver->driver.alias))) { dev->device.driver = &driver->driver; - ret = driver->probe(name, args); + ret = driver->probe(dev); if (ret) dev->device.driver = NULL; return ret; @@ -214,7 +213,7 @@ vdev_remove_driver(struct rte_vdev_device *dev) driver = container_of(dev->device.driver, const struct rte_vdev_driver, driver); - return driver->remove(name); + return driver->remove(dev); } int diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h index 81f6beb..8db2c00 100644 --- a/lib/librte_eal/common/include/rte_vdev.h +++ b/lib/librte_eal/common/include/rte_vdev.h @@ -68,12 +68,12 @@ TAILQ_HEAD(vdev_driver_list, rte_vdev_driver); /** * Probe function called for each virtual device driver once. */ -typedef int (rte_vdev_probe_t)(const char *name, const char *args); +typedef int (rte_vdev_probe_t)(struct rte_vdev_device *dev); /** * Remove function called for each virtual device driver once. */ -typedef int (rte_vdev_remove_t)(const char *name); +typedef int (rte_vdev_remove_t)(struct rte_vdev_device *dev); /** * A virtual device driver abstraction. -- 2.7.4