Patch "xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL" 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

    xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL

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:
     xdp-reflect-tail-increase-for-mem_type_xsk_buff_pool.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 87e3f813265f9528c9b11271cb2531f4952a8a26
Author: Maciej Fijalkowski <maciej.fijalkowski@xxxxxxxxx>
Date:   Wed Jan 24 20:16:00 2024 +0100

    xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL
    
    [ Upstream commit fbadd83a612c3b7aad2987893faca6bd24aaebb3 ]
    
    XSK ZC Rx path calculates the size of data that will be posted to XSK Rx
    queue via subtracting xdp_buff::data_end from xdp_buff::data.
    
    In bpf_xdp_frags_increase_tail(), when underlying memory type of
    xdp_rxq_info is MEM_TYPE_XSK_BUFF_POOL, add offset to data_end in tail
    fragment, so that later on user space will be able to take into account
    the amount of bytes added by XDP program.
    
    Fixes: 24ea50127ecf ("xsk: support mbuf on ZC RX")
    Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20240124191602.566724-10-maciej.fijalkowski@xxxxxxxxx
    Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/core/filter.c b/net/core/filter.c
index 46ee0f5433e3..01f2417deef2 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -4081,6 +4081,8 @@ static int bpf_xdp_frags_increase_tail(struct xdp_buff *xdp, int offset)
 	memset(skb_frag_address(frag) + skb_frag_size(frag), 0, offset);
 	skb_frag_size_add(frag, offset);
 	sinfo->xdp_frags_size += offset;
+	if (rxq->mem.type == MEM_TYPE_XSK_BUFF_POOL)
+		xsk_buff_get_tail(xdp)->data_end += offset;
 
 	return 0;
 }




[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