Skip to content

Commit

Permalink
Make sure we don't use CHIP_CONFIG_MAX_FABRICS before it's defined. (#…
Browse files Browse the repository at this point in the history
…27679)

The definition of CHIP_CONFIG_SECURE_SESSION_POOL_SIZE uses
CHIP_CONFIG_MAX_FABRICS but came before we ensures CHIP_CONFIG_MAX_FABRICS is
defined.  This change just moves it to right after the definition of
CHIP_CONFIG_MAX_FABRICS.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Feb 21, 2024
1 parent 3b4d362 commit d400096
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/lib/core/CHIPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,28 +667,6 @@
#define CHIP_CONFIG_UNAUTHENTICATED_CONNECTION_POOL_SIZE 4
#endif // CHIP_CONFIG_UNAUTHENTICATED_CONNECTION_POOL_SIZE

/**
* @def CHIP_CONFIG_SECURE_SESSION_POOL_SIZE
*
* @brief Defines the size of the pool used for tracking the state of
* secure sessions. This controls the maximum number of concurrent
* established secure sessions across all supported transports.
*
* This is sized by default to cover the sum of the following:
* - At least 3 CASE sessions / fabric (Spec Ref: 4.13.2.8)
* - 1 reserved slot for CASEServer as a responder.
* - 1 reserved slot for PASE.
*
* NOTE: On heap-based platforms, there is no pre-allocation of the pool.
* Due to the use of an LRU-scheme to manage sessions, the actual active
* size of the pool will grow up to the value of this define,
* after which, it will remain at or around this size indefinitely.
*
*/
#ifndef CHIP_CONFIG_SECURE_SESSION_POOL_SIZE
#define CHIP_CONFIG_SECURE_SESSION_POOL_SIZE (CHIP_CONFIG_MAX_FABRICS * 3 + 2)
#endif // CHIP_CONFIG_SECURE_SESSION_POOL_SIZE

/**
* @def CHIP_CONFIG_SECURE_SESSION_REFCOUNT_LOGGING
*
Expand All @@ -712,6 +690,28 @@
#define CHIP_CONFIG_MAX_FABRICS 16
#endif // CHIP_CONFIG_MAX_FABRICS

/**
* @def CHIP_CONFIG_SECURE_SESSION_POOL_SIZE
*
* @brief Defines the size of the pool used for tracking the state of
* secure sessions. This controls the maximum number of concurrent
* established secure sessions across all supported transports.
*
* This is sized by default to cover the sum of the following:
* - At least 3 CASE sessions / fabric (Spec Ref: 4.13.2.8)
* - 1 reserved slot for CASEServer as a responder.
* - 1 reserved slot for PASE.
*
* NOTE: On heap-based platforms, there is no pre-allocation of the pool.
* Due to the use of an LRU-scheme to manage sessions, the actual active
* size of the pool will grow up to the value of this define,
* after which, it will remain at or around this size indefinitely.
*
*/
#ifndef CHIP_CONFIG_SECURE_SESSION_POOL_SIZE
#define CHIP_CONFIG_SECURE_SESSION_POOL_SIZE (CHIP_CONFIG_MAX_FABRICS * 3 + 2)
#endif // CHIP_CONFIG_SECURE_SESSION_POOL_SIZE

/**
* @def CHIP_CONFIG_MAX_GROUP_DATA_PEERS
*
Expand Down

0 comments on commit d400096

Please sign in to comment.