Example:
ovs-appctl dpctl/ct-get-glbl-cfg totconn
CC: Darrell Ball <[email protected]>
Signed-off-by: Antonio Fischetti <[email protected]>
---
lib/conntrack.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/conntrack.c b/lib/conntrack.c
index 68d9030..ed2675b 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -2506,13 +2506,23 @@ ct_rd_max_conn(struct conntrack *ct, uint32_t *cur_val)
{
return 0;
}
+/* Read the total nr of connections currently managed. */
+static int
+rd_tot_conn(struct conntrack *ct, uint32_t *cur_val) {
+ *cur_val = atomic_count_get(&ct->n_conn);
+ return 0;
+}
+
/* List of managed parameters. */
/* Max nr of connections managed by CT module. */
#define CT_RW_MAX_CONN "maxconn"
+/* Total nr of connections currently managed by CT module. */
+#define CT_RW_TOT_CONN "totconn"
/* List of parameters that can be read/written at run-time. */
struct ct_cfg_params cfg_params[] = {
{CT_RW_MAX_CONN, ct_wr_max_conn, ct_rd_max_conn},
+ {CT_RW_TOT_CONN, NULL, rd_tot_conn},
};
int
--
2.4.11
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev