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/pcap: fix file descriptor leak on close
[dpdk.git]
/
drivers
/
net
/
mvneta
/
mvneta_ethdev.c
diff --git
a/drivers/net/mvneta/mvneta_ethdev.c
b/drivers/net/mvneta/mvneta_ethdev.c
index
eebcdb8
..
b0940b4
100644
(file)
--- a/
drivers/net/mvneta/mvneta_ethdev.c
+++ b/
drivers/net/mvneta/mvneta_ethdev.c
@@
-5,7
+5,7
@@
*/
#include <rte_string_fns.h>
*/
#include <rte_string_fns.h>
-#include <
rte_
ethdev_driver.h>
+#include <ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
#include <rte_bus_vdev.h>
@@
-408,19
+408,23
@@
out:
* @param dev
* Pointer to Ethernet device structure.
*/
* @param dev
* Pointer to Ethernet device structure.
*/
-static
void
+static
int
mvneta_dev_stop(struct rte_eth_dev *dev)
{
struct mvneta_priv *priv = dev->data->dev_private;
mvneta_dev_stop(struct rte_eth_dev *dev)
{
struct mvneta_priv *priv = dev->data->dev_private;
+ dev->data->dev_started = 0;
+
if (!priv->ppio)
if (!priv->ppio)
- return;
+ return
0
;
mvneta_dev_set_link_down(dev);
mvneta_flush_queues(dev);
neta_ppio_deinit(priv->ppio);
priv->ppio = NULL;
mvneta_dev_set_link_down(dev);
mvneta_flush_queues(dev);
neta_ppio_deinit(priv->ppio);
priv->ppio = NULL;
+
+ return 0;
}
/**
}
/**
@@
-433,10
+437,13
@@
static int
mvneta_dev_close(struct rte_eth_dev *dev)
{
struct mvneta_priv *priv = dev->data->dev_private;
mvneta_dev_close(struct rte_eth_dev *dev)
{
struct mvneta_priv *priv = dev->data->dev_private;
- int i;
+ int i, ret = 0;
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
if (priv->ppio)
if (priv->ppio)
- mvneta_dev_stop(dev);
+
ret =
mvneta_dev_stop(dev);
for (i = 0; i < dev->data->nb_rx_queues; i++) {
mvneta_rx_queue_release(dev->data->rx_queues[i]);
for (i = 0; i < dev->data->nb_rx_queues; i++) {
mvneta_rx_queue_release(dev->data->rx_queues[i]);
@@
-456,7
+463,7
@@
mvneta_dev_close(struct rte_eth_dev *dev)
rte_mvep_deinit(MVEP_MOD_T_NETA);
}
rte_mvep_deinit(MVEP_MOD_T_NETA);
}
- return
0
;
+ return
ret
;
}
/**
}
/**
@@
-833,9
+840,7
@@
mvneta_eth_dev_create(struct rte_vdev_device *vdev, const char *name)
eth_dev->rx_pkt_burst = mvneta_rx_pkt_burst;
mvneta_set_tx_function(eth_dev);
eth_dev->dev_ops = &mvneta_ops;
eth_dev->rx_pkt_burst = mvneta_rx_pkt_burst;
mvneta_set_tx_function(eth_dev);
eth_dev->dev_ops = &mvneta_ops;
-
- /* Flag to call rte_eth_dev_release_port() in rte_eth_dev_close(). */
- eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+ eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
rte_eth_dev_probing_finish(eth_dev);
return 0;
rte_eth_dev_probing_finish(eth_dev);
return 0;
@@
-964,14
+969,15
@@
static int
rte_pmd_mvneta_remove(struct rte_vdev_device *vdev)
{
uint16_t port_id;
rte_pmd_mvneta_remove(struct rte_vdev_device *vdev)
{
uint16_t port_id;
+ int ret = 0;
RTE_ETH_FOREACH_DEV(port_id) {
if (rte_eth_devices[port_id].device != &vdev->device)
continue;
RTE_ETH_FOREACH_DEV(port_id) {
if (rte_eth_devices[port_id].device != &vdev->device)
continue;
- rte_eth_dev_close(port_id);
+ r
et |= r
te_eth_dev_close(port_id);
}
}
- return
0
;
+ return
ret == 0 ? 0 : -EIO
;
}
static struct rte_vdev_driver pmd_mvneta_drv = {
}
static struct rte_vdev_driver pmd_mvneta_drv = {