Skip to content

Commit

Permalink
net/i40e: fix Rx data buffer size
Browse files Browse the repository at this point in the history
[ upstream commit ff2ec0ce04739240205628207881a91e1e330cb7 ]

According to hardware spec, the data buffer size should not
be greater than 16K - 128.

Fixes: 4861cde ("i40e: new poll mode driver")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Junewu7777 authored and kevintraynor committed Jul 11, 2023
1 parent 1173611 commit d5755af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/i40e/i40e_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2904,6 +2904,8 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq)
rxq->rx_hdr_len = 0;
rxq->rx_buf_len = RTE_ALIGN_FLOOR(buf_size,
(1 << I40E_RXQ_CTX_DBUFF_SHIFT));
rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len,
I40E_RX_MAX_DATA_BUF_SIZE);
rxq->hs_mode = i40e_header_split_none;
break;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/i40e/i40e_rxtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
/* In none-PXE mode QLEN must be whole number of 32 descriptors. */
#define I40E_ALIGN_RING_DESC 32

/* Max data buffer size must be 16K - 128 bytes */
#define I40E_RX_MAX_DATA_BUF_SIZE (16 * 1024 - 128)

#define I40E_MIN_RING_DESC 64
#define I40E_MAX_RING_DESC 4096

Expand Down

0 comments on commit d5755af

Please sign in to comment.