X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=inline;f=src%2Fvnet%2Fdpo%2Fload_balance.h;h=5428e20e98173dc4e8ee051ef9a56cf5afd2b9d9;hb=2c41a61d5fc87737b9b46b88cb9271d0f987721e;hp=dd9589f9ee881723254604244b6f8ea8a3e905e8;hpb=eb987d3a09f669787014b1553f032219522149e1;p=vpp.git diff --git a/src/vnet/dpo/load_balance.h b/src/vnet/dpo/load_balance.h index dd9589f9ee8..5428e20e981 100644 --- a/src/vnet/dpo/load_balance.h +++ b/src/vnet/dpo/load_balance.h @@ -76,6 +76,28 @@ typedef struct load_balance_path_t_ { u32 path_weight; } load_balance_path_t; +/** + * Flags controlling load-balance creation and modification + */ +typedef enum load_balance_attr_t_ { + LOAD_BALANCE_ATTR_USES_MAP = 0, + LOAD_BALANCE_ATTR_STICKY = 1, +} load_balance_attr_t; + +#define LOAD_BALANCE_ATTR_NAMES { \ + [LOAD_BALANCE_ATTR_USES_MAP] = "uses-map", \ + [LOAD_BALANCE_ATTR_STICKY] = "sticky", \ +} + +#define FOR_EACH_LOAD_BALANCE_ATTR(_attr) \ + for (_attr = 0; _attr <= LOAD_BALANCE_ATTR_STICKY; _attr++) + +typedef enum load_balance_flags_t_ { + LOAD_BALANCE_FLAG_NONE = 0, + LOAD_BALANCE_FLAG_USES_MAP = (1 << 0), + LOAD_BALANCE_FLAG_STICKY = (1 << 1), +} __attribute__((packed)) load_balance_flags_t; + /** * The FIB DPO provieds; * - load-balancing over the next DPOs in the chain/graph @@ -105,6 +127,11 @@ typedef struct load_balance_t_ { */ dpo_proto_t lb_proto; + /** + * Flags concenring the LB's creation and modification + */ + load_balance_flags_t lb_flags; + /** * Flags from the load-balance's associated fib_entry_t */ @@ -148,7 +175,7 @@ typedef struct load_balance_t_ { } load_balance_t; STATIC_ASSERT(sizeof(load_balance_t) <= CLIB_CACHE_LINE_BYTES, - "A load_balance object size exceeds one cachline"); + "A load_balance object size exceeds one cacheline"); /** * Flags controlling load-balance formatting/display @@ -158,17 +185,10 @@ typedef enum load_balance_format_flags_t_ { LOAD_BALANCE_FORMAT_DETAIL = (1 << 0), } load_balance_format_flags_t; -/** - * Flags controlling load-balance creation and modification - */ -typedef enum load_balance_flags_t_ { - LOAD_BALANCE_FLAG_NONE = 0, - LOAD_BALANCE_FLAG_USES_MAP = (1 << 0), -} load_balance_flags_t; - extern index_t load_balance_create(u32 num_buckets, dpo_proto_t lb_proto, flow_hash_config_t fhc); +extern flow_hash_config_t load_balance_get_default_flow_hash(dpo_proto_t lb_proto); extern void load_balance_multipath_update( const dpo_id_t *dpo, const load_balance_path_t * raw_next_hops,