diff --git a/drivers/ethernet/eth_nxp_enet_qos/Kconfig b/drivers/ethernet/eth_nxp_enet_qos/Kconfig index fcf03148e33..2f144244998 100644 --- a/drivers/ethernet/eth_nxp_enet_qos/Kconfig +++ b/drivers/ethernet/eth_nxp_enet_qos/Kconfig @@ -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" diff --git a/drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c b/drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c index 612705dc3a3..34b7639405b 100644 --- a/drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c +++ b/drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c @@ -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;