Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp118847lqi; Wed, 6 Mar 2024 11:42:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUWQUd1OQwWp+MljXblA2BKuodTQB4fgE3fpD1JMi9J7VNIS1sWVEook0aNxT3JLDRlHoy8UvdGDTPfLf/VqlsmngV84vpXio2dc3mXtA== X-Google-Smtp-Source: AGHT+IG2LaXmrlLqGVyh4q7l8Dbop366w1oCaQyqKe+y7mAyuX7u/zB0rIuKz555UcR4qOC+rNt0 X-Received: by 2002:a05:6358:7e16:b0:17b:efd7:ecfe with SMTP id o22-20020a0563587e1600b0017befd7ecfemr6603154rwm.7.1709754141391; Wed, 06 Mar 2024 11:42:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709754141; cv=pass; d=google.com; s=arc-20160816; b=T0kzErnA/IDRvfdtupD5E1/VawhedYxMow+gKCkSoF6EvT6LWI5yCj7MtAv09mPh9g JCj2cpkk8flYPJVRRAX0dRUo23jz3KjsX6dU/ehWmXmNhH/h6KCDlGqkIxe3kyjmS04b +xkER9SOpAlujzXip+n2oXaPDNbHq8ZlGaIh82/TYJGSjfOjk1298wat33/6CQZlwF6I L/7zfoQ9M4WssUpz3fwNvpjGY2N5/P6uO4PxXTDErwTAkP7pYgKK+Cq4hPU8oN00llVV GveTIEZ/Wv73ITgFGuqmD2oeBZ5BiD4JIUZCv80hYmQqrklaWU6gpTEtWoZAJXjMhVjA LlgQ== 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=7NzAkrFfDtAG1W4IZ9k3+0Y5QZ/B1qwXKO/PPRafIn0=; fh=FAgatP2hVymb49LNj3Pe151k8iWwltUkVsL4vF+tGSc=; b=pnJyFxLqep/3wv0xtvUQVXAalBksZQWaWs4zaGlb1e6lpIWnuQ2TU5BnLpWxU1Pzhg 9d3NeDV6STwmcWK8y8CtFUDjSjIKAvIYW3X4A4IYKM1QWZaS3wf/wwnKx7QZvK8UDqC2 DxREOuBNWAolLErapVznZW/SCMSAQcLFVszXgTp3vXU51Z1jtZEZpfFabwx7RrlWU28g 3zfLzg1F7WwRNDC0z3DgLUwNaLj5Aj8Gr9uILrGJRGT74/b4nrPoGUmM+WWwkch6351p co2lUzPur3wq2/gI2das1a4hdycosZrthE1E+Oib6oM31nnEh0K3K28TQ13yFq6Lzl+0 1nrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a0CcI12l; 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-94495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94495-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 kl10-20020a056214518a00b0068fdb1356b8si15207261qvb.427.2024.03.06.11.42.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 11:42:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94495-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=a0CcI12l; 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-94495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94495-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 204C31C21429 for ; Wed, 6 Mar 2024 19:42:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A79314037C; Wed, 6 Mar 2024 19:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="a0CcI12l" 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 E155C14036A for ; Wed, 6 Mar 2024 19:42:11 +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=1709754133; cv=none; b=fRia6DhuvZ5iyvO9ZJBxH9xfHcgaVxitbgLReRoEQSLejJm5deCCkHXtvc/yydHhMiaOQeWjiRNy+0ZnF6gBNT+8IEzYV7XO4gp4uy80yZ67Lktg/Ycvlv5UezcWfn0tVZR16C9OQ22QIWoDOQwUuP5xSyCZ5WSCXm5ENqwc+7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709754133; c=relaxed/simple; bh=fz8sVULSokUEtg1apAJP0N1kFWc3PTDlmYeHhou+7FM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=QhwMXA1FwSWEPcZ5CF/3f4/P23JVOyiRNFDTF/q9GPLHX/6h2th9T6UrOyuIA8b1+ysBQZP0XJ136XI3j8M+viv8oNA/IzOz4DIOzrb3DlNUjniik7vHGZQLvJt0Tj6DMvhQZyQM+UyNBFof0ogZwOrt4xOrcGfDYWtVQhKBiOo= 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=a0CcI12l; 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=1709754130; 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=7NzAkrFfDtAG1W4IZ9k3+0Y5QZ/B1qwXKO/PPRafIn0=; b=a0CcI12lmEMeC0/t28O87lqFYlN+bRKmfE+r90OiMs+rtWsIDZmQjZaPxa1TwmrjWsctSi d5AR04fRVxtUnrpJPcC7NhYydZbP7bLJRmS1wZ66PidXMMqAaAHO6+YVLPfYonA4TwTmWt ojQxfgvw7p+BhmrkwaLVbMUWJ8cBbyk= 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-135-lhnnuKE-NN-TQ7tU0BGcmw-1; Wed, 06 Mar 2024 14:42:08 -0500 X-MC-Unique: lhnnuKE-NN-TQ7tU0BGcmw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 1825185A58C; Wed, 6 Mar 2024 19:42:08 +0000 (UTC) Received: from tpad.localdomain (unknown [10.96.133.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D5B1BC041EF; Wed, 6 Mar 2024 19:42:07 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 3A5B04014ABF9; Wed, 6 Mar 2024 16:41:47 -0300 (-03) Date: Wed, 6 Mar 2024 16:41:47 -0300 From: Marcelo Tosatti To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Willem de Bruijn , Jakub Kicinski , Eric Dumazet , Frederic Weisbecker , Valentin Schneider , Paolo Abeni Subject: [PATCH net-next -v4] 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.8 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 --- v2: mention SOF_TIMESTAMPING_OPT_TX_SWHW in the commit log (Willem de Bruijn / Paolo Abeni) v3: SOF_TIMESTAMPING_OPT_TX_SWHW is irrelevant (Willem de Bruijn) v4: additional changelog improvements (Willem de Bruijn) diff --git a/net/core/dev.c b/net/core/dev.c index c588808be77f..15a32f5900e6 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -155,6 +155,7 @@ #include #include #include +#include #include "dev.h" #include "net-sysfs.h" @@ -11851,3 +11852,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);