]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz
authorLarysa Zaremba <larysa.zaremba@intel.com>
Thu, 5 Mar 2026 11:12:45 +0000 (12:12 +0100)
committerSasha Levin <sashal@kernel.org>
Thu, 12 Mar 2026 11:09:59 +0000 (07:09 -0400)
commitb0f05100e8795aadd1c0606bae9caefbda070d63
tree3b2e628884d22a85ab43720dec8013746bb73933
parenta5b3a86b816732fb3431e264310ddb8c2c298df8
ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz

[ Upstream commit e142dc4ef0f451b7ef99d09aaa84e9389af629d7 ]

The only user of frag_size field in XDP RxQ info is
bpf_xdp_frags_increase_tail(). It clearly expects whole buff size instead
of DMA write size. Different assumptions in ice driver configuration lead
to negative tailroom.

This allows to trigger kernel panic, when using
XDP_ADJUST_TAIL_GROW_MULTI_BUFF xskxceiver test and changing packet size to
6912 and the requested offset to a huge value, e.g.
XSK_UMEM__MAX_FRAME_SIZE * 100.

Due to other quirks of the ZC configuration in ice, panic is not observed
in ZC mode, but tailroom growing still fails when it should not.

Use fill queue buffer truesize instead of DMA write size in XDP RxQ info.
Fix ZC mode too by using the new helper.

Fixes: 2fba7dc5157b ("ice: Add support for XDP multi-buffer on Rx side")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-5-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_base.c