Skip to content

Commit

Permalink
Merge "Incasing the overflow table size of Flow and Bridge tables" in…
Browse files Browse the repository at this point in the history
…to R2.20
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jul 22, 2016
2 parents c60e49f + b04a7fd commit b9bfe63
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions dp-core/vr_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ struct vr_bridge_entry {
} __attribute__((packed));

#define VR_DEF_BRIDGE_ENTRIES (256 * 1024)
#define VR_DEF_BRIDGE_OENTRIES (4 * 1024)

unsigned int vr_bridge_entries = VR_DEF_BRIDGE_ENTRIES;
unsigned int vr_bridge_oentries = VR_DEF_BRIDGE_OENTRIES;
unsigned int vr_bridge_oentries = 0;
static vr_htable_t vn_rtable;
char vr_bcast_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

Expand Down Expand Up @@ -394,6 +393,9 @@ bridge_table_init(struct vr_rtable *rtable, struct rtable_fspec *fs)
if (rtable->algo_data)
return 0;

if (!vr_bridge_oentries)
vr_bridge_oentries = ((vr_bridge_entries / 5) + 1023) & ~1023;

rtable->algo_data = vr_htable_create(vrouter_get(0), vr_bridge_entries,
vr_bridge_oentries, sizeof(struct vr_bridge_entry),
sizeof(struct vr_bridge_entry_key), 0, bridge_entry_key);
Expand Down
10 changes: 8 additions & 2 deletions dp-core/vr_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
#define VR_DEF_FLOW_ENTRIES (512 * 1024)

#define VR_NUM_OFLOW_TABLES 1
#define VR_DEF_OFLOW_ENTRIES (8 * 1024)

#define VR_MAX_FLOW_TABLE_HOLD_COUNT \
4096

unsigned int vr_flow_entries = VR_DEF_FLOW_ENTRIES;
unsigned int vr_oflow_entries = VR_DEF_OFLOW_ENTRIES;
unsigned int vr_oflow_entries = 0;

/*
* host can provide its own memory . Point in case is the DPDK. In DPDK,
Expand Down Expand Up @@ -2148,6 +2147,13 @@ vr_flow_table_init(struct vrouter *router)
{
if (!router->vr_flow_table) {

/*
* Overflow entries is 20% of the main flow table
* adjusted to next 1k
*/
if (!vr_oflow_entries)
vr_oflow_entries = ((vr_flow_entries / 5) + 1023) & ~1023;

router->vr_flow_table = vr_htable_attach(router, vr_flow_entries,
vr_flow_table, vr_oflow_entries, vr_oflow_table,
sizeof(struct vr_flow_entry), 0, 0, vr_flow_get_key);
Expand Down
4 changes: 2 additions & 2 deletions dp-core/vr_htable.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@ __vr_htable_create(struct vrouter *router, unsigned int entries,
if (!bucket_size)
bucket_size = VR_HENTRIES_PER_BUCKET;

if (entries % bucket_size)
entries = (entries + bucket_size) & ~bucket_size;
/* Ceil to near upper number, which is dividable by bucket_size */
entries = ((entries + bucket_size -1) / bucket_size) * bucket_size;

table = vr_zalloc(sizeof(struct vr_htable));
if (!table) {
Expand Down

0 comments on commit b9bfe63

Please sign in to comment.