mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 15:11:31 +00:00
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: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
ef48521672
@ -1630,13 +1630,19 @@ static int tun_xdp_act(struct tun_struct *tun, struct bpf_prog *xdp_prog,
|
||||
switch (act) {
|
||||
case XDP_REDIRECT:
|
||||
err = xdp_do_redirect(tun->dev, xdp, xdp_prog);
|
||||
if (err)
|
||||
if (err) {
|
||||
dev_core_stats_rx_dropped_inc(tun->dev);
|
||||
return err;
|
||||
}
|
||||
dev_sw_netstats_rx_add(tun->dev, xdp->data_end - xdp->data);
|
||||
break;
|
||||
case XDP_TX:
|
||||
err = tun_xdp_tx(tun->dev, xdp);
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
dev_core_stats_rx_dropped_inc(tun->dev);
|
||||
return err;
|
||||
}
|
||||
dev_sw_netstats_rx_add(tun->dev, xdp->data_end - xdp->data);
|
||||
break;
|
||||
case XDP_PASS:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user