]> git.droids-corp.org - dpdk.git/commitdiff
net/tap: fix interrupt handler freeing
authorQuentin Armitage <quentin@armitage.org.uk>
Tue, 3 May 2022 15:27:32 +0000 (16:27 +0100)
committerAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Thu, 12 May 2022 08:11:16 +0000 (10:11 +0200)
rte_pmd_tun/tap_probe() allocates pmd->intr_handle in eth_dev_tap_create()
and it should not be freed until rte_pmd_tap_remove() is called.

Inspection of tap_rx_intr_vec_set() shows that the call to
tap_tx_intr_vec_uninstall() was calling rte_intr_instance_free() but
tap_tx_intr_vec_install() can then be immediately called, and this then
uses pmd->intr_handle without it being reallocated.

Move rte_intr_instance_free() call from tap_tx_intr_vec_uninstall()
to rte_pmd_tap_remove().

Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Cc: stable@dpdk.org
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Reviewed-by: David Marchand <david.marchand@redhat.com>
drivers/net/tap/rte_eth_tap.c
drivers/net/tap/tap_intr.c

index bc3d56a311a355e4acae714c58f2b4f4ff52dfac..5495818be68ba04cd47e79b857341d13238ec548 100644 (file)
@@ -1213,6 +1213,8 @@ tap_dev_close(struct rte_eth_dev *dev)
        TAP_LOG(DEBUG, "Closing %s Ethernet device on numa %u",
                tuntap_types[internals->type], rte_socket_id());
 
+       rte_intr_instance_free(internals->intr_handle);
+
        if (internals->ioctl_sock != -1) {
                close(internals->ioctl_sock);
                internals->ioctl_sock = -1;
index 56c343aceaff3c32f92e077b93f29e0dd4493e53..a9097def1a32a6c901075def63dd38088a4305bf 100644 (file)
@@ -34,8 +34,6 @@ tap_rx_intr_vec_uninstall(struct rte_eth_dev *dev)
        rte_intr_free_epoll_fd(intr_handle);
        rte_intr_vec_list_free(intr_handle);
        rte_intr_nb_efd_set(intr_handle, 0);
-
-       rte_intr_instance_free(intr_handle);
 }
 
 /**