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
net/hns3: fix mbuf leakage
[dpdk.git]
/
drivers
/
net
/
kni
/
rte_eth_kni.c
diff --git
a/drivers/net/kni/rte_eth_kni.c
b/drivers/net/kni/rte_eth_kni.c
index
2a4058f
..
9ce74e5
100644
(file)
--- a/
drivers/net/kni/rte_eth_kni.c
+++ b/
drivers/net/kni/rte_eth_kni.c
@@
-7,8
+7,8
@@
#include <unistd.h>
#include <rte_string_fns.h>
#include <unistd.h>
#include <rte_string_fns.h>
-#include <
rte_
ethdev_driver.h>
-#include <
rte_
ethdev_vdev.h>
+#include <ethdev_driver.h>
+#include <ethdev_vdev.h>
#include <rte_kni.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
#include <rte_kni.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
@@
-177,7
+177,7
@@
eth_kni_dev_start(struct rte_eth_dev *dev)
return 0;
}
return 0;
}
-static
void
+static
int
eth_kni_dev_stop(struct rte_eth_dev *dev)
{
struct pmd_internals *internals = dev->data->dev_private;
eth_kni_dev_stop(struct rte_eth_dev *dev)
{
struct pmd_internals *internals = dev->data->dev_private;
@@
-196,6
+196,9
@@
eth_kni_dev_stop(struct rte_eth_dev *dev)
}
dev->data->dev_link.link_status = 0;
}
dev->data->dev_link.link_status = 0;
+ dev->data->dev_started = 0;
+
+ return 0;
}
static int
}
static int
@@
-204,7
+207,10
@@
eth_kni_close(struct rte_eth_dev *eth_dev)
struct pmd_internals *internals;
int ret;
struct pmd_internals *internals;
int ret;
- eth_kni_dev_stop(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
+
+ ret = eth_kni_dev_stop(eth_dev);
/* mac_addrs must not be freed alone because part of dev_private */
eth_dev->data->mac_addrs = NULL;
/* mac_addrs must not be freed alone because part of dev_private */
eth_dev->data->mac_addrs = NULL;
@@
-215,7
+221,7
@@
eth_kni_close(struct rte_eth_dev *eth_dev)
PMD_LOG(WARNING, "Not able to release kni for %s",
eth_dev->data->name);
PMD_LOG(WARNING, "Not able to release kni for %s",
eth_dev->data->name);
- return
0
;
+ return
ret
;
}
static int
}
static int
@@
-386,6
+392,7
@@
eth_kni_create(struct rte_vdev_device *vdev,
data->mac_addrs = &internals->eth_addr;
data->promiscuous = 1;
data->all_multicast = 1;
data->mac_addrs = &internals->eth_addr;
data->promiscuous = 1;
data->all_multicast = 1;
+ data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
rte_eth_random_addr(internals->eth_addr.addr_bytes);
rte_eth_random_addr(internals->eth_addr.addr_bytes);
@@
-482,6
+489,7
@@
eth_kni_remove(struct rte_vdev_device *vdev)
{
struct rte_eth_dev *eth_dev;
const char *name;
{
struct rte_eth_dev *eth_dev;
const char *name;
+ int ret;
name = rte_vdev_device_name(vdev);
PMD_LOG(INFO, "Un-Initializing eth_kni for %s", name);
name = rte_vdev_device_name(vdev);
PMD_LOG(INFO, "Un-Initializing eth_kni for %s", name);
@@
-490,7
+498,9
@@
eth_kni_remove(struct rte_vdev_device *vdev)
eth_dev = rte_eth_dev_allocated(name);
if (eth_dev != NULL) {
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
eth_dev = rte_eth_dev_allocated(name);
if (eth_dev != NULL) {
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
- eth_kni_dev_stop(eth_dev);
+ ret = eth_kni_dev_stop(eth_dev);
+ if (ret != 0)
+ return ret;
return rte_eth_dev_release_port(eth_dev);
}
eth_kni_close(eth_dev);
return rte_eth_dev_release_port(eth_dev);
}
eth_kni_close(eth_dev);