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>
This commit is contained in:
parent
4b06f2306d
commit
34f9cd9490
2 changed files with 10 additions and 2 deletions
|
@ -36,17 +36,21 @@ config ETH_NXP_ENET_QOS_MAC_UNIQUE_MAC_ADDRESS
|
|||
|
||||
config ETH_NXP_ENET_QOS_TX_BUFFER_DESCRIPTORS
|
||||
int "Number of tx buffer descriptors"
|
||||
default 4
|
||||
default 16
|
||||
range 4 1024
|
||||
help
|
||||
Number of TX buffer descriptors.
|
||||
|
||||
config ETH_NXP_ENET_QOS_RX_BUFFER_DESCRIPTORS
|
||||
int "Number of rx buffer descriptors"
|
||||
default 4
|
||||
default 16
|
||||
range 4 1024
|
||||
help
|
||||
Number of RX buffer descriptors.
|
||||
Each descriptor references a buffer of a size of CONFIG_NET_BUF_DATA_SIZE
|
||||
(with the two least significant bits ignored), so set this to a value
|
||||
large enough so that at least one frame of a maximum size can be
|
||||
received into all buffers combined.
|
||||
|
||||
config ETH_NXP_ENET_QOS_DMA_RESET_WAIT_TIME
|
||||
int "Time in microseconds to wait for software reset"
|
||||
|
|
|
@ -24,6 +24,10 @@ LOG_MODULE_REGISTER(eth_nxp_enet_qos_mac, CONFIG_ETHERNET_LOG_LEVEL);
|
|||
#include "../eth.h"
|
||||
#include "nxp_enet_qos_priv.h"
|
||||
|
||||
/* Verify configuration */
|
||||
BUILD_ASSERT((ENET_QOS_RX_BUFFER_SIZE * NUM_RX_BUFDESC) >= ENET_QOS_MAX_NORMAL_FRAME_LEN,
|
||||
"ENET_QOS_RX_BUFFER_SIZE * NUM_RX_BUFDESC is not large enough to receive a full frame");
|
||||
|
||||
static const uint32_t rx_desc_refresh_flags =
|
||||
OWN_FLAG | RX_INTERRUPT_ON_COMPLETE_FLAG | BUF1_ADDR_VALID_FLAG;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue