Patch "tun: fix missing dropped counter in tun_xdp_act" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tun: fix missing dropped counter in tun_xdp_act

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tun-fix-missing-dropped-counter-in-tun_xdp_act.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ba746249f1664840569f703c743616bbc33f83ed
Author: Yunjian Wang <wangyunjian@xxxxxxxxxx>
Date:   Fri Jan 19 18:22:35 2024 +0800

    tun: fix missing dropped counter in tun_xdp_act
    
    [ Upstream commit 5744ba05e7c4bff8fec133dd0f9e51ddffba92f5 ]
    
    The commit 8ae1aff0b331 ("tuntap: split out XDP logic") includes
    dropped counter for XDP_DROP, XDP_ABORTED, and invalid XDP actions.
    Unfortunately, that commit missed the dropped counter when error
    occurs during XDP_TX and XDP_REDIRECT actions. This patch fixes
    this issue.
    
    Fixes: 8ae1aff0b331 ("tuntap: split out XDP logic")
    Signed-off-by: Yunjian Wang <wangyunjian@xxxxxxxxxx>
    Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>
    Acked-by: Jason Wang <jasowang@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index afa5497f7c35..237fef557ba5 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1630,13 +1630,17 @@ 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;
+		}
 		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;
+		}
 		break;
 	case XDP_PASS:
 		break;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux