@@ -2492,8 +2492,28 @@ conntrack_flush(struct conntrack *ct, const uint16_t *zone)
return 0;
}
+/* Set a new value for the upper limit of connections. */
+static int
+ct_wr_max_conn(struct conntrack *ct, uint32_t new_val) {
+ atomic_init(&ct->n_conn_limit, new_val);
+ return 0;
+}
+
+/* Read the current upper limit of connections. */
+static int
+ct_rd_max_conn(struct conntrack *ct, uint32_t *cur_val) {
+ atomic_read_relaxed(&ct->n_conn_limit, cur_val);
+ return 0;
+}
+
+/* List of managed parameters. */
+/* Max nr of connections managed by CT module. */
+#define CT_RW_MAX_CONN "maxconn"
+
/* List of parameters that can be read/written at run-time. */
-struct ct_cfg_params cfg_params[] = {};
+struct ct_cfg_params cfg_params[] = {
+ {CT_RW_MAX_CONN, ct_wr_max_conn, ct_rd_max_conn},
+};
int
conntrack_set_param(struct conntrack *ct,
Read/Write the upper limit value for connections. Example: # set a new upper limit ovs-appctl dpctl/ct-set-glbl-cfg maxconn=1000000 # display cur upper limit ovs-appctl dpctl/ct-get-glbl-cfg maxconn CC: Darrell Ball <dlu998@gmail.com> CC: Kevin Traynor <ktraynor@redhat.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> --- lib/conntrack.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)