1
0
Fork 0
forked from nuttx/nuttx-update

drivers/net/{e1000|igc}: configure RX/TX descriptors from Kconfig

configure E1000/IGC RX/TX descriptors from Kconfig

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
p-szafonimateusz 2024-11-07 08:45:19 +01:00 committed by Xiang Xiao
parent 3d5cf53624
commit bf4eadf735
3 changed files with 36 additions and 4 deletions

View file

@ -777,12 +777,28 @@ menuconfig NET_E1000
if NET_E1000
config NET_E1000_TXDESC
int "Intel E1000 TX descriptors"
default 256
config NET_E1000_RXDESC
int "Intel E1000 RX descriptors"
default 256
config NET_E1000_RXSPARE
int "Intel E1000 spare RX buffers"
default 8
endif # NET_E1000
config NET_IGC_TXDESC
int "Intel IGC TX descriptors"
default 256
config NET_IGC_RXDESC
int "Intel IGC RX descriptors"
default 256
menuconfig NET_IGC
bool "Intel IGC support"
default n

View file

@ -46,6 +46,14 @@
* Pre-processor Definitions
*****************************************************************************/
#if CONFIG_NET_E1000_TXDESC % 2 != 0
# error CONFIG_NET_E1000_TXDESC must be multiple of 2
#endif
#if CONFIG_NET_E1000_RXDESC % 2 != 0
# error CONFIG_NET_E1000_RXDESC must be multiple of 2
#endif
/* Packet buffer size */
#define E1000_PKTBUF_SIZE 2048
@ -53,8 +61,8 @@
/* TX and RX descriptors */
#define E1000_TX_DESC 256
#define E1000_RX_DESC 256
#define E1000_TX_DESC CONFIG_NET_E1000_TXDESC
#define E1000_RX_DESC CONFIG_NET_E1000_RXDESC
/* After RX packet is done, we provide free netpkt to the RX descriptor ring.
* The upper-half network logic is responsible for freeing the RX packets

View file

@ -46,6 +46,14 @@
* Pre-processor Definitions
*****************************************************************************/
#if CONFIG_NET_IGC_TXDESC % 2 != 0
# error CONFIG_NET_IGC_TXDESC must be multiple of 2
#endif
#if CONFIG_NET_IGC_RXDESC % 2 != 0
# error CONFIG_NET_IGC_RXDESC must be multiple of 2
#endif
/* Packet buffer size */
#define IGC_PKTBUF_SIZE 2048
@ -53,8 +61,8 @@
/* TX and RX descriptors */
#define IGC_TX_DESC 256
#define IGC_RX_DESC 256
#define IGC_TX_DESC CONFIG_NET_IGC_TXDESC
#define IGC_RX_DESC CONFIG_NET_IGC_RXDESC
/* After RX packet is done, we provide free netpkt to the RX descriptor ring.
* The upper-half network logic is responsible for freeing the RX packets