diff mbox series

[ovs-dev,v5,04/13] conntrack: Add more coverage values for conntrack.

Message ID ac35ec920c32525e8752a4b64e20c63e61477590.1788272618.git.felix.huettner@digits.schwarz
State New
Delegated to: aaron conole
Headers show
Series Multiple conntrack performance improvements. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_FreeBSD_Build_and_Test success github build: passed

Commit Message

Felix Huettner Sept. 1, 2026, 2:24 p.m. UTC
Co-Authored-by: Florian Werner <florian.werner@digits.schwarz>
Signed-off-by: Florian Werner <florian.werner@digits.schwarz>
Co-Authored-by: Sebastian Riese <sebastian.riese@cloudandheat.com>
Signed-off-by: Sebastian Riese <sebastian.riese@cloudandheat.com>
Signed-off-by: Felix Huettner <felix.huettner@digits.schwarz>
---
 lib/conntrack.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/conntrack.c b/lib/conntrack.c
index af874545d..1a3e87c1e 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -54,6 +54,9 @@  COVERAGE_DEFINE(conntrack_l4csum_checked);
 COVERAGE_DEFINE(conntrack_l4csum_err);
 COVERAGE_DEFINE(conntrack_lookup_natted_miss);
 COVERAGE_DEFINE(conntrack_zone_full);
+COVERAGE_DEFINE(conntrack_remove);
+COVERAGE_DEFINE(conntrack_insert);
+COVERAGE_DEFINE(conntrack_maybe_not_found);
 
 struct conn_lookup_ctx {
     struct conn_key key;
@@ -590,6 +593,7 @@  conn_clean(struct conntrack *ct, struct conn *conn)
         return;
     }
 
+    COVERAGE_INC(conntrack_remove);
     ovs_mutex_lock(&ct->ct_lock);
     conn_clean__(ct, conn);
     ovs_mutex_unlock(&ct->ct_lock);
@@ -1027,10 +1031,12 @@  conn_insert(struct conntrack *ct, struct dp_packet *pkt,
             enum ct_alg_ctl_type ct_alg_ctl, uint32_t tp_id)
     OVS_REQUIRES(ct->ct_lock)
 {
-    struct conn *nc = NULL;
-
-    int64_t czl_limit;
     struct conn_key_node *fwd_key_node, *rev_key_node;
+    struct conn *nc = NULL;
+    int64_t czl_limit;
+
+    COVERAGE_INC(conntrack_insert);
+
     struct zone_limit *zl = zone_limit_lookup_or_default(ct,
                                                          ctx->key.zone);
     if (zl) {
@@ -1159,6 +1165,8 @@  conn_maybe_not_found(struct conntrack *ct, struct dp_packet *pkt,
 {
     struct conn *nc = NULL;
 
+    COVERAGE_INC(conntrack_maybe_not_found);
+
     /* Note that we only insert a connection if commit=true. In this
      * case we must ensure that the connection is not already part of
      * ct->conns. This means the lock needs to be held across the lookup and