#define MAX_QUEUE_LENGTH 512
#define FLOW_MISS_MAX_BATCH 50
#define REVALIDATE_MAX_BATCH 50
-#define MAX_IDLE 1500
VLOG_DEFINE_THIS_MODULE(ofproto_dpif_upcall);
}
skip:
- poll_timer_wait_until(start_time + MIN(MAX_IDLE, 500));
+ poll_timer_wait_until(start_time + MIN(ofproto_max_idle, 500));
seq_wait(udpif->reval_seq, udpif->last_reval_seq);
latch_wait(&udpif->exit_latch);
poll_block();
n_flows = udpif_get_n_flows(udpif);
must_del = false;
- max_idle = MAX_IDLE;
+ max_idle = ofproto_max_idle;
if (n_flows > flow_limit) {
must_del = n_flows > 2 * flow_limit;
max_idle = 100;
* ofproto-dpif implementation. */
extern unsigned ofproto_flow_limit;
+/* Maximum idle time (in ms) for flows to be cached in the datapath.
+ * Revalidators may expire flows more quickly than the configured value based
+ * on system load and other factors. This variable is subject to change. */
+extern unsigned ofproto_max_idle;
+
/* Number of upcall handler and revalidator threads. Only affects the
* ofproto-dpif implementation. */
extern size_t n_handlers, n_revalidators;
struct ovs_mutex ofproto_mutex = OVS_MUTEX_INITIALIZER;
unsigned ofproto_flow_limit = OFPROTO_FLOW_LIMIT_DEFAULT;
+unsigned ofproto_max_idle = OFPROTO_MAX_IDLE_DEFAULT;
size_t n_handlers, n_revalidators;
ofproto_flow_limit = limit;
}
+/* Sets the maximum idle time for flows in the datapath before they are
+ * expired. */
+void
+ofproto_set_max_idle(unsigned max_idle)
+{
+ ofproto_max_idle = max_idle;
+}
+
/* If forward_bpdu is true, the NORMAL action will forward frames with
* reserved (e.g. STP) destination Ethernet addresses. if forward_bpdu is false,
* the NORMAL action will drop these frames. */
)
#define OFPROTO_FLOW_LIMIT_DEFAULT 200000
+#define OFPROTO_MAX_IDLE_DEFAULT 1500
const char *ofproto_port_open_type(const char *datapath_type,
const char *port_type);
const struct sockaddr_in *, size_t n);
void ofproto_set_in_band_queue(struct ofproto *, int queue_id);
void ofproto_set_flow_limit(unsigned limit);
+void ofproto_set_max_idle(unsigned max_idle);
void ofproto_set_forward_bpdu(struct ofproto *, bool forward_bpdu);
void ofproto_set_mac_table_config(struct ofproto *, unsigned idle_time,
size_t max_entries);
ofproto_set_flow_limit(smap_get_int(&ovs_cfg->other_config, "flow-limit",
OFPROTO_FLOW_LIMIT_DEFAULT));
+ ofproto_set_max_idle(smap_get_int(&ovs_cfg->other_config, "max-idle",
+ OFPROTO_MAX_IDLE_DEFAULT));
ofproto_set_threads(
smap_get_int(&ovs_cfg->other_config, "n-handler-threads", 0),