Skip to content

Commit 1a09791

Browse files
jasowangdavem330
authored andcommitted
tuntap: move XDP flushing out of tun_do_xdp()
This will allow adding batch flushing on top. Signed-off-by: Jason Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8ae1aff commit 1a09791

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/tun.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,6 @@ static int tun_xdp_act(struct tun_struct *tun, struct bpf_prog *xdp_prog,
16601660
switch (act) {
16611661
case XDP_REDIRECT:
16621662
err = xdp_do_redirect(tun->dev, xdp, xdp_prog);
1663-
xdp_do_flush_map();
16641663
if (err)
16651664
return err;
16661665
break;
@@ -1749,6 +1748,8 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
17491748
err = tun_xdp_act(tun, xdp_prog, &xdp, act);
17501749
if (err < 0)
17511750
goto err_xdp;
1751+
if (err == XDP_REDIRECT)
1752+
xdp_do_flush_map();
17521753
if (err != XDP_PASS)
17531754
goto out;
17541755

0 commit comments

Comments
 (0)