Skip to content

Commit ad21123

Browse files
committed
Fix NAT telemetry bug in standby dpservice
1 parent 054f396 commit ad21123

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
@@ -937,6 +937,7 @@ int dp_create_sync_snat_flows(void)
937937
const struct netnat_portoverload_tbl_key *portoverload_key;
938938
struct netnat_portoverload_sync_metadata *sync_metadata;
939939
uint64_t timestamp = rte_rdtsc(); // NOTE: synced flows will have full default timeout
940+
struct dp_port *port;
940941
uint32_t index = 0;
941942
int ret;
942943

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

0 commit comments

Comments
 (0)