From 2f3c7195a702178629575b637f3f9a91eabdab73 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Mon, 1 Apr 2024 12:36:40 -0300 Subject: net: enable timestamp static key if CPU For systems that use CPU isolation (via nohz_full), creating or destroying a socket with SO_TIMESTAMP, SO_TIMESTAMPNS or SO_TIMESTAMPING with flag SOF_TIMESTAMPING_RX_SOFTWARE will cause a static key to be enabled/disabled. This in turn causes undesired IPIs to isolated CPUs. So enable the static key unconditionally, if CPU isolation is enabled, thus avoiding the IPIs. Signed-off-by: Marcelo Tosatti Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/ZgrUiLLtbEUf9SFn@tpad Signed-off-by: Jakub Kicinski --- net/core/dev.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'net/core/dev.c') diff --git a/net/core/dev.c b/net/core/dev.c index 818699dea9d7..9b821d96eff3 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -11911,6 +11912,10 @@ static int __init net_dev_init(void) NULL, dev_cpu_dead); WARN_ON(rc < 0); rc = 0; + + /* avoid static key IPIs to isolated CPUs */ + if (housekeeping_enabled(HK_TYPE_MISC)) + net_enable_timestamp(); out: if (rc < 0) { for_each_possible_cpu(i) { -- cgit v1.2.3-70-g09d2