git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ethdev: get rid of device type
[dpdk.git]
/
drivers
/
net
/
virtio
/
virtio_user_ethdev.c
diff --git
a/drivers/net/virtio/virtio_user_ethdev.c
b/drivers/net/virtio/virtio_user_ethdev.c
index
dc6f0dd
..
c682d8f
100644
(file)
--- a/
drivers/net/virtio/virtio_user_ethdev.c
+++ b/
drivers/net/virtio/virtio_user_ethdev.c
@@
-277,7
+277,7
@@
virtio_user_eth_dev_alloc(const char *name)
struct virtio_hw *hw;
struct virtio_user_dev *dev;
struct virtio_hw *hw;
struct virtio_user_dev *dev;
- eth_dev = rte_eth_dev_allocate(name
, RTE_ETH_DEV_VIRTUAL
);
+ eth_dev = rte_eth_dev_allocate(name);
if (!eth_dev) {
PMD_INIT_LOG(ERR, "cannot alloc rte_eth_dev");
return NULL;
if (!eth_dev) {
PMD_INIT_LOG(ERR, "cannot alloc rte_eth_dev");
return NULL;
@@
-320,7
+320,7
@@
virtio_user_eth_dev_alloc(const char *name)
static int
virtio_user_pmd_devinit(const char *name, const char *params)
{
static int
virtio_user_pmd_devinit(const char *name, const char *params)
{
- struct rte_kvargs *kvlist;
+ struct rte_kvargs *kvlist
= NULL
;
struct rte_eth_dev *eth_dev;
struct virtio_hw *hw;
uint64_t queues = VIRTIO_USER_DEF_Q_NUM;
struct rte_eth_dev *eth_dev;
struct virtio_hw *hw;
uint64_t queues = VIRTIO_USER_DEF_Q_NUM;
@@
-331,7
+331,7
@@
virtio_user_pmd_devinit(const char *name, const char *params)
int ret = -1;
if (!params || params[0] == '\0') {
int ret = -1;
if (!params || params[0] == '\0') {
- PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio
-
user",
+ PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio
_
user",
VIRTIO_USER_ARG_QUEUE_SIZE);
goto end;
}
VIRTIO_USER_ARG_QUEUE_SIZE);
goto end;
}
@@
-342,7
+342,7
@@
virtio_user_pmd_devinit(const char *name, const char *params)
goto end;
}
goto end;
}
- if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1)
+ if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1)
{
ret = rte_kvargs_process(kvlist, VIRTIO_USER_ARG_PATH,
&get_string_arg, &path);
if (ret < 0) {
ret = rte_kvargs_process(kvlist, VIRTIO_USER_ARG_PATH,
&get_string_arg, &path);
if (ret < 0) {
@@
-350,8
+350,8
@@
virtio_user_pmd_devinit(const char *name, const char *params)
VIRTIO_USER_ARG_PATH);
goto end;
}
VIRTIO_USER_ARG_PATH);
goto end;
}
- else {
- PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio
-
user\n",
+
}
else {
+ PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio
_
user\n",
VIRTIO_USER_ARG_QUEUE_SIZE);
goto end;
}
VIRTIO_USER_ARG_QUEUE_SIZE);
goto end;
}
@@
-405,7
+405,7
@@
virtio_user_pmd_devinit(const char *name, const char *params)
eth_dev = virtio_user_eth_dev_alloc(name);
if (!eth_dev) {
eth_dev = virtio_user_eth_dev_alloc(name);
if (!eth_dev) {
- PMD_INIT_LOG(ERR, "virtio
-
user fails to alloc device");
+ PMD_INIT_LOG(ERR, "virtio
_
user fails to alloc device");
goto end;
}
goto end;
}
@@
-422,6
+422,8
@@
virtio_user_pmd_devinit(const char *name, const char *params)
ret = 0;
end:
ret = 0;
end:
+ if (kvlist)
+ rte_kvargs_free(kvlist);
if (path)
free(path);
if (mac_addr)
if (path)
free(path);
if (mac_addr)
@@
-465,8
+467,8
@@
static struct rte_driver virtio_user_driver = {
.uninit = virtio_user_pmd_devuninit,
};
.uninit = virtio_user_pmd_devuninit,
};
-PMD_REGISTER_DRIVER(virtio_user_driver, virtio_user);
-DRIVER_REGISTER_PARAM_STRING(virtio_user,
+PMD_REGISTER_DRIVER(virtio_user_driver,
net_
virtio_user);
+DRIVER_REGISTER_PARAM_STRING(
net_
virtio_user,
"path=<path> "
"mac=<mac addr> "
"cq=<int> "
"path=<path> "
"mac=<mac addr> "
"cq=<int> "