diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2023-12-21 11:35:30 +0100 |
---|---|---|
committer | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2023-12-21 11:39:08 +0100 |
commit | f3b0004f8a5de433bf8a601a7e21c7f73b321cee (patch) | |
tree | 3df5e8100065c14ebccb4767c78a23ee75675825 /src/vnet/dpo/load_balance.h | |
parent | 70335e8e50e004f0ab111a5607becf0438d806bc (diff) |
fib: format deleted LB
This patch allows the formatting of deleted Load-balancer
objects. This is needed in the case a trace references a DPO
that went away in the interim.
Type: improvement
Change-Id: I6d67519b8d62f69aafde3c8fe3065bc85a7adbde
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet/dpo/load_balance.h')
-rw-r--r-- | src/vnet/dpo/load_balance.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/dpo/load_balance.h b/src/vnet/dpo/load_balance.h index 3605d82a207..eee073f5892 100644 --- a/src/vnet/dpo/load_balance.h +++ b/src/vnet/dpo/load_balance.h @@ -232,6 +232,14 @@ load_balance_get (index_t lbi) return (pool_elt_at_index(load_balance_pool, lbi)); } +static inline load_balance_t * +load_balance_get_or_null (index_t lbi) +{ + if (pool_is_free_index (load_balance_pool, lbi)) + return 0; + return (pool_elt_at_index (load_balance_pool, lbi)); +} + #define LB_HAS_INLINE_BUCKETS(_lb) \ ((_lb)->lb_n_buckets <= LB_NUM_INLINE_BUCKETS) |