summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorarikachen <eaglesora@gmail.com>2021-08-23 13:45:21 +0800
committerarikachen <eaglesora@gmail.com>2021-08-23 13:45:21 +0800
commita3f93e2fe318c096bc2eb50dd315d01064340681 (patch)
treee18bd70df664841a71328895a19fd480633bf6b2 /src
parentb31fbc47f5fcf8234c757558d7b0285348774086 (diff)
af_xdp: fix xsk_socket__delete left un-cleanup
Type: fix while xsk fd closed by clib_file_del_by_index fisrt, xsk_get_mmap_offsets will get wrong off in xsk_socket__delete, so munmap wrong place. Signed-off-by: arikachen <eaglesora@gmail.com> Change-Id: I95464e9b4eec99814bd32d7402c0d60a0605cef5
Diffstat (limited to 'src')
-rw-r--r--src/plugins/af_xdp/device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/af_xdp/device.c b/src/plugins/af_xdp/device.c
index 7a10bce4290..2600170704b 100644
--- a/src/plugins/af_xdp/device.c
+++ b/src/plugins/af_xdp/device.c
@@ -101,9 +101,6 @@ af_xdp_delete_if (vlib_main_t * vm, af_xdp_device_t * ad)
ethernet_delete_interface (vnm, ad->hw_if_index);
}
- for (i = 0; i < ad->rxq_num; i++)
- clib_file_del_by_index (&file_main, vec_elt (ad->rxqs, i).file_index);
-
for (i = 0; i < ad->txq_num; i++)
clib_spinlock_free (&vec_elt (ad->txqs, i).lock);
@@ -113,6 +110,9 @@ af_xdp_delete_if (vlib_main_t * vm, af_xdp_device_t * ad)
vec_foreach (umem, ad->umem)
xsk_umem__delete (*umem);
+ for (i = 0; i < ad->rxq_num; i++)
+ clib_file_del_by_index (&file_main, vec_elt (ad->rxqs, i).file_index);
+
if (ad->bpf_obj)
{
bpf_set_link_xdp_fd (ad->linux_ifindex, -1, 0);