From 8e99db5801269644dd6c7f17afc54e3a8d7addc3 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sun, 21 Nov 2021 12:30:47 +1000 Subject: [PATCH] Kconfig: net: deprecate `NET_BUF_USER_DATA_LEN` As user data sizes are now set on a per pool basis, this Kconfig option has no purpose. Signed-off-by: Jordan Yates --- include/net/buf.h | 5 ----- include/net/net_pkt.h | 2 +- samples/net/sockets/can/prj.conf | 1 - samples/subsys/mgmt/mcumgr/smp_svr/overlay-udp.conf | 1 - .../subsys/usb/audio/headphones_microphone/prj.conf | 1 - samples/subsys/usb/audio/headset/prj.conf | 1 - subsys/mgmt/mcumgr/Kconfig | 3 --- subsys/net/Kconfig | 10 +++------- tests/bluetooth/controller/mock_ctrl/include/kconfig.h | 1 - tests/net/all/prj.conf | 1 - 10 files changed, 4 insertions(+), 22 deletions(-) diff --git a/include/net/buf.h b/include/net/buf.h index 5686947595..62718e980d 100644 --- a/include/net/buf.h +++ b/include/net/buf.h @@ -15,10 +15,6 @@ #include #include -#ifndef CONFIG_NET_BUF_USER_DATA_SIZE -#define CONFIG_NET_BUF_USER_DATA_SIZE 0 -#endif - #ifdef __cplusplus extern "C" { #endif @@ -1216,7 +1212,6 @@ extern const struct net_buf_data_cb net_buf_var_cb; * @param _destroy Optional destroy callback when buffer is freed. */ #define NET_BUF_POOL_DEFINE(_name, _count, _size, _ud_size, _destroy) \ - BUILD_ASSERT(_ud_size <= CONFIG_NET_BUF_USER_DATA_SIZE); \ NET_BUF_POOL_FIXED_DEFINE(_name, _count, _size, _ud_size, _destroy) /** diff --git a/include/net/net_pkt.h b/include/net/net_pkt.h index 50bdeb329b..9695320c87 100644 --- a/include/net/net_pkt.h +++ b/include/net/net_pkt.h @@ -1248,7 +1248,7 @@ static inline bool net_pkt_is_being_overwritten(struct net_pkt *pkt) */ #define NET_PKT_DATA_POOL_DEFINE(name, count) \ NET_BUF_POOL_DEFINE(name, count, CONFIG_NET_BUF_DATA_SIZE, \ - CONFIG_NET_BUF_USER_DATA_SIZE, NULL) + 0, NULL) /** @cond INTERNAL_HIDDEN */ diff --git a/samples/net/sockets/can/prj.conf b/samples/net/sockets/can/prj.conf index 9922f4fb67..e072d61ea1 100644 --- a/samples/net/sockets/can/prj.conf +++ b/samples/net/sockets/can/prj.conf @@ -34,4 +34,3 @@ CONFIG_CAN_LOG_LEVEL_DBG=y # Use smaller buffers for net_buf as CANBUS packets are quite small. CONFIG_NET_BUF_DATA_SIZE=64 -CONFIG_NET_BUF_USER_DATA_SIZE=0 diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/overlay-udp.conf b/samples/subsys/mgmt/mcumgr/smp_svr/overlay-udp.conf index dd0404bfba..d8ba2f363f 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/overlay-udp.conf +++ b/samples/subsys/mgmt/mcumgr/smp_svr/overlay-udp.conf @@ -11,7 +11,6 @@ CONFIG_NET_IPV6=y CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_POSIX_NAMES=y CONFIG_NET_CONNECTION_MANAGER=y -CONFIG_NET_BUF_USER_DATA_SIZE=24 CONFIG_NET_CONFIG_SETTINGS=y CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.1" CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1" diff --git a/samples/subsys/usb/audio/headphones_microphone/prj.conf b/samples/subsys/usb/audio/headphones_microphone/prj.conf index 83fcf807df..a0ec1b3025 100644 --- a/samples/subsys/usb/audio/headphones_microphone/prj.conf +++ b/samples/subsys/usb/audio/headphones_microphone/prj.conf @@ -11,7 +11,6 @@ CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y #net buf options CONFIG_NET_BUF=y -CONFIG_NET_BUF_USER_DATA_SIZE=0 #USB audio related configs CONFIG_USB_DEVICE_AUDIO=y diff --git a/samples/subsys/usb/audio/headset/prj.conf b/samples/subsys/usb/audio/headset/prj.conf index 83fcf807df..a0ec1b3025 100644 --- a/samples/subsys/usb/audio/headset/prj.conf +++ b/samples/subsys/usb/audio/headset/prj.conf @@ -11,7 +11,6 @@ CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y #net buf options CONFIG_NET_BUF=y -CONFIG_NET_BUF_USER_DATA_SIZE=0 #USB audio related configs CONFIG_USB_DEVICE_AUDIO=y diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 422f75d1e4..c6bc35807f 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -459,7 +459,4 @@ config MCUMGR_BUF_USER_DATA_SIZE Different mcumgr transports impose different requirements for this setting. A value of 4 is sufficient for UART, shell, and bluetooth. For UDP, the userdata must be large enough to hold a IPv4/IPv6 address. - - Note that CONFIG_NET_BUF_USER_DATA_SIZE must be at least as big as - MCUMGR_BUF_USER_DATA_SIZE. endif # MCUMGR diff --git a/subsys/net/Kconfig b/subsys/net/Kconfig index c4ea412d3c..d871d18c47 100644 --- a/subsys/net/Kconfig +++ b/subsys/net/Kconfig @@ -14,14 +14,10 @@ config NET_BUF if NET_BUF config NET_BUF_USER_DATA_SIZE - int "Size of user_data available in every network buffer" - default 8 if ((BT || NET_TCP) && 64BIT) || BT_ISO - default 4 - range 4 65535 if BT || NET_TCP - range 0 65535 + int "Size of user_data available in every network buffer (DEPRECATED)" + default 0 help - Amount of memory reserved in each network buffer for user data. In - most cases this can be left as the default value. + User data size is now set on a per-pool basis at declaration point config NET_BUF_LOG bool "Network buffer logging" diff --git a/tests/bluetooth/controller/mock_ctrl/include/kconfig.h b/tests/bluetooth/controller/mock_ctrl/include/kconfig.h index ccfe1f81c1..2c24b121b3 100644 --- a/tests/bluetooth/controller/mock_ctrl/include/kconfig.h +++ b/tests/bluetooth/controller/mock_ctrl/include/kconfig.h @@ -147,7 +147,6 @@ #define CONFIG_BT_LOG_LEVEL 1 #define CONFIG_BT_CTLR_COMPANY_ID 0x1234 #define CONFIG_BT_CTLR_SUBVERSION_NUMBER 0x5678 -#define CONFIG_NET_BUF_USER_DATA_SIZE 4096 #define CONFIG_BT_CTLR_ASSERT_HANDLER y #define CONFIG_BT_BUF_ACL_TX_COUNT 7 #define CONFIG_BT_BUF_ACL_TX_SIZE 27 diff --git a/tests/net/all/prj.conf b/tests/net/all/prj.conf index bc4fd60eb7..54ef3669b6 100644 --- a/tests/net/all/prj.conf +++ b/tests/net/all/prj.conf @@ -32,7 +32,6 @@ CONFIG_NET_PKT_TX_COUNT=10 CONFIG_NET_BUF_RX_COUNT=15 CONFIG_NET_BUF_TX_COUNT=15 CONFIG_NET_BUF_DATA_SIZE=96 -CONFIG_NET_BUF_USER_DATA_SIZE=10 CONFIG_NET_DEBUG_NET_PKT_ALLOC=y CONFIG_NET_DEBUG_NET_PKT_NON_FRAGILE_ACCESS=y CONFIG_NET_PKT_TIMESTAMP=y