Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2404244lqp; Sun, 24 Mar 2024 18:06:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbRtW3RXaeU8PXiqAOisWpSTvWMSLwDoHCDEzQWhTCXumly+9tkakr+JCnacNX+bdJLEeazcLwNgPbo8BLitWdWL8l9L+13lIl47/K9w== X-Google-Smtp-Source: AGHT+IH1//0JJXk9GaNQIl2qgK7SsfS/IaYVQWdtuKpaeQJKFEZ5arRuuLBqYZbYjU/HcWAYMaKm X-Received: by 2002:a25:f447:0:b0:dbd:c442:9e60 with SMTP id p7-20020a25f447000000b00dbdc4429e60mr4122135ybe.36.1711328793914; Sun, 24 Mar 2024 18:06:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711328793; cv=pass; d=google.com; s=arc-20160816; b=a+VymOviJ8lnMzR53B6LfpfxcU63MSkpPoyFhYSBUQbkqzy+A3R1W9VyMu8HmO3YqR D5Hqpkv5q9Fx/HLd1VkEXPWR0nB3osKJ2rXHaLh+Z4ADoc9B0To74WtAJ6aLHyVVypiQ W/1rcHE6cGYdH+87shbe2Ea2ODlNzUTPJAP2EkYjNoupyEL9QNxcwFkwV1ikA7GucIVm k2IKcw0/+TC2ZoW7Rwa/Y6TyI2d9OlDji1AIrOHcqAQXW+0VaX0mZw666APFIKc02YtP na79WmRSp5Vf1Q+GhTeM5XVIxjFFv2+OngHSQzPIrwCjOwovIZNPiAR2R8fXDcZ1Me06 OuQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=653ITfSmgTnuQi/37xl57hKUCzKrQV/wPNJXdNji+Dc=; fh=FaKWJi9LrQpIuO9AdY9eepKfivdR4Dip4zndhqfWXgA=; b=DpPZEQmeHLe0bWiUTgXH0uwzI00Ln0KSGOdbUnhMSOm2MLm4WJQoXg1hIAaaEhHQRL QaUQU5HNNIYWKdQjkDwsmIb0Tvm/9qoiuy5qxRFaJJ2xtxaB+x7XHkE3MSal5fNnjzY9 dgm4rjumiMgknFHLW4fOPA3wurjpvAap3ONm4YETXhUPSgMaxEJoYQhT/r54uZEHC9CN XUuxuZS+9RT5I/p6FmMe54xkKh5Hx8jb0remZ8ilK+6WO2M63V/zvmxzcXAbZP3mEG9K eiSIOYHGrQx72GVnywRNrI+7pAkf3WvNZeZc6tflIoZ5Wn+Lhd6haMjpVdfpFYWPlek9 3Rfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RGTk0a8W; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c4-20020ac87d84000000b00431405206f1si4034128qtd.545.2024.03.24.18.06.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 18:06:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RGTk0a8W; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 9FCF01C24BB5 for ; Mon, 25 Mar 2024 01:06:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AF771C880E; Sun, 24 Mar 2024 22:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RGTk0a8W" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 801F813E8BC; Sun, 24 Mar 2024 22:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320375; cv=none; b=aWfTWAxYhZhG7LcE3P0aF1XPt1c69LFtnqXRmSTXmzRPxL1e/ATAZ8GDQ4r5WUFki3XwbXxzDdajiC3e61Ze/087giu91zFo5WWdj2VNyBGEN+faxzPzsFRBon+HU/81P5kFDweZBKnQPww7JBJHdK2/IN0Eml7/zBEU7yAvDPo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320375; c=relaxed/simple; bh=CHvIGZoy1lKp51lgMJA/2rQsWMnoPJipLMus7XjzkAs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uqQ8eQJ5vTZ+SovDMMQ9KRTWmmI7WCK8WpVgOJ+zvZrB0FmQYg6Z2ot0KcU0fc+6zlufFY8+jVEs9209oDZeCpFCE87imlLcyB7g9eZOolA7ojBd3gnQT6s96ky1A414xPSRGQ14HBrTDOL89urU8emm3+H0LIShABNXucFXo0Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RGTk0a8W; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53047C43390; Sun, 24 Mar 2024 22:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320375; bh=CHvIGZoy1lKp51lgMJA/2rQsWMnoPJipLMus7XjzkAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RGTk0a8W+PLN5Gzhwa6EFAeeS18HX28gD9IkKwTwaE/QEmrVXloh6vjhhLVYHkM8M H2eTLaBdhiD7pJPSeXzeJQx1GAYWBfYd/lzYNphKiFHNvSG14fiMP04xIn6fqyKXd/ 47uVo4nGL39MfhyjCEnPIpea2ceAPT8T9CzFa8jtNeidioG1bfQAsm170I/wBSTfB7 zHd9jAdhv/hy9OO+0C3mJ7hIaBjSwZkfJ3MnfROKCu26SEaQYRnoj+P6GmY8/2LFfG 9eMAC9a99VlpJ+TMj3pMfTDp7OiSUSope1uPvKj23ZaxS19v2CktMqHF6HlOlD3YN+ YZcRFByUpS2xQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Eric Dumazet , Coco Li , Jiri Pirko , Paolo Abeni , Sasha Levin Subject: [PATCH 6.8 681/715] net: move dev->state into net_device_read_txrx group Date: Sun, 24 Mar 2024 18:34:20 -0400 Message-ID: <20240324223455.1342824-682-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Eric Dumazet [ Upstream commit f6e0a4984c2e7244689ea87b62b433bed9d07e94 ] dev->state can be read in rx and tx fast paths. netif_running() which needs dev->state is called from - enqueue_to_backlog() [RX path] - __dev_direct_xmit() [TX path] Fixes: 43a71cd66b9c ("net-device: reorganize net_device fast path variables") Signed-off-by: Eric Dumazet Cc: Coco Li Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20240314200845.3050179-1-edumazet@google.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- Documentation/networking/net_cachelines/net_device.rst | 2 +- include/linux/netdevice.h | 2 +- net/core/dev.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/networking/net_cachelines/net_device.rst b/Documentation/networking/net_cachelines/net_device.rst index dceb49d56a911..70c4fb9d4e5ce 100644 --- a/Documentation/networking/net_cachelines/net_device.rst +++ b/Documentation/networking/net_cachelines/net_device.rst @@ -13,7 +13,7 @@ struct_dev_ifalias* ifalias unsigned_long mem_end unsigned_long mem_start unsigned_long base_addr -unsigned_long state +unsigned_long state read_mostly read_mostly netif_running(dev) struct_list_head dev_list struct_list_head napi_list struct_list_head unreg_list diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 78a09af89e39b..dba428b3a87a5 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2144,6 +2144,7 @@ struct net_device { struct pcpu_sw_netstats __percpu *tstats; struct pcpu_dstats __percpu *dstats; }; + unsigned long state; unsigned int flags; unsigned short hard_header_len; netdev_features_t features; @@ -2189,7 +2190,6 @@ struct net_device { * part of the usual set specified in Space.c. */ - unsigned long state; struct list_head dev_list; struct list_head napi_list; diff --git a/net/core/dev.c b/net/core/dev.c index f56f81e587236..439419d912eb0 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -11631,11 +11631,12 @@ static void __init net_dev_struct_check(void) /* TXRX read-mostly hotpath */ CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, lstats); + CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, state); CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, flags); CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, hard_header_len); CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, features); CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, ip6_ptr); - CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_txrx, 38); + CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_txrx, 46); /* RX read-mostly hotpath */ CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_rx, ptype_specific); -- 2.43.0