> -----Original Message-----
> From: Zaremba, Larysa <[email protected]>
> Sent: Tuesday, February 17, 2026 2:25 PM
> To: [email protected]
> Cc: Zaremba, Larysa <[email protected]>; Claudiu Manoil
> <[email protected]>; Vladimir Oltean <[email protected]>;
> Wei Fang <[email protected]>; Clark Wang <[email protected]>;
> Andrew Lunn <[email protected]>; David S. Miller
> <[email protected]>; Eric Dumazet <[email protected]>; Jakub
> Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Nguyen,
> Anthony L <[email protected]>; Kitszel, Przemyslaw
> <[email protected]>; Alexei Starovoitov <[email protected]>;
> Daniel Borkmann <[email protected]>; Jesper Dangaard Brouer
> <[email protected]>; John Fastabend <[email protected]>;
> Stanislav Fomichev <[email protected]>; Andrii Nakryiko
> <[email protected]>; Martin KaFai Lau <[email protected]>; Eduard
> Zingerman <[email protected]>; Song Liu <[email protected]>; Yonghong
> Song <[email protected]>; KP Singh <[email protected]>; Hao Luo
> <[email protected]>; Jiri Olsa <[email protected]>; Simon Horman
> <[email protected]>; Shuah Khan <[email protected]>; Lobakin, Aleksander
> <[email protected]>; Fijalkowski, Maciej
> <[email protected]>; Bastien Curutchet (eBPF Foundation)
> <[email protected]>; Vyavahare, Tushar
> <[email protected]>; Jason Xing <[email protected]>;
> Ricardo B. Marlière <[email protected]>; Eelco Chaudron
> <[email protected]>; Lorenzo Bianconi <[email protected]>; Toke
> Hoiland-Jorgensen <[email protected]>; [email protected];
> [email protected]; [email protected]; intel-wired-
> [email protected]; [email protected]; Loktionov,
> Aleksandr <[email protected]>; Dragos Tatulea
> <[email protected]>
> Subject: [PATCH bpf v3 2/9] xsk: introduce helper to determine rxq-
> >frag_size
>
> rxq->frag_size is basically a step between consecutive strictly
> aligned
> frames. In ZC mode, chunk size fits exactly, but if chunks are
> unaligned, there is no safe way to determine accessible space to grow
> tailroom.
>
> Report frag_size to be zero, if chunks are unaligned, chunk_size
> otherwise.
>
> Fixes: 24ea50127ecf ("xsk: support mbuf on ZC RX")
> Signed-off-by: Larysa Zaremba <[email protected]>
> ---
> include/net/xdp_sock_drv.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/net/xdp_sock_drv.h b/include/net/xdp_sock_drv.h
> index 242e34f771cc..09d972f4bd60 100644
> --- a/include/net/xdp_sock_drv.h
> +++ b/include/net/xdp_sock_drv.h
> @@ -51,6 +51,11 @@ static inline u32 xsk_pool_get_rx_frame_size(struct
> xsk_buff_pool *pool)
> return xsk_pool_get_chunk_size(pool) -
> xsk_pool_get_headroom(pool); }
>
> +static inline u32 xsk_pool_get_rx_frag_step(struct xsk_buff_pool
> *pool)
> +{
> + return pool->unaligned ? 0 : xsk_pool_get_chunk_size(pool); }
> +
> static inline void xsk_pool_set_rxq_info(struct xsk_buff_pool *pool,
> struct xdp_rxq_info *rxq)
> {
> @@ -337,6 +342,11 @@ static inline u32
> xsk_pool_get_rx_frame_size(struct xsk_buff_pool *pool)
> return 0;
> }
>
> +static inline u32 xsk_pool_get_rx_frag_step(struct xsk_buff_pool
> *pool)
> +{
> + return 0;
> +}
> +
> static inline void xsk_pool_set_rxq_info(struct xsk_buff_pool *pool,
> struct xdp_rxq_info *rxq)
> {
> --
> 2.52.0
Reviewed-by: Aleksandr Loktionov <[email protected]>