On 2025-09-07 22:42, David Gibson wrote:
On Fri, Sep 05, 2025 at 10:11:46PM -0400, Jon Maloy wrote:
We add a cache table to keep partial contents of the kernel ARP/NDP
[...]
+ return mac_undefined(e->mac); +} + +/** + * mac_entry_expired() - Check if a cache entry has expired + * @e: Cache entry + * + * Return: True if the entry has expired, false otherwise + */ +static bool mac_entry_expired(const struct mac_cache_entry *e) +{ + struct timespec now; + + clock_gettime(CLOCK_MONOTONIC, &now);
Mostly we try to keep to a single clock_gettime() call per epoll cycle, passing 'now' down to the things we call there.
+ return timespec_before(&e->expiry, &now); +}
Passing this value along the whole call chain just for the unlikely case that we may need it here seems like a bad idea, especially since the performance gain is minimal. It would make some sense if we add it to the context struct or even as a global variable the set it in the main loop, and pass it along that way. What do you think? ///jon