net/tap: move closing file descriptors to close function
Remove closing fds code from pmd stop routine. Signed-off-by: Keith Wiles <keith.wiles@intel.com> Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
This commit is contained in:
parent
89a5bef09a
commit
e1dbde9a1f
@ -350,14 +350,7 @@ tap_dev_start(struct rte_eth_dev *dev)
|
||||
static void
|
||||
tap_dev_stop(struct rte_eth_dev *dev)
|
||||
{
|
||||
int i;
|
||||
struct pmd_internals *internals = dev->data->dev_private;
|
||||
|
||||
tap_link_set_down(dev);
|
||||
|
||||
for (i = 0; i < internals->nb_queues; i++)
|
||||
if (internals->rxq[i].fd != -1)
|
||||
close(internals->rxq[i].fd);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -431,6 +424,17 @@ tap_stats_reset(struct rte_eth_dev *dev)
|
||||
static void
|
||||
tap_dev_close(struct rte_eth_dev *dev __rte_unused)
|
||||
{
|
||||
int i;
|
||||
struct pmd_internals *internals = dev->data->dev_private;
|
||||
|
||||
tap_link_set_down(dev);
|
||||
|
||||
for (i = 0; i < internals->nb_queues; i++) {
|
||||
if (internals->rxq[i].fd != -1)
|
||||
close(internals->rxq[i].fd);
|
||||
internals->rxq[i].fd = -1;
|
||||
internals->txq[i].fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user