Skip to content

Commit 34f9cd9

Browse files
stanislav-poborildkalowsk
authored andcommitted
drivers: ethernet: eth_nxp_enet_qos: increase default buffer descriptors
Increased the default number of TX and RX buffer descriptors from 4 to 16. Since the current default buffer size (CONFIG_NET_BUF_DATA_SIZE) is 128, increasing the number of RX buffers is needed to be able to receive at least one frame of a maximum size split between multiple buffers. The default number of TX buffers was increased to match the number of RX buffers and to be able to transmit large frames with many fragments. Added build-time configuration validation to ensure that the combined size of all RX buffers is sufficient to receive a maximum-sized Ethernet frame. Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
1 parent 4b06f23 commit 34f9cd9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

drivers/ethernet/eth_nxp_enet_qos/Kconfig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,21 @@ config ETH_NXP_ENET_QOS_MAC_UNIQUE_MAC_ADDRESS
3636

3737
config ETH_NXP_ENET_QOS_TX_BUFFER_DESCRIPTORS
3838
int "Number of tx buffer descriptors"
39-
default 4
39+
default 16
4040
range 4 1024
4141
help
4242
Number of TX buffer descriptors.
4343

4444
config ETH_NXP_ENET_QOS_RX_BUFFER_DESCRIPTORS
4545
int "Number of rx buffer descriptors"
46-
default 4
46+
default 16
4747
range 4 1024
4848
help
4949
Number of RX buffer descriptors.
50+
Each descriptor references a buffer of a size of CONFIG_NET_BUF_DATA_SIZE
51+
(with the two least significant bits ignored), so set this to a value
52+
large enough so that at least one frame of a maximum size can be
53+
received into all buffers combined.
5054

5155
config ETH_NXP_ENET_QOS_DMA_RESET_WAIT_TIME
5256
int "Time in microseconds to wait for software reset"

drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ LOG_MODULE_REGISTER(eth_nxp_enet_qos_mac, CONFIG_ETHERNET_LOG_LEVEL);
2424
#include "../eth.h"
2525
#include "nxp_enet_qos_priv.h"
2626

27+
/* Verify configuration */
28+
BUILD_ASSERT((ENET_QOS_RX_BUFFER_SIZE * NUM_RX_BUFDESC) >= ENET_QOS_MAX_NORMAL_FRAME_LEN,
29+
"ENET_QOS_RX_BUFFER_SIZE * NUM_RX_BUFDESC is not large enough to receive a full frame");
30+
2731
static const uint32_t rx_desc_refresh_flags =
2832
OWN_FLAG | RX_INTERRUPT_ON_COMPLETE_FLAG | BUF1_ADDR_VALID_FLAG;
2933

0 commit comments

Comments
 (0)