From 15be1bfd81ed6d0b708e0541429f8813ce8d0972 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 16 Jan 2024 16:16:13 +1100 Subject: icmp: Simplify socket expiry scanning Currently we use icmp_act[] to scan for ICMP ids which might have an open socket which could time out. However icmp_act[] contains no information that's not already in icmp_id_map[] - it's just an "index" which allows scanning for relevant entries with less cache footprint. We only scan for ICMP socket expiry every 1s, though, so it's not clear that cache footprint really matters. Furthermore, there's no strong reason we need to scan even that often - the timeout is fairly arbitrary and approximate. So, eliminate icmp_act[] in favour of directly scanning icmp_id_map[] and compensate for the cache impact by reducing the scan frequency to once every 10s. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- icmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'icmp.h') diff --git a/icmp.h b/icmp.h index 1a08594..4096c65 100644 --- a/icmp.h +++ b/icmp.h @@ -6,7 +6,7 @@ #ifndef ICMP_H #define ICMP_H -#define ICMP_TIMER_INTERVAL 1000 /* ms */ +#define ICMP_TIMER_INTERVAL 10000 /* ms */ struct ctx; -- cgit v1.2.3