From 6450d9989e78caf7d1a2f3cb3c501c4a751af0ef Mon Sep 17 00:00:00 2001 From: Akshai M Date: Tue, 12 May 2020 23:04:05 +0530 Subject: [PATCH] gnrc/pktbuf : Set Kconfig defaults and conditions Set Kconfig defaults for CPU and conditions to avoid conflict with CFLAGS Co-authored-by: Leandro Lanzieri --- cpu/cc430/Kconfig | 1 + cpu/msp430_common/Kconfig | 9 +++++++++ cpu/msp430fxyz/Kconfig | 1 + cpu/nrf51/Kconfig | 9 +++++++++ examples/default/Makefile | 3 +++ examples/gnrc_lorawan/Makefile | 6 ++++-- examples/gnrc_minimal/Makefile | 6 +++++- examples/nanocoap_server/Makefile | 3 +++ examples/suit_update/Makefile | 5 ++++- sys/net/gnrc/pktbuf/Kconfig | 10 +++++----- tests/conn_can/Makefile | 5 +++-- tests/driver_encx24j600/Makefile | 5 ++++- tests/driver_netdev_common/Makefile | 4 ++-- tests/driver_xbee/Makefile | 2 +- tests/gnrc_gomach/Makefile | 5 ++++- tests/gnrc_ipv6_fwd_w_sub/Makefile | 5 ++++- tests/gnrc_ipv6_nib/Makefile | 5 ++++- tests/gnrc_ipv6_nib_6ln/Makefile | 5 ++++- tests/gnrc_ipv6_nib_dns/Makefile | 6 +++++- tests/gnrc_lwmac/Makefile | 5 ++++- tests/gnrc_ndp/Makefile | 5 ++++- tests/gnrc_sixlowpan_frag/Makefile | 6 +++++- tests/gnrc_sixlowpan_iphc_w_vrb/Makefile | 6 +++++- tests/gnrc_sock_async_event/Makefile | 6 +++++- tests/gnrc_sock_dns/Makefile | 6 +++++- tests/gnrc_sock_ip/Makefile | 5 ++++- tests/gnrc_sock_neterr/Makefile | 6 +++++- tests/gnrc_sock_udp/Makefile | 5 ++++- tests/gnrc_udp/Makefile | 5 ++++- tests/netdev_test/Makefile | 5 ++++- tests/riotboot_flashwrite/Makefile | 5 ++++- 31 files changed, 128 insertions(+), 32 deletions(-) create mode 100644 cpu/cc430/Kconfig create mode 100644 cpu/msp430_common/Kconfig create mode 100644 cpu/msp430fxyz/Kconfig create mode 100644 cpu/nrf51/Kconfig diff --git a/cpu/cc430/Kconfig b/cpu/cc430/Kconfig new file mode 100644 index 0000000000..35a0e06706 --- /dev/null +++ b/cpu/cc430/Kconfig @@ -0,0 +1 @@ +source "$(RIOTCPU)/msp430_common/Kconfig" diff --git a/cpu/msp430_common/Kconfig b/cpu/msp430_common/Kconfig new file mode 100644 index 0000000000..146b1f7c29 --- /dev/null +++ b/cpu/msp430_common/Kconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2020 Freie Universitaet Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# +config GNRC_PKTBUF_SIZE + default 2560 + depends on KCONFIG_MODULE_GNRC_PKTBUF_STATIC diff --git a/cpu/msp430fxyz/Kconfig b/cpu/msp430fxyz/Kconfig new file mode 100644 index 0000000000..35a0e06706 --- /dev/null +++ b/cpu/msp430fxyz/Kconfig @@ -0,0 +1 @@ +source "$(RIOTCPU)/msp430_common/Kconfig" diff --git a/cpu/nrf51/Kconfig b/cpu/nrf51/Kconfig new file mode 100644 index 0000000000..54405cc646 --- /dev/null +++ b/cpu/nrf51/Kconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2020 Freie Universitaet Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# +config GNRC_PKTBUF_SIZE + default 2048 + depends on KCONFIG_MODULE_GNRC_PKTBUF_STATIC diff --git a/examples/default/Makefile b/examples/default/Makefile index 786244dad6..a75f7acffb 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -57,8 +57,11 @@ ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF))) # We use only the lower layers of the GNRC network stack, hence, we can # reduce the size of the packet buffer a bit + # Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 endif +endif FEATURES_OPTIONAL += periph_rtc diff --git a/examples/gnrc_lorawan/Makefile b/examples/gnrc_lorawan/Makefile index 95d7933b56..3d8a22d523 100644 --- a/examples/gnrc_lorawan/Makefile +++ b/examples/gnrc_lorawan/Makefile @@ -21,8 +21,10 @@ USEMODULE += $(DRIVER) # We can reduce the size of the packet buffer for LoRaWAN, since there's no IP # support. This will reduce RAM consumption. -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 - +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +endif ########################### COMPILE TIME CONFIGURATION ######################## # NOTE: The following options can be configured on runtime as well using diff --git a/examples/gnrc_minimal/Makefile b/examples/gnrc_minimal/Makefile index 26aa9cd721..51615e3e3f 100644 --- a/examples/gnrc_minimal/Makefile +++ b/examples/gnrc_minimal/Makefile @@ -24,7 +24,11 @@ USEMODULE += gnrc_icmpv6_echo USEMODULE += prng_minstd CFLAGS += -DLOG_LEVEL=LOG_NONE # disable log output -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +endif +CFLAGS += -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ -DGNRC_NETIF_IPV6_GROUPS_NUMOF=2 -DCONFIG_GNRC_IPV6_NIB_NUMOF=1 \ -DCONFIG_GNRC_IPV6_NIB_OFFL_NUMOF=1 # be able to configure at least one route diff --git a/examples/nanocoap_server/Makefile b/examples/nanocoap_server/Makefile index 4ceccaf119..b77fd6b4a9 100644 --- a/examples/nanocoap_server/Makefile +++ b/examples/nanocoap_server/Makefile @@ -42,7 +42,10 @@ ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) $(info Using low-memory configuration for microcoap_server.) ## low-memory tuning values # lower pktbuf buffer size + # Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1000 +endif USEMODULE += prng_minstd endif diff --git a/examples/suit_update/Makefile b/examples/suit_update/Makefile index 1ece8fc910..81426f8b63 100644 --- a/examples/suit_update/Makefile +++ b/examples/suit_update/Makefile @@ -8,7 +8,10 @@ BOARD ?= samr21-xpro RIOTBASE ?= $(CURDIR)/../.. # lower pktbuf size to something sufficient for this application -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2000 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2000 +endif # # Networking diff --git a/sys/net/gnrc/pktbuf/Kconfig b/sys/net/gnrc/pktbuf/Kconfig index a8e16347de..6bffeca63e 100644 --- a/sys/net/gnrc/pktbuf/Kconfig +++ b/sys/net/gnrc/pktbuf/Kconfig @@ -4,13 +4,13 @@ # General Public License v2.1. See the file LICENSE in the top level # directory for more details. # -menuconfig KCONFIG_MODULE_GNRC_PKTBUF - bool "Configure GNRC_PKTBUF" - depends on MODULE_GNRC_PKTBUF +menuconfig KCONFIG_MODULE_GNRC_PKTBUF_STATIC + bool "Configure the GNRC Packet Buffer" + depends on MODULE_GNRC_PKTBUF_STATIC help Configure the GNRC_PKTBUF using Kconfig. -if KCONFIG_MODULE_GNRC_PKTBUF +if KCONFIG_MODULE_GNRC_PKTBUF_STATIC config GNRC_PKTBUF_SIZE int "Maximum size of the static packet buffer" @@ -21,4 +21,4 @@ config GNRC_PKTBUF_SIZE packets (2 incoming, 2 outgoing; 2 * 2 * 1280 B = 5 KiB) + Meta-Data (roughly estimated to 1 KiB; might be smaller). -endif # KCONFIG_MODULE_GNRC_PKTBUF +endif # KCONFIG_MODULE_GNRC_PKTBUF_STATIC diff --git a/tests/conn_can/Makefile b/tests/conn_can/Makefile index ddf96e74f3..38be024118 100644 --- a/tests/conn_can/Makefile +++ b/tests/conn_can/Makefile @@ -33,8 +33,9 @@ ifneq (,$(filter ncv7356,$(TRX_TO_BUILD))) CFLAGS += -DNCV7356_MODE0_PIN=$(NCV7356_MODE0_PIN) CFLAGS += -DNCV7356_MODE1_PIN=$(NCV7356_MODE1_PIN) endif - -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=4096 +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=4096 +endif CFLAGS += -DCAN_PKT_BUF_SIZE=64 CFLAGS += -DCAN_ROUTER_MAX_FILTER=32 diff --git a/tests/driver_encx24j600/Makefile b/tests/driver_encx24j600/Makefile index 061fd1860c..8c6cd77344 100644 --- a/tests/driver_encx24j600/Makefile +++ b/tests/driver_encx24j600/Makefile @@ -9,7 +9,10 @@ USEMODULE += shell_commands USEMODULE += ps # lower pktbuf size -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2048 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2048 +endif # set board specific peripheral configurations ifneq (,$(filter nucleo-f334r8,$(BOARD))) diff --git a/tests/driver_netdev_common/Makefile b/tests/driver_netdev_common/Makefile index 42e1f6510a..9aa40120ed 100644 --- a/tests/driver_netdev_common/Makefile +++ b/tests/driver_netdev_common/Makefile @@ -6,8 +6,8 @@ USEMODULE += shell_commands USEMODULE += ps # allow to use a smaller packet buffer in low-PDU drivers -ifdef CONFIG_GNRC_PKTBUF_SIZE - CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=$(CONFIG_GNRC_PKTBUF_SIZE) +ifdef GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=$(GNRC_PKTBUF_SIZE) endif # gnrc is a meta module including all required, basic gnrc networking modules diff --git a/tests/driver_xbee/Makefile b/tests/driver_xbee/Makefile index 54379d0828..73ee157281 100644 --- a/tests/driver_xbee/Makefile +++ b/tests/driver_xbee/Makefile @@ -1,6 +1,6 @@ USEMODULE += xbee # No need of big buffer for this test -CONFIG_GNRC_PKTBUF_SIZE=512 +GNRC_PKTBUF_SIZE=512 include ../driver_netdev_common/Makefile diff --git a/tests/gnrc_gomach/Makefile b/tests/gnrc_gomach/Makefile index 426c13f3d1..29e6271182 100644 --- a/tests/gnrc_gomach/Makefile +++ b/tests/gnrc_gomach/Makefile @@ -30,7 +30,10 @@ USEMODULE += gnrc_gomach # We use only the lower layers of the GNRC network stack, hence, we can # reduce the size of the packet buffer a bit -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1024 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1024 +endif include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ipv6_fwd_w_sub/Makefile b/tests/gnrc_ipv6_fwd_w_sub/Makefile index 90b406e213..c9f37151e3 100644 --- a/tests/gnrc_ipv6_fwd_w_sub/Makefile +++ b/tests/gnrc_ipv6_fwd_w_sub/Makefile @@ -12,7 +12,10 @@ USEMODULE += shell USEMODULE += shell_commands USEMODULE += xtimer -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +endif CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ipv6_nib/Makefile b/tests/gnrc_ipv6_nib/Makefile index 2fcfba1424..cdd13654e5 100644 --- a/tests/gnrc_ipv6_nib/Makefile +++ b/tests/gnrc_ipv6_nib/Makefile @@ -8,7 +8,10 @@ USEMODULE += netdev_eth USEMODULE += netdev_test CFLAGS += -DGNRC_NETTYPE_NDP=GNRC_NETTYPE_TEST -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +endif CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ipv6_nib_6ln/Makefile b/tests/gnrc_ipv6_nib_6ln/Makefile index 22bfe8e53d..6850ec1481 100644 --- a/tests/gnrc_ipv6_nib_6ln/Makefile +++ b/tests/gnrc_ipv6_nib_6ln/Makefile @@ -12,7 +12,10 @@ USEMODULE += netdev_test # lower log-level to save memory of LOG_WARNING() in gnrc_netif CFLAGS += -DLOG_LEVEL=LOG_ERROR CFLAGS += -DGNRC_NETTYPE_NDP=GNRC_NETTYPE_TEST -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +endif CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ipv6_nib_dns/Makefile b/tests/gnrc_ipv6_nib_dns/Makefile index 9c75a1bd95..cb992a4ac0 100644 --- a/tests/gnrc_ipv6_nib_dns/Makefile +++ b/tests/gnrc_ipv6_nib_dns/Makefile @@ -28,7 +28,11 @@ USEMODULE += posix_inet LOW_MEMORY_BOARDS := nucleo-f334r8 msb-430 msb-430h ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) - CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. + ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 + endif + CFLAGS += -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ -DGNRC_NETIF_IPV6_GROUPS_NUMOF=2 -DCONFIG_GNRC_IPV6_NIB_NUMOF=1 \ -DCONFIG_GNRC_IPV6_NIB_OFFL_NUMOF=1 endif diff --git a/tests/gnrc_lwmac/Makefile b/tests/gnrc_lwmac/Makefile index 08e0ee0850..33f64d19d0 100644 --- a/tests/gnrc_lwmac/Makefile +++ b/tests/gnrc_lwmac/Makefile @@ -27,7 +27,10 @@ USEMODULE += gnrc_lwmac # We use only the lower layers of the GNRC network stack, hence, we can # reduce the size of the packet buffer a bit -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +endif include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_ndp/Makefile b/tests/gnrc_ndp/Makefile index 813ae62725..d086579a44 100644 --- a/tests/gnrc_ndp/Makefile +++ b/tests/gnrc_ndp/Makefile @@ -8,7 +8,10 @@ USEMODULE += netdev_ieee802154 USEMODULE += netdev_test CFLAGS += -DGNRC_NETTYPE_NDP=GNRC_NETTYPE_TEST -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +endif CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sixlowpan_frag/Makefile b/tests/gnrc_sixlowpan_frag/Makefile index 370ab4eaa1..2cc98d2ef9 100644 --- a/tests/gnrc_sixlowpan_frag/Makefile +++ b/tests/gnrc_sixlowpan_frag/Makefile @@ -7,6 +7,10 @@ USEMODULE += embunit DISABLE_MODULE += auto_init_gnrc_% # we don't need all this packet buffer space so reduce it a little -CFLAGS += -DTEST_SUITES -DCONFIG_GNRC_PKTBUF_SIZE=2048 +CFLAGS += -DTEST_SUITES +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2048 +endif include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sixlowpan_iphc_w_vrb/Makefile b/tests/gnrc_sixlowpan_iphc_w_vrb/Makefile index a7157e8114..ffb234802a 100644 --- a/tests/gnrc_sixlowpan_iphc_w_vrb/Makefile +++ b/tests/gnrc_sixlowpan_iphc_w_vrb/Makefile @@ -10,6 +10,10 @@ USEMODULE += netdev_test USEMODULE += od # we don't need all this packet buffer space so reduce it a little -CFLAGS += -DTEST_SUITES -DCONFIG_GNRC_PKTBUF_SIZE=2048 +CFLAGS += -DTEST_SUITES +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2048 +endif include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sock_async_event/Makefile b/tests/gnrc_sock_async_event/Makefile index 41b43a3394..9727702f3f 100644 --- a/tests/gnrc_sock_async_event/Makefile +++ b/tests/gnrc_sock_async_event/Makefile @@ -10,7 +10,11 @@ USEMODULE += sock_async_event USEMODULE += od USEMODULE += xtimer -CFLAGS += -DSOCK_HAS_IPV6 -DCONFIG_GNRC_PKTBUF_SIZE=200 +CFLAGS += -DSOCK_HAS_IPV6 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 +endif # mock IPv6 gnrc_nettype CFLAGS += -DTEST_SUITES -DGNRC_NETTYPE_IPV6=GNRC_NETTYPE_TEST diff --git a/tests/gnrc_sock_dns/Makefile b/tests/gnrc_sock_dns/Makefile index abec92b480..14badc4d75 100644 --- a/tests/gnrc_sock_dns/Makefile +++ b/tests/gnrc_sock_dns/Makefile @@ -31,7 +31,11 @@ USEMODULE += posix_inet LOW_MEMORY_BOARDS := nucleo-f334r8 msb-430 msb-430h ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) - CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512 +endif + CFLAGS += -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=2 \ -DGNRC_NETIF_IPV6_GROUPS_NUMOF=2 -DCONFIG_GNRC_IPV6_NIB_NUMOF=1 \ -DCONFIG_GNRC_IPV6_NIB_OFFL_NUMOF=1 endif diff --git a/tests/gnrc_sock_ip/Makefile b/tests/gnrc_sock_ip/Makefile index 43f68cfaba..54f72d9453 100644 --- a/tests/gnrc_sock_ip/Makefile +++ b/tests/gnrc_sock_ip/Makefile @@ -4,7 +4,10 @@ USEMODULE += gnrc_sock_ip USEMODULE += gnrc_ipv6 USEMODULE += ps -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 +endif CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sock_neterr/Makefile b/tests/gnrc_sock_neterr/Makefile index 8ef9b3ddd7..04c518e298 100644 --- a/tests/gnrc_sock_neterr/Makefile +++ b/tests/gnrc_sock_neterr/Makefile @@ -7,6 +7,10 @@ USEMODULE += gnrc_sock_udp USEMODULE += od USEMODULE += xtimer -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 +endif + include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_sock_udp/Makefile b/tests/gnrc_sock_udp/Makefile index e489ec743e..1f857c780c 100644 --- a/tests/gnrc_sock_udp/Makefile +++ b/tests/gnrc_sock_udp/Makefile @@ -5,7 +5,10 @@ USEMODULE += gnrc_sock_udp USEMODULE += gnrc_ipv6 USEMODULE += ps -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=400 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=400 +endif CFLAGS += -DTEST_SUITES include $(RIOTBASE)/Makefile.include diff --git a/tests/gnrc_udp/Makefile b/tests/gnrc_udp/Makefile index af3e1ced54..aff031c6dc 100644 --- a/tests/gnrc_udp/Makefile +++ b/tests/gnrc_udp/Makefile @@ -16,7 +16,10 @@ USEMODULE += ps USEMODULE += netstats_l2 USEMODULE += netstats_ipv6 -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=8192 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=8192 +endif include $(RIOTBASE)/Makefile.include diff --git a/tests/netdev_test/Makefile b/tests/netdev_test/Makefile index d7605caea0..02f772f9a4 100644 --- a/tests/netdev_test/Makefile +++ b/tests/netdev_test/Makefile @@ -13,6 +13,9 @@ USEMODULE += netdev_eth USEMODULE += netdev_test USEMODULE += od -CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 +# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. +ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200 +endif include $(RIOTBASE)/Makefile.include diff --git a/tests/riotboot_flashwrite/Makefile b/tests/riotboot_flashwrite/Makefile index b14003ed62..03ca3a6ca2 100644 --- a/tests/riotboot_flashwrite/Makefile +++ b/tests/riotboot_flashwrite/Makefile @@ -39,7 +39,10 @@ ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS))) $(info Using low-memory configuration for microcoap_server.) ## low-memory tuning values # lower pktbuf buffer size - CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1000 + # Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig. + ifndef CONFIG_GNRC_PKTBUF_SIZE + CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1000 + endif USEMODULE += prng_minstd endif