]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: use consistent tests for receive buffer size
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sat, 14 Mar 2026 09:43:00 +0000 (09:43 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 Mar 2026 03:32:08 +0000 (20:32 -0700)
Two out of the three sites that set the receive buffer size (via
stmmac_set_dma_bfsize()) check for rx_q->xsk_pool &&
rx_q->buf_alloc_num. One uses just rx_q->xsk_pool.

Discussing with Yoong Siang Song, the conclusion is that
stmmac_dma_operation_mode() is missing the rx_q->buf_alloc_num
check. Add this check.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1w1LWO-0000000DGSR-3CaB@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index dafd3a3e984426e42211f410d2fda74f512a6f53..b37bac337d6a0a288d1d519a66e77c3532ad631e 100644 (file)
@@ -2612,7 +2612,7 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
                stmmac_dma_rx_mode(priv, priv->ioaddr, rxmode, chan,
                                rxfifosz, qmode);
 
-               if (rx_q->xsk_pool) {
+               if (rx_q->xsk_pool && rx_q->buf_alloc_num) {
                        buf_size = xsk_pool_get_rx_frame_size(rx_q->xsk_pool);
                        stmmac_set_dma_bfsize(priv, priv->ioaddr,
                                              buf_size,