Skip to content

Commit

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

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

Fixes: 69dd4c3 ("net/avf: enable queue and device")

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 54b0828 commit 0a060a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/iavf/iavf_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,

len = rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM;
rxq->rx_buf_len = RTE_ALIGN_FLOOR(len, (1 << IAVF_RXQ_CTX_DBUFF_SHIFT));
rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len, IAVF_RX_MAX_DATA_BUF_SIZE);

/* Allocate the software ring. */
len = nb_desc + IAVF_RX_MAX_BURST;
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/iavf/iavf_rxtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
/* used for Rx Bulk Allocate */
#define IAVF_RX_MAX_BURST 32

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

/* used for Vector PMD */
#define IAVF_VPMD_RX_MAX_BURST 32
#define IAVF_VPMD_TX_MAX_BURST 32
Expand Down

0 comments on commit 0a060a3

Please sign in to comment.