From b3139c8a0820e5b6df3c80240c7ce0658d895120 Mon Sep 17 00:00:00 2001 From: Arto Kinnunen Date: Wed, 22 Aug 2018 13:24:50 +0300 Subject: [PATCH] Adjust Thread BBR neighbor/destination cache size (#1793) Allow Thread BBR to have more entries in neighbor and destination cache. --- source/6LoWPAN/Thread/thread_bbr_api.c | 5 +++++ source/6LoWPAN/Thread/thread_config.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/source/6LoWPAN/Thread/thread_bbr_api.c b/source/6LoWPAN/Thread/thread_bbr_api.c index 6c0b09a2c0f..2ac17bcaceb 100644 --- a/source/6LoWPAN/Thread/thread_bbr_api.c +++ b/source/6LoWPAN/Thread/thread_bbr_api.c @@ -40,6 +40,7 @@ #include "common_functions.h" #include "thread_border_router_api.h" #include "thread_bbr_api.h" +#include "net_ipv6_api.h" #include "Common_Protocols/ipv6_constants.h" #include "DHCPv6_Server/DHCPv6_server_service.h" #include "thread_management_if.h" @@ -1099,7 +1100,11 @@ int thread_bbr_start(int8_t interface_id, int8_t backbone_interface_id) // By default multicast forwarding is not enabled as it causes multicast loops multicast_fwd_set_forwarding(this->interface_id, false); + // Adjust BBR neighbor and destination cache size + arm_nwk_ipv6_max_cache_entries(THREAD_BBR_IPV6_DESTINATION_CACHE_SIZE); + thread_extension_bbr_init(interface_id,backbone_interface_id); + return 0; #else return -1; diff --git a/source/6LoWPAN/Thread/thread_config.h b/source/6LoWPAN/Thread/thread_config.h index 49a0056308b..cd7406d6eba 100644 --- a/source/6LoWPAN/Thread/thread_config.h +++ b/source/6LoWPAN/Thread/thread_config.h @@ -326,6 +326,12 @@ */ #define THREAD_BBR_ROUTER_ID_REQUEST_STATUS THREAD_COAP_STATUS_TLV_HAVE_CHILD_ID_REQUEST +/* + * Number of destination and neighbor cache entries assuming 250 thread devices (worst case) connecting to cloud service. + * Six entries reserved for backbone devices. + */ +#define THREAD_BBR_IPV6_DESTINATION_CACHE_SIZE 256 + /* * Timeout to solicit address from DHCP if previous request fails. */