1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Kconfig/pktbuf : Fix check for "CONFIG_GNRC_PKTBUF_SIZE"

This commit is contained in:
Akshai M 2020-10-16 14:07:52 +05:30
parent fc8961ec27
commit 977390f7f9
25 changed files with 128 additions and 102 deletions

View File

@ -54,13 +54,6 @@ ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF)))
USEMODULE += gnrc_txtsnd
# the application dumps received packets to stdout
USEMODULE += gnrc_pktdump
# 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
@ -72,5 +65,14 @@ endif
include $(RIOTBASE)/Makefile.include
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
# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk

View File

@ -20,13 +20,6 @@ DRIVER ?= sx1276
USEMODULE += $(DRIVER)
# We can reduce the size of the packet buffer for LoRaWAN, since there's no IP
# support. This will reduce RAM consumption.
# 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
# `ifconfig`
@ -58,6 +51,13 @@ CFLAGS += -DLORAMAC_DEFAULT_TX_MODE=LORAMAC_TX_CNF
include $(RIOTBASE)/Makefile.include
# We can reduce the size of the packet buffer for LoRaWAN, since there's no IP
# support. This will reduce RAM consumption.
# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig.
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512
endif
# Set region
ifeq (,$(CONFIG_LORAMAC_REGION_EU_868)$(CONFIG_LORAMAC_REGION_IN_865))
CFLAGS += -DCONFIG_LORAMAC_REGION_EU_868=1

View File

@ -33,10 +33,6 @@ ifneq (llvm, $(TOOLCHAIN))
endif
CFLAGS += -DLOG_LEVEL=LOG_NONE # disable log output
# 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
@ -46,5 +42,10 @@ QUIET ?= 1
include $(RIOTBASE)/Makefile.include
# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig.
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512
endif
# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk

View File

@ -40,11 +40,6 @@ LOW_MEMORY_BOARDS := nucleo-f334r8
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
@ -53,5 +48,13 @@ QUIET ?= 1
include $(RIOTBASE)/Makefile.include
ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
# 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
endif
# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk

View File

@ -7,12 +7,6 @@ BOARD ?= samr21-xpro
# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/../..
# lower pktbuf size to something sufficient for this application
# 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
#
@ -101,6 +95,12 @@ TEST_ON_CI_BLACKLIST = all
include $(RIOTBASE)/Makefile.include
# lower pktbuf size to something sufficient for this application
# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig.
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2000
endif
.PHONY: host-tools
host-tools:

View File

@ -31,9 +31,7 @@ ifneq (,$(filter ncv7356,$(TRX_TO_BUILD)))
CFLAGS += -DNCV7356_MODE0_PIN=$(NCV7356_MODE0_PIN)
CFLAGS += -DNCV7356_MODE1_PIN=$(NCV7356_MODE1_PIN)
endif
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=4096
endif
CFLAGS += -DCAN_PKT_BUF_SIZE=64
CFLAGS += -DCAN_ROUTER_MAX_FILTER=32
@ -41,3 +39,7 @@ CFLAGS += -DCAN_ROUTER_MAX_FILTER=32
CFLAGS += -Wno-missing-field-initializers
include $(RIOTBASE)/Makefile.include
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=4096
endif

View File

@ -8,12 +8,6 @@ USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps
# lower pktbuf size
# 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)))
# these settings are probably valid for PoEll-i on most nucelo boards, but
@ -36,3 +30,9 @@ CFLAGS += -DENCX24J600_INT=$(ENC_INT)
CFLAGS += -I$(CURDIR)
include $(RIOTBASE)/Makefile.include
# lower pktbuf size
# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig.
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2048
endif

View File

@ -28,6 +28,8 @@ USEMODULE += gnrc_pktdump
# Use GoMacH as the MAC protocol
USEMODULE += gnrc_gomach
include $(RIOTBASE)/Makefile.include
# 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.
@ -35,7 +37,5 @@ ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=1024
endif
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk

View File

@ -12,10 +12,11 @@ USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += xtimer
CFLAGS += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -8,10 +8,11 @@ USEMODULE += netdev_eth
USEMODULE += netdev_test
CFLAGS += -DGNRC_NETTYPE_NDP=GNRC_NETTYPE_TEST
CFLAGS += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -12,10 +12,11 @@ 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 += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -27,16 +27,6 @@ USEMODULE += posix_inet
LOW_MEMORY_BOARDS := nucleo-f334r8 msb-430 msb-430h
ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
# 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
# The test requires some setup and to be run as root
# So it cannot currently be run
TEST_ON_CI_BLACKLIST += all
@ -47,3 +37,13 @@ ethos:
$(Q)env -u CC -u CFLAGS $(MAKE) -C $(RIOTTOOLS)/ethos
include $(RIOTBASE)/Makefile.include
ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
# 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

View File

@ -25,6 +25,8 @@ USEMODULE += gnrc_pktdump
# Use LWMAC
USEMODULE += gnrc_lwmac
include $(RIOTBASE)/Makefile.include
# 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.
@ -32,7 +34,5 @@ ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512
endif
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk

View File

@ -9,10 +9,11 @@ USEMODULE += netdev_ieee802154
USEMODULE += netdev_test
CFLAGS += -DGNRC_NETTYPE_NDP=GNRC_NETTYPE_TEST
CFLAGS += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -8,9 +8,10 @@ DISABLE_MODULE += auto_init_gnrc_%
# we don't need all this packet buffer space so reduce it a little
CFLAGS += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -11,9 +11,10 @@ USEMODULE += od
# we don't need all this packet buffer space so reduce it a little
CFLAGS += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -10,11 +10,13 @@ USEMODULE += od
USEMODULE += xtimer
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
include $(RIOTBASE)/Makefile.include
# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig.
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=200
endif

View File

@ -28,16 +28,6 @@ USEMODULE += posix_inet
LOW_MEMORY_BOARDS := nucleo-f334r8 msb-430 msb-430h
ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
# 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
# The test requires some setup and to be run as root
# So it cannot currently be run
TEST_ON_CI_BLACKLIST += all
@ -48,3 +38,13 @@ ethos:
$(Q)env -u CC -u CFLAGS $(MAKE) -C $(RIOTTOOLS)/ethos
include $(RIOTBASE)/Makefile.include
ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
# 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

View File

@ -4,10 +4,11 @@ USEMODULE += sock_ip
USEMODULE += gnrc_ipv6
USEMODULE += ps
CFLAGS += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -7,10 +7,9 @@ USEMODULE += sock_udp
USEMODULE += od
USEMODULE += xtimer
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -5,10 +5,11 @@ USEMODULE += sock_udp
USEMODULE += gnrc_ipv6
USEMODULE += ps
CFLAGS += -DTEST_SUITES
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -16,12 +16,12 @@ USEMODULE += ps
USEMODULE += netstats_l2
USEMODULE += netstats_ipv6
include $(RIOTBASE)/Makefile.include
# 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
# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk

View File

@ -13,9 +13,9 @@ USEMODULE += netdev_eth
USEMODULE += netdev_test
USEMODULE += od
include $(RIOTBASE)/Makefile.include
# 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

View File

@ -23,9 +23,15 @@ LOW_MEMORY_BOARDS := nucleo-f334r8
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
USEMODULE += prng_minstd
endif
include $(RIOTBASE)/Makefile.include
ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
# 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
endif

View File

@ -37,11 +37,6 @@ LOW_MEMORY_BOARDS := nucleo-f334r8
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
@ -54,5 +49,13 @@ QUIET ?= 1
include $(RIOTBASE)/Makefile.include
ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
# 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
endif
# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk