Skip to content

Commit 086efe0

Browse files
jahay1anguy11
authored andcommitted
idpf: cap maximum Rx buffer size
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: 74d1412 ("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>
1 parent 87b8ee6 commit 086efe0

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/net/ethernet/intel/idpf/idpf_txrx.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,10 @@ static int idpf_rx_buf_alloc_singleq(struct idpf_rx_queue *rxq)
695695
static int idpf_rx_bufs_init_singleq(struct idpf_rx_queue *rxq)
696696
{
697697
struct libeth_fq fq = {
698-
.count = rxq->desc_count,
699-
.type = LIBETH_FQE_MTU,
700-
.nid = idpf_q_vector_to_mem(rxq->q_vector),
698+
.count = rxq->desc_count,
699+
.type = LIBETH_FQE_MTU,
700+
.buf_len = IDPF_RX_MAX_BUF_SZ,
701+
.nid = idpf_q_vector_to_mem(rxq->q_vector),
701702
};
702703
int ret;
703704

@@ -754,6 +755,7 @@ static int idpf_rx_bufs_init(struct idpf_buf_queue *bufq,
754755
.truesize = bufq->truesize,
755756
.count = bufq->desc_count,
756757
.type = type,
758+
.buf_len = IDPF_RX_MAX_BUF_SZ,
757759
.hsplit = idpf_queue_has(HSPLIT_EN, bufq),
758760
.xdp = idpf_xdp_enabled(bufq->q_vector->vport),
759761
.nid = idpf_q_vector_to_mem(bufq->q_vector),

drivers/net/ethernet/intel/idpf/idpf_txrx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ do { \
101101
idx = 0; \
102102
} while (0)
103103

104+
#define IDPF_RX_MAX_BUF_SZ (16384 - 128)
104105
#define IDPF_RX_BUF_STRIDE 32
105106
#define IDPF_RX_BUF_POST_STRIDE 16
106107
#define IDPF_LOW_WATERMARK 64

0 commit comments

Comments
 (0)