@@ -2400,6 +2400,13 @@ conntrack_flush(struct conntrack *ct, const uint16_t *zone)
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;
+}
+
/* Set an interval value to be used by clean_thread_main. */
static int
wr_clean_int(struct conntrack *ct, uint32_t new_val) {
@@ -2435,11 +2442,14 @@ rd_max_conn(struct conntrack *ct, uint32_t *cur_val) {
#define CT_RW_MAX_CONN "maxconn"
/* Clean-up interval used by clean_thread_main() thread. */
#define CT_RW_CLEAN_INTERVAL "cleanup"
+/* 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_wk_params wk_params[] = {
{CT_RW_MAX_CONN, wr_max_conn, rd_max_conn},
{CT_RW_CLEAN_INTERVAL, wr_clean_int, rd_clean_int},
+ {CT_RW_TOT_CONN, NULL, rd_tot_conn},
};
int
Read current number of connections managed by the CT module. Example: ovs-appctl dpctl/ct-get totconn Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> --- lib/conntrack.c | 10 ++++++++++ 1 file changed, 10 insertions(+)