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

gnrc/pktbuf : Set Kconfig defaults and conditions

Set Kconfig defaults for CPU and conditions to avoid
conflict with CFLAGS

Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
This commit is contained in:
Akshai M 2020-05-12 23:04:05 +05:30
parent cabcfae9e0
commit 6450d9989e
31 changed files with 128 additions and 32 deletions

1
cpu/cc430/Kconfig Normal file
View File

@ -0,0 +1 @@
source "$(RIOTCPU)/msp430_common/Kconfig"

View File

@ -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

1
cpu/msp430fxyz/Kconfig Normal file
View File

@ -0,0 +1 @@
source "$(RIOTCPU)/msp430_common/Kconfig"

9
cpu/nrf51/Kconfig Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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