]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
idpf: cap maximum Rx buffer size
authorJoshua Hay <joshua.a.hay@intel.com>
Mon, 3 Nov 2025 21:20:36 +0000 (13:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jan 2026 15:31:24 +0000 (16:31 +0100)
[ Upstream commit 086efe0a1ecc36cffe46640ce12649a4cd3ff171 ]

The HW only supports a maximum Rx buffer size of 16K-128. On systems
using large pages, the libeth logic can configure the buffer size to be
larger than this. The upper bound is PAGE_SIZE while the lower bound is
MTU rounded up to the nearest power of 2. For example, ARM systems with
a 64K page size and an mtu of 9000 will set the Rx buffer size to 16K,
which will cause the config Rx queues message to fail.

Initialize the bufq/fill queue buf_len field to the maximum supported
size. This will trigger the libeth logic to cap the maximum Rx buffer
size by reducing the upper bound.

Fixes: 74d1412ac8f37 ("idpf: use libeth Rx buffer management for payload buffer")
Signed-off-by: Joshua Hay <joshua.a.hay@intel.com>
Acked-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Madhu Chittim <madhu.chittim@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: David Decotigny <ddecotig@google.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/idpf/idpf_txrx.c
drivers/net/ethernet/intel/idpf/idpf_txrx.h

index d03fb063a1efa200d7e701c34f98ef998896d0aa..3ddf7b1e85ef47d3ff0950b8d6e17aa5cb7ad2c4 100644 (file)
@@ -655,9 +655,10 @@ err:
 static int idpf_rx_bufs_init_singleq(struct idpf_rx_queue *rxq)
 {
        struct libeth_fq fq = {
-               .count  = rxq->desc_count,
-               .type   = LIBETH_FQE_MTU,
-               .nid    = idpf_q_vector_to_mem(rxq->q_vector),
+               .count          = rxq->desc_count,
+               .type           = LIBETH_FQE_MTU,
+               .buf_len        = IDPF_RX_MAX_BUF_SZ,
+               .nid            = idpf_q_vector_to_mem(rxq->q_vector),
        };
        int ret;
 
@@ -714,6 +715,7 @@ static int idpf_rx_bufs_init(struct idpf_buf_queue *bufq,
                .truesize       = bufq->truesize,
                .count          = bufq->desc_count,
                .type           = type,
+               .buf_len        = IDPF_RX_MAX_BUF_SZ,
                .hsplit         = idpf_queue_has(HSPLIT_EN, bufq),
                .nid            = idpf_q_vector_to_mem(bufq->q_vector),
        };
index 48d55b373425ba3f40592ac38381148546729bf9..5f8a9b9f5d5d7cee03515cac15a1f540d1ef2597 100644 (file)
@@ -96,6 +96,7 @@ do {                                                          \
                idx = 0;                                        \
 } while (0)
 
+#define IDPF_RX_MAX_BUF_SZ                     (16384 - 128)
 #define IDPF_RX_BUF_STRIDE                     32
 #define IDPF_RX_BUF_POST_STRIDE                        16
 #define IDPF_LOW_WATERMARK                     64