return nb_enqueued;
}
-static int aesni_gcm_remove(const char *name);
+static int aesni_gcm_remove(struct rte_vdev_device *vdev);
static int
-aesni_gcm_create(struct rte_crypto_vdev_init_params *init_params)
+aesni_gcm_create(struct rte_vdev_device *vdev,
+ struct rte_crypto_vdev_init_params *init_params)
{
struct rte_cryptodev *dev;
struct aesni_gcm_private *internals;
init_error:
GCM_LOG_ERR("driver %s: create failed", init_params->name);
- aesni_gcm_remove(init_params->name);
+ aesni_gcm_remove(vdev);
return -EFAULT;
}
static int
-aesni_gcm_probe(const char *name, const char *input_args)
+aesni_gcm_probe(struct rte_vdev_device *vdev)
{
struct rte_crypto_vdev_init_params init_params = {
RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
rte_socket_id(),
{0}
};
+ const char *name;
+ const char *input_args;
+ name = rte_vdev_device_name(vdev);
+ input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
RTE_LOG(INFO, PMD, " Max number of sessions = %d\n",
init_params.max_nb_sessions);
- return aesni_gcm_create(&init_params);
+ return aesni_gcm_create(vdev, &init_params);
}
static int
-aesni_gcm_remove(const char *name)
+aesni_gcm_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
if (name == NULL)
return -EINVAL;
return processed_jobs;
}
-static int cryptodev_aesni_mb_remove(const char *name);
+static int cryptodev_aesni_mb_remove(struct rte_vdev_device *vdev);
static int
-cryptodev_aesni_mb_create(struct rte_crypto_vdev_init_params *init_params)
+cryptodev_aesni_mb_create(struct rte_vdev_device *vdev,
+ struct rte_crypto_vdev_init_params *init_params)
{
struct rte_cryptodev *dev;
struct aesni_mb_private *internals;
MB_LOG_ERR("driver %s: cryptodev_aesni_create failed",
init_params->name);
- cryptodev_aesni_mb_remove(init_params->name);
+ cryptodev_aesni_mb_remove(vdev);
return -EFAULT;
}
static int
-cryptodev_aesni_mb_probe(const char *name,
- const char *input_args)
+cryptodev_aesni_mb_probe(struct rte_vdev_device *vdev)
{
struct rte_crypto_vdev_init_params init_params = {
RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
rte_socket_id(),
""
};
+ const char *name;
+ const char *input_args;
+ name = rte_vdev_device_name(vdev);
+ input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
RTE_LOG(INFO, PMD, " Max number of sessions = %d\n",
init_params.max_nb_sessions);
- return cryptodev_aesni_mb_create(&init_params);
+ return cryptodev_aesni_mb_create(vdev, &init_params);
}
static int
-cryptodev_aesni_mb_remove(const char *name)
+cryptodev_aesni_mb_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
if (name == NULL)
return -EINVAL;
#include "rte_armv8_pmd_private.h"
-static int cryptodev_armv8_crypto_uninit(const char *name);
+static int cryptodev_armv8_crypto_uninit(struct rte_vdev_device *vdev);
/**
* Pointers to the supported combined mode crypto functions are stored
/** Create ARMv8 crypto device */
static int
-cryptodev_armv8_crypto_create(struct rte_crypto_vdev_init_params *init_params)
+cryptodev_armv8_crypto_create(struct rte_vdev_device *vdev,
+ struct rte_crypto_vdev_init_params *init_params)
{
struct rte_cryptodev *dev;
struct armv8_crypto_private *internals;
"driver %s: cryptodev_armv8_crypto_create failed",
init_params->name);
- cryptodev_armv8_crypto_uninit(init_params->name);
+ cryptodev_armv8_crypto_uninit(vdev);
return -EFAULT;
}
/** Initialise ARMv8 crypto device */
static int
-cryptodev_armv8_crypto_init(const char *name,
- const char *input_args)
+cryptodev_armv8_crypto_init(struct rte_vdev_device *vdev)
{
struct rte_crypto_vdev_init_params init_params = {
RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
rte_socket_id(),
{0}
};
+ const char *name;
+ const char *input_args;
+ name = rte_vdev_device_name(vdev);
+ input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
RTE_LOG(INFO, PMD, " Max number of sessions = %d\n",
init_params.max_nb_sessions);
- return cryptodev_armv8_crypto_create(&init_params);
+ return cryptodev_armv8_crypto_create(vdev, &init_params);
}
/** Uninitialise ARMv8 crypto device */
static int
-cryptodev_armv8_crypto_uninit(const char *name)
+cryptodev_armv8_crypto_uninit(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
if (name == NULL)
return -EINVAL;
return nb_dequeued;
}
-static int cryptodev_kasumi_remove(const char *name);
+static int cryptodev_kasumi_remove(struct rte_vdev_device *vdev);
static int
-cryptodev_kasumi_create(struct rte_crypto_vdev_init_params *init_params)
+cryptodev_kasumi_create(struct rte_vdev_device *vdev,
+ struct rte_crypto_vdev_init_params *init_params)
{
struct rte_cryptodev *dev;
struct kasumi_private *internals;
KASUMI_LOG_ERR("driver %s: cryptodev_kasumi_create failed",
init_params->name);
- cryptodev_kasumi_remove(init_params->name);
+ cryptodev_kasumi_remove(vdev);
return -EFAULT;
}
static int
-cryptodev_kasumi_probe(const char *name,
- const char *input_args)
+cryptodev_kasumi_probe(struct rte_vdev_device *vdev)
{
struct rte_crypto_vdev_init_params init_params = {
RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
rte_socket_id(),
{0}
};
+ const char *name;
+ const char *input_args;
+
+ name = rte_vdev_device_name(vdev);
+ input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
RTE_LOG(INFO, PMD, " Max number of sessions = %d\n",
init_params.max_nb_sessions);
- return cryptodev_kasumi_create(&init_params);
+ return cryptodev_kasumi_create(vdev, &init_params);
}
static int
-cryptodev_kasumi_remove(const char *name)
+cryptodev_kasumi_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
if (name == NULL)
return -EINVAL;
/** 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,
{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);
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);
#define DES_BLOCK_SIZE 8
-static int cryptodev_openssl_remove(const char *name);
+static int cryptodev_openssl_remove(struct rte_vdev_device *vdev);
/*----------------------------------------------------------------------------*/
/** Create OPENSSL crypto device */
static int
-cryptodev_openssl_create(struct rte_crypto_vdev_init_params *init_params)
+cryptodev_openssl_create(struct rte_vdev_device *vdev,
+ struct rte_crypto_vdev_init_params *init_params)
{
struct rte_cryptodev *dev;
struct openssl_private *internals;
OPENSSL_LOG_ERR("driver %s: cryptodev_openssl_create failed",
init_params->name);
- cryptodev_openssl_remove(init_params->name);
+ cryptodev_openssl_remove(vdev);
return -EFAULT;
}
/** Initialise OPENSSL crypto device */
static int
-cryptodev_openssl_probe(const char *name,
- const char *input_args)
+cryptodev_openssl_probe(struct rte_vdev_device *vdev)
{
struct rte_crypto_vdev_init_params init_params = {
RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
rte_socket_id(),
{0}
};
+ const char *name;
+ const char *input_args;
+
+ name = rte_vdev_device_name(vdev);
+ input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
RTE_LOG(INFO, PMD, " Max number of sessions = %d\n",
init_params.max_nb_sessions);
- return cryptodev_openssl_create(&init_params);
+ return cryptodev_openssl_create(vdev, &init_params);
}
/** Uninitialise OPENSSL crypto device */
static int
-cryptodev_openssl_remove(const char *name)
+cryptodev_openssl_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
if (name == NULL)
return -EINVAL;
}
static int
-cryptodev_scheduler_remove(const char *name)
+cryptodev_scheduler_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
struct rte_cryptodev *dev;
struct scheduler_ctx *sched_ctx;
- if (name == NULL)
+ if (vdev == NULL)
return -EINVAL;
+ name = rte_vdev_device_name(vdev);
dev = rte_cryptodev_pmd_get_named_dev(name);
if (dev == NULL)
return -EINVAL;
}
static int
-cryptodev_scheduler_probe(const char *name, const char *input_args)
+cryptodev_scheduler_probe(struct rte_vdev_device *vdev)
{
struct scheduler_init_params init_params = {
.def_p = {
.enable_ordering = 0
};
- scheduler_parse_init_params(&init_params, input_args);
+ scheduler_parse_init_params(&init_params,
+ rte_vdev_device_args(vdev));
- RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
+ RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n",
+ rte_vdev_device_name(vdev),
init_params.def_p.socket_id);
RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n",
init_params.def_p.max_nb_queue_pairs);
RTE_LOG(INFO, PMD, " User defined name = %s\n",
init_params.def_p.name);
- return cryptodev_scheduler_create(name, &init_params);
+ return cryptodev_scheduler_create(rte_vdev_device_name(vdev),
+ &init_params);
}
static struct rte_vdev_driver cryptodev_scheduler_pmd_drv = {
return nb_dequeued;
}
-static int cryptodev_snow3g_remove(const char *name);
+static int cryptodev_snow3g_remove(struct rte_vdev_device *vdev);
static int
-cryptodev_snow3g_create(struct rte_crypto_vdev_init_params *init_params)
+cryptodev_snow3g_create(struct rte_vdev_device *vdev,
+ struct rte_crypto_vdev_init_params *init_params)
{
struct rte_cryptodev *dev;
struct snow3g_private *internals;
SNOW3G_LOG_ERR("driver %s: cryptodev_snow3g_create failed",
init_params->name);
- cryptodev_snow3g_remove(init_params->name);
+ cryptodev_snow3g_remove(vdev);
return -EFAULT;
}
static int
-cryptodev_snow3g_probe(const char *name,
- const char *input_args)
+cryptodev_snow3g_probe(struct rte_vdev_device *vdev)
{
struct rte_crypto_vdev_init_params init_params = {
RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
rte_socket_id(),
{0}
};
+ const char *name;
+ const char *input_args;
+
+ name = rte_vdev_device_name(vdev);
+ input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
RTE_LOG(INFO, PMD, " Max number of sessions = %d\n",
init_params.max_nb_sessions);
- return cryptodev_snow3g_create(&init_params);
+ return cryptodev_snow3g_create(vdev, &init_params);
}
static int
-cryptodev_snow3g_remove(const char *name)
+cryptodev_snow3g_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
if (name == NULL)
return -EINVAL;
return nb_dequeued;
}
-static int cryptodev_zuc_remove(const char *name);
+static int cryptodev_zuc_remove(struct rte_vdev_device *vdev);
static int
-cryptodev_zuc_create(struct rte_crypto_vdev_init_params *init_params)
+cryptodev_zuc_create(struct rte_vdev_device *vdev,
+ struct rte_crypto_vdev_init_params *init_params)
{
struct rte_cryptodev *dev;
struct zuc_private *internals;
ZUC_LOG_ERR("driver %s: cryptodev_zuc_create failed",
init_params->name);
- cryptodev_zuc_remove(init_params->name);
+ cryptodev_zuc_remove(vdev);
return -EFAULT;
}
static int
-cryptodev_zuc_probe(const char *name,
- const char *input_args)
+cryptodev_zuc_probe(struct rte_vdev_device *vdev)
{
struct rte_crypto_vdev_init_params init_params = {
RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
rte_socket_id(),
{0}
};
+ const char *name;
+ const char *input_args;
+
+ name = rte_vdev_device_name(vdev);
+ input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
RTE_LOG(INFO, PMD, " Max number of sessions = %d\n",
init_params.max_nb_sessions);
- return cryptodev_zuc_create(&init_params);
+ return cryptodev_zuc_create(vdev, &init_params);
}
static int
-cryptodev_zuc_remove(const char *name)
+cryptodev_zuc_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
if (name == NULL)
return -EINVAL;
};
static int
-ssovf_vdev_probe(const char *name, const char *params)
+ssovf_vdev_probe(struct rte_vdev_device *vdev)
{
struct octeontx_ssovf_info oinfo;
struct ssovf_mbox_dev_info info;
struct ssovf_evdev *edev;
struct rte_eventdev *eventdev;
static int ssovf_init_once;
+ const char *name;
int ret;
- RTE_SET_USED(params);
-
+ name = rte_vdev_device_name(vdev);
/* More than one instance is not supported */
if (ssovf_init_once) {
ssovf_log_err("Request to create >1 %s instance", name);
}
static int
-ssovf_vdev_remove(const char *name)
+ssovf_vdev_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
ssovf_log_info("Closing %s", name);
return rte_event_pmd_vdev_uninit(name);
}
}
static int
-skeleton_eventdev_probe(const char *name, __rte_unused const char *input_args)
+skeleton_eventdev_probe(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name,
rte_socket_id());
return skeleton_eventdev_create(name, rte_socket_id());
}
static int
-skeleton_eventdev_remove(const char *name)
+skeleton_eventdev_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
PMD_DRV_LOG(INFO, "Closing %s on NUMA node %d", name, rte_socket_id());
return rte_event_pmd_vdev_uninit(name);
}
static int
-sw_probe(const char *name, const char *params)
+sw_probe(struct rte_vdev_device *vdev)
{
static const struct rte_eventdev_ops evdev_sw_ops = {
.dev_configure = sw_dev_configure,
CREDIT_QUANTA_ARG,
NULL
};
+ const char *name;
+ const char *params;
struct rte_eventdev *dev;
struct sw_evdev *sw;
int socket_id = rte_socket_id();
int sched_quanta = SW_DEFAULT_SCHED_QUANTA;
int credit_quanta = SW_DEFAULT_CREDIT_QUANTA;
+ name = rte_vdev_device_name(vdev);
+ params = rte_vdev_device_args(vdev);
if (params != NULL && params[0] != '\0') {
struct rte_kvargs *kvlist = rte_kvargs_parse(params, args);
}
static int
-sw_remove(const char *name)
+sw_remove(struct rte_vdev_device *vdev)
{
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
if (name == NULL)
return -EINVAL;
}
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;
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;
}
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;
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;
};
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;
}
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 */
eth_dev->data = data;
eth_dev->dev_ops = ð_kni_ops;
- eth_dev->driver = NULL;
+ eth_dev->device->driver = NULL;
data->dev_flags = RTE_ETH_DEV_DETACHABLE;
data->kdrv = RTE_KDRV_NONE;
}
static int
-eth_kni_probe(const char *name, const char *params)
+eth_kni_probe(struct rte_vdev_device *vdev)
{
struct rte_eth_dev *eth_dev;
struct eth_kni_args args;
+ const char *name;
+ const char *params;
int ret;
+ name = rte_vdev_device_name(vdev);
+ params = rte_vdev_device_args(vdev);
RTE_LOG(INFO, PMD, "Initializing eth_kni for %s\n", name);
ret = eth_kni_kvargs_process(&args, params);
}
static int
-eth_kni_remove(const char *name)
+eth_kni_remove(struct rte_vdev_device *vdev)
{
struct rte_eth_dev *eth_dev;
struct pmd_internals *internals;
+ const char *name;
+ name = rte_vdev_device_name(vdev);
RTE_LOG(INFO, PMD, "Un-Initializing eth_kni for %s\n", name);
/* find the ethdev entry */
}
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();
}
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;
}
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};
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;
}
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;
}
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') {
}
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;
/* 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];
char remote_iface[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++);
/* 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;
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;
}
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;
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;
}
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 */
* 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;
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;
}
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
- 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;
goto end;
}
} else {
- eth_dev = rte_eth_dev_attach_secondary(name);
+ eth_dev = rte_eth_dev_attach_secondary(rte_vdev_device_name(dev));
if (!eth_dev)
goto end;
}
/** 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)
/*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) {
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)
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;
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;
!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;
driver = container_of(dev->device.driver, const struct rte_vdev_driver,
driver);
- return driver->remove(name);
+ return driver->remove(dev);
}
int
/**
* 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.