Commit ef485216 authored by David S. Miller's avatar David S. Miller

Merge branch 'tun-fixes'

Yunjian Wang says:

====================
fixes for tun

There are few places on the receive path where packet receives and
packet drops were not accounted for. This patchset fixes that issue.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents d09486a0 f1084c42
...@@ -1630,13 +1630,19 @@ static int tun_xdp_act(struct tun_struct *tun, struct bpf_prog *xdp_prog, ...@@ -1630,13 +1630,19 @@ static int tun_xdp_act(struct tun_struct *tun, struct bpf_prog *xdp_prog,
switch (act) { switch (act) {
case XDP_REDIRECT: case XDP_REDIRECT:
err = xdp_do_redirect(tun->dev, xdp, xdp_prog); err = xdp_do_redirect(tun->dev, xdp, xdp_prog);
if (err) if (err) {
dev_core_stats_rx_dropped_inc(tun->dev);
return err; return err;
}
dev_sw_netstats_rx_add(tun->dev, xdp->data_end - xdp->data);
break; break;
case XDP_TX: case XDP_TX:
err = tun_xdp_tx(tun->dev, xdp); err = tun_xdp_tx(tun->dev, xdp);
if (err < 0) if (err < 0) {
dev_core_stats_rx_dropped_inc(tun->dev);
return err; return err;
}
dev_sw_netstats_rx_add(tun->dev, xdp->data_end - xdp->data);
break; break;
case XDP_PASS: case XDP_PASS:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment