1. Increase default MAC learn limit from 1M to 8M entries.
2. Check MAC learn limit in MAC learning update path.
3. Allow disable of want_l2_macs_events to set MAC learn limit
4. Other minor cleanups
Change-Id: I62438440937b5fa455e16f4a2e4d910277753395
Signed-off-by: John Lo <loj@cisco.com>
};
/** \brief Register to recive L2 MAC events for leanred and aged MAC
- Will also change MAC learn limit to L2LEARN_INFORM_LIMIT
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@param learn_limit - MAC learn limit, 0 => default to 1000
{
lm->client_pid = 0;
lm->client_index = 0;
- lm->global_learn_limit = L2LEARN_DEFAULT_LIMIT;
+ if (learn_limit)
+ lm->global_learn_limit = learn_limit;
+ else
+ lm->global_learn_limit = L2LEARN_DEFAULT_LIMIT;
}
exit:
if (PREDICT_FALSE (evt_idx >= fm->max_macs_in_event))
{
- /* evet message full, sent it and start a new one */
+ /* event message full, send it and start a new one */
if (q && (q->cursize < q->maxsize))
{
mp->n_macs = htonl (evt_idx);
if (PREDICT_TRUE (!update))
return;
+ else if (msm->global_learn_count > msm->global_learn_limit)
+ return; /* Above learn limit - do not update */
}
else if (result0->raw == ~0)
{
vnet_main_t *vnet_main;
} l2learn_main_t;
-#define L2LEARN_DEFAULT_LIMIT (L2FIB_NUM_BUCKETS * 16)
+#define L2LEARN_DEFAULT_LIMIT (L2FIB_NUM_BUCKETS * 128)
l2learn_main_t l2learn_main;