Skip to content

Commit 7f1dc36

Browse files
committed
Fix NAT telemetry bug in standby dpservice
1 parent 21dfc34 commit 7f1dc36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/dp_nat.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ int dp_create_sync_snat_flows(void)
936936
const struct netnat_portoverload_tbl_key *portoverload_key;
937937
struct netnat_portoverload_sync_metadata *sync_metadata;
938938
uint64_t timestamp = rte_rdtsc(); // NOTE: synced flows will have full default timeout
939+
struct dp_port *port;
939940
uint32_t index = 0;
940941
int ret;
941942

@@ -946,6 +947,10 @@ int dp_create_sync_snat_flows(void)
946947
}
947948
if (DP_FAILED(dp_cntrack_from_sync_nat(portoverload_key, sync_metadata, timestamp)))
948949
DPS_LOG_WARNING("Cannot create conntrack flow from sync NAT entry");
950+
// only now increase the counter (because DEC() is only ever called by flow timeout)
951+
port = dp_get_port_by_id(sync_metadata->created_port_id);
952+
if (port)
953+
DP_STATS_NAT_INC_USED_PORT_CNT(port);
949954
}
950955
return DP_OK;
951956
}

0 commit comments

Comments
 (0)