2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00

vswitchd: Make the maximum size of MAC learning tables user-configurable.

We've had a couple of requests for this over the years.  It's easy to do,
so let's implement it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
This commit is contained in:
Ben Pfaff
2012-12-08 12:32:33 -08:00
parent 93161ce949
commit c406951260
10 changed files with 131 additions and 20 deletions

View File

@@ -26,7 +26,8 @@
struct mac_learning;
#define MAC_MAX 2048
/* Default maximum size of a MAC learning table, in entries. */
#define MAC_DEFAULT_MAX 2048
/* Time, in seconds, before expiring a mac_entry due to inactivity. */
#define MAC_ENTRY_DEFAULT_IDLE_TIME 300
@@ -83,6 +84,7 @@ struct mac_learning {
uint32_t secret; /* Secret for randomizing hash table. */
unsigned long *flood_vlans; /* Bitmap of learning disabled VLANs. */
unsigned int idle_time; /* Max age before deleting an entry. */
size_t max_entries; /* Max number of learned MACs. */
};
/* Basics. */
@@ -96,6 +98,7 @@ void mac_learning_wait(struct mac_learning *);
bool mac_learning_set_flood_vlans(struct mac_learning *,
const unsigned long *bitmap);
void mac_learning_set_idle_time(struct mac_learning *, unsigned int idle_time);
void mac_learning_set_max_entries(struct mac_learning *, size_t max_entries);
/* Learning. */
bool mac_learning_may_learn(const struct mac_learning *,