aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-12-08 12:32:33 -0800
committerBen Pfaff <blp@nicira.com>2012-12-08 12:33:30 -0800
commitc4069512603ea753576911da052b3f233026886d (patch)
tree17d6c910dc43a956dc0063d1ce9980719144e7cf /vswitchd
parent93161ce9491e5399ceaf0e47e47a3eedf1b9be4c (diff)
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>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c19
-rw-r--r--vswitchd/vswitch.xml9
2 files changed, 23 insertions, 5 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index b1d2feb0..53dd2f65 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -182,7 +182,7 @@ static void bridge_configure_datapath_id(struct bridge *);
static void bridge_configure_flow_eviction_threshold(struct bridge *);
static void bridge_configure_netflow(struct bridge *);
static void bridge_configure_forward_bpdu(struct bridge *);
-static void bridge_configure_mac_idle_time(struct bridge *);
+static void bridge_configure_mac_table(struct bridge *);
static void bridge_configure_sflow(struct bridge *, int *sflow_bridge_number);
static void bridge_configure_stp(struct bridge *);
static void bridge_configure_tables(struct bridge *);
@@ -591,7 +591,7 @@ bridge_reconfigure_continue(const struct ovsrec_open_vswitch *ovs_cfg)
bridge_configure_mirrors(br);
bridge_configure_flow_eviction_threshold(br);
bridge_configure_forward_bpdu(br);
- bridge_configure_mac_idle_time(br);
+ bridge_configure_mac_table(br);
bridge_configure_remotes(br, managers, n_managers);
bridge_configure_netflow(br);
bridge_configure_sflow(br, &sflow_bridge_number);
@@ -1493,18 +1493,27 @@ bridge_configure_forward_bpdu(struct bridge *br)
false));
}
-/* Set MAC aging time for 'br'. */
+/* Set MAC learning table configuration for 'br'. */
static void
-bridge_configure_mac_idle_time(struct bridge *br)
+bridge_configure_mac_table(struct bridge *br)
{
const char *idle_time_str;
int idle_time;
+ const char *mac_table_size_str;
+ int mac_table_size;
+
idle_time_str = smap_get(&br->cfg->other_config, "mac-aging-time");
idle_time = (idle_time_str && atoi(idle_time_str)
? atoi(idle_time_str)
: MAC_ENTRY_DEFAULT_IDLE_TIME);
- ofproto_set_mac_idle_time(br->ofproto, idle_time);
+
+ mac_table_size_str = smap_get(&br->cfg->other_config, "mac-table-size");
+ mac_table_size = (mac_table_size_str && atoi(mac_table_size_str)
+ ? atoi(mac_table_size_str)
+ : MAC_DEFAULT_MAX);
+
+ ofproto_set_mac_table_config(br->ofproto, idle_time, mac_table_size);
}
static void
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 31c15b41..c78899f7 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -623,6 +623,15 @@
transmit packets.
</p>
</column>
+
+ <column name="other_config" key="mac-table-size"
+ type='{"type": "integer", "minInteger": 1}'>
+ <p>
+ The maximum number of MAC addresses to learn. The default is
+ currently 2048. The value, if specified, is forced into a reasonable
+ range, currently 10 to 1,000,000.
+ </p>
+ </column>
</group>
<group title="Bridge Status">