Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1155286rdb; Fri, 16 Feb 2024 07:03:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVwQ9oNrs9b9LM+9OavFNTbwDnhsHImTlr+z4RvMOQ1kzGu/i0Xl+3/PoDyztp3T2TZCse4qoQIcWYrG1k5ykEd/Gn1qQoa2mJOo+T16Q== X-Google-Smtp-Source: AGHT+IHs3kqucpjSJ6KtV09bbaLnQOgNa72Oyc5vWAq/8K7OU6Dom24Nv6fhMUwKqwz0OE8ohSVb X-Received: by 2002:ac8:5991:0:b0:42d:c800:9635 with SMTP id e17-20020ac85991000000b0042dc8009635mr5398153qte.18.1708095782841; Fri, 16 Feb 2024 07:03:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708095782; cv=pass; d=google.com; s=arc-20160816; b=sb6TDi/URqHLi9KpNJlvlSoJcGuyjlLufNcF/vpEBPLhtl5r1HbyPWyczfOUbWphv9 Ahk6QcxKCytOCNcJe/e1iUBNZwxNCa3BBp/Qj0ILuTFodMgys6g6xSikO3so29rpCGIZ br+bWImbe+wvEdyL5qIMpUumXrdEnV3afazGmpnlKqx4vn4vXoYbI6um+E17nZfHP+am ZBYgFvA9zAlmH7wyYNeK3XIbHBu/BTPSYbguCBIKheZg/+0KzfhAVfpUMzYMpndBjdrN i9zN8Kyd2U/uOiUZ+N+4phAXRqB17kKWTx4dvcg2i1EvE56lZtr5SsYFFhi391kheCsP uaHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=aZ1RnOnTSLBiglbkhX1NHskWW94OsYikvhSwmo5Uu90=; fh=ZIVyYq35TavSok2dM29AVxDZPjjhTBUJp3Lu7dcXQ84=; b=0Z+g9+jkfSpm0hok2LF3Rg+qM3wUuZUAI9VRJGb3oseJku9jEO/5wleenU+gyZRqgz VSDihKK5U9+Lo+8Vbi72ITvHFDvDLglnAwW7oCkHkCxeymsqqKTZPpY7e1zFDopdS9bA EKm+7E3AlrV5w55+3ivkvcOXqW+U6AFDVMK+m8h3l9bCd5H/ZOrG/wqEkFXvhb31DcF/ KPTxtl4Dtp+iTeoZdYDcPztCc0odmAnbXK3N8fxMh0BCRA4X26n47Beer6bvqkFfXsa9 kodm2S+n0SZDRmkPX3nwzhwZWCJNPN5nXp1bwQhz3fVAdZ10j0khqp/SJefpdqJCUBi/ SH3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Y+i/G1OA"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-68776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68776-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x25-20020ac85399000000b0042c803f3ee3si3618809qtp.667.2024.02.16.07.03.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:03:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Y+i/G1OA"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-68776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68776-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 960BB1C20B8C for ; Fri, 16 Feb 2024 15:03:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F23D312F377; Fri, 16 Feb 2024 15:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y+i/G1OA" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE77A12C7FB for ; Fri, 16 Feb 2024 15:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708095777; cv=none; b=Km6koc1UUq0I6cpzPdKBchO1uDb5MqYTPwDQYTN7bb+JxZ2lf2dX+KkAoC3l38083R/TQ/7UmOAHpPHEbyl3nqZ7HpNthz3vSvW7BqIiwnwvUbagaNj6U8qpk3GQgdGGkZrmThJNiv/2zrO5dfaF9omIBlEBJ+X4FSeID7Wgreo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708095777; c=relaxed/simple; bh=GqVjIc3Y9GJCrVy/nye5izgJbw3sIDygaE+0C7huDFg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=kA20wpgxmszgwj3IbS1hNtO7AHufvJo9QrR0u1qBBw8ABNw7f6p9clrswY1CUP0lp5Ly5OweCKnWbcAil56qdmU3oja53OpsI+zqRo3IRDd0seqYgwCqb05loULvyauMGXnZUBP5donCMFtc3EhAdRfxAzB73t2wUHjoUgR0YUM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Y+i/G1OA; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708095773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=aZ1RnOnTSLBiglbkhX1NHskWW94OsYikvhSwmo5Uu90=; b=Y+i/G1OAhEhbfjjwzvvNOl/sHLxJfT+AtT3zfVECWlDpHoBeEjeZ0LsD2XsxS+batTiLHw OowJj+qZRPXBDWHqLqiIEiiqMX1kub07CGUCuoeOZfejL0UtWjWIAtV/fFan9WMrEjF0C7 qS1LLY7+iYmD2R19V8Wd8PevVklB/OY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-329-W3BTSf1FMa6m6Uev6EHpOg-1; Fri, 16 Feb 2024 10:02:51 -0500 X-MC-Unique: W3BTSf1FMa6m6Uev6EHpOg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F014684AE4A; Fri, 16 Feb 2024 15:02:50 +0000 (UTC) Received: from tpad.localdomain (unknown [10.96.133.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BDB1240C9444; Fri, 16 Feb 2024 15:02:50 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id B80BE4086D5AC; Fri, 16 Feb 2024 12:02:15 -0300 (-03) Date: Fri, 16 Feb 2024 12:02:15 -0300 From: Marcelo Tosatti To: linux-kernel@vger.kernel.org Cc: Jakub Kicinski , Eric Dumazet , Frederic Weisbecker , Valentin Schneider Subject: [PATCH] net/core/dev.c: enable timestamp static key if CPU isolation is configured Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 For systems that use CPU isolation (via nohz_full), creating or destroying a socket with timestamping (SOF_TIMESTAMPING_OPT_TX_SWHW) might 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 diff --git a/net/core/dev.c b/net/core/dev.c index 0d548431f3fa..cc9a77b4aa4e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -153,6 +153,7 @@ #include #include #include +#include #include "dev.h" #include "net-sysfs.h" @@ -11601,3 +11602,14 @@ static int __init net_dev_init(void) } subsys_initcall(net_dev_init); + +static int __init net_dev_late_init(void) +{ + /* avoid static key IPIs to isolated CPUs */ + if (housekeeping_enabled(HK_TYPE_MISC)) + net_enable_timestamp(); + + return 0; +} + +late_initcall(net_dev_late_init);