From: Keith Wiles Date: Mon, 6 Feb 2017 19:40:38 +0000 (-0600) Subject: net/tap: move closing file descriptors to close function X-Git-Tag: spdx-start~4539 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e1dbde9a1f8e7702cf191fb489d37f52243114e2;p=dpdk.git net/tap: move closing file descriptors to close function Remove closing fds code from pmd stop routine. Signed-off-by: Keith Wiles Acked-by: Pascal Mazon --- diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index d1149ffe9b..efc44260bf 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -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