@@ -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
Example: ovs-appctl dpctl/ct-get-glbl-cfg totconn CC: Darrell Ball <dlu998@gmail.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> --- lib/conntrack.c | 10 ++++++++++ 1 file changed, 10 insertions(+)