X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdpo%2Freplicate_dpo.h;h=d21f52a4833c9b22b53396d4a173f7561f349a54;hb=e870d5b6ac3171355aa61e576a178734f97fafda;hp=908c20c1d56ea8996208c29d3d468914413087aa;hpb=33af8c1ed89f15cf0601ee891e9603bef16f2c93;p=vpp.git diff --git a/src/vnet/dpo/replicate_dpo.h b/src/vnet/dpo/replicate_dpo.h index 908c20c1d56..d21f52a4833 100644 --- a/src/vnet/dpo/replicate_dpo.h +++ b/src/vnet/dpo/replicate_dpo.h @@ -40,6 +40,12 @@ typedef struct replicate_main_t_ extern replicate_main_t replicate_main; +/** + * The number of buckets that a replicate object can have + * This must not overflow the rep_n_buckets field + */ +#define REP_MAX_BUCKETS 1024 + /** * The number of buckets that a load-balance object can have and still * fit in one cache-line @@ -108,6 +114,8 @@ typedef struct replicate_t_ { STATIC_ASSERT(sizeof(replicate_t) <= CLIB_CACHE_LINE_BYTES, "A replicate object size exceeds one cacheline"); +STATIC_ASSERT (REP_MAX_BUCKETS <= CLIB_U16_MAX, + "Too many buckets for replicate object"); /** * Flags controlling load-balance formatting/display