Skip to content

Commit

Permalink
net/tap: fix interrupt handler freeing
Browse files Browse the repository at this point in the history
[ upstream commit 0809d87 ]

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: d61138d ("drivers: remove direct access to interrupt handle")

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Reviewed-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
pqarmitage authored and kevintraynor committed May 24, 2022
1 parent 41c0ba6 commit b839853
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions drivers/net/tap/rte_eth_tap.c
Expand Up @@ -1205,6 +1205,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;
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/tap/tap_intr.c
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit b839853

Please sign in to comment.