X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fvirtio%2Fvirtio_user_ethdev.c;h=c682d8f03c12fbdb408112bdaa5e5711ae922458;hb=6751f6deb798394da41467ee6e4cbd10d78ff156;hp=dc6f0ddbb0a1dcebbb217162d3f4acde16bf7494;hpb=404bd6bfe360ce052aad7953ab3fc3ab995c21e8;p=dpdk.git diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index dc6f0ddbb0..c682d8f03c 100644 --- 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; - 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; @@ -320,7 +320,7 @@ virtio_user_eth_dev_alloc(const char *name) 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; @@ -331,7 +331,7 @@ virtio_user_pmd_devinit(const char *name, const char *params) 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; } @@ -342,7 +342,7 @@ virtio_user_pmd_devinit(const char *name, const char *params) 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) { @@ -350,8 +350,8 @@ virtio_user_pmd_devinit(const char *name, const char *params) 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; } @@ -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) { - PMD_INIT_LOG(ERR, "virtio-user fails to alloc device"); + PMD_INIT_LOG(ERR, "virtio_user fails to alloc device"); goto end; } @@ -422,6 +422,8 @@ virtio_user_pmd_devinit(const char *name, const char *params) ret = 0; end: + if (kvlist) + rte_kvargs_free(kvlist); if (path) free(path); if (mac_addr) @@ -465,8 +467,8 @@ static struct rte_driver virtio_user_driver = { .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= " "mac= " "cq= "