Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2492590rbb; Wed, 28 Feb 2024 03:44:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU8NI79fm/Y4ZZkwOsmFD0b9yo8/ZGEyA4IWM2xlvxpsHMr5nv5nfg0B7YUS3j+yy7OGd76gxc/2YHIG08LOyyblx+Tk/3pxekW0AfPlg== X-Google-Smtp-Source: AGHT+IH3I/MigYw5ardG5nuUskYX0+7fwF4d0k4tsTbQvemmTRg3JOyfeQDXDWmeeUjwQEbntrgL X-Received: by 2002:a05:6512:2253:b0:513:437:b348 with SMTP id i19-20020a056512225300b005130437b348mr4060313lfu.10.1709120679430; Wed, 28 Feb 2024 03:44:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709120679; cv=pass; d=google.com; s=arc-20160816; b=Q7FGP1qZ+D/5q6jZXaDsWiGG3XfIRFCTk0fK4BXkwEAIsehNqg/NyjLTac9TJxPrYY e03LtrKNlvUoKSJ0PMPol2oDH5HL088ts3IdOfkQJbQkUHySq9eCM20Ujij8U7SymGcL yr5Dspg7Pc46tdk0uyW+Y++YVDOIswcuiWLeExoqqKNbXGBrQNb20KWfOIsHnY3jHuiX jS2UL0WssSDrwTzQZwllO/x6HgKEKZMjMs8e4a5+I1KVihNtCr2c6B6WiM9xf4nDJrg9 0vbu/HXu0zaZL3zJlcGcrX+LzrTSsI6wZg4xzpheg1/dsqJx/RogcwpuKnE6sAk2yqpI V2aA== 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:message-id:date:subject:cc:to :from; bh=eeRdk5nsJWzv2xbJPbFyJWHca2KgoSDk84tifNfmBI8=; fh=7trYkQbPABfmRSXOWl1zPRC8DPKdQJDB9Tvhd9YdQC4=; b=IjJcA4KgBlLu1gTB96BqQob7b5t/2/THcTyYh9WxnPbhU8P7xSJ4VYxMC/1o4s6jwQ uxQSsmc6gTw15fA0T+JvatI31iG6IllD7vOJnV+eQ6LQEWTplwbZnrHzPT/mT48u00K1 P6bGC8EcCLWTknrLcEFYNLEDoXP5jZXDyf2fxzazdq28cJE6ecjnQLlc4e+E1rS3iP7I UBYWdH81n36+fY3OZXUoZCUhBjomhQI8yjDDISsiz+FmIms1b0raYzPOE2SaLZdk4uxH B6T24HIsfSUw/tS2mFhQSsmcarASdrOq9P+Vn4CojBRjV2qWFTiBVSMTgUqsC4P2FmT4 yyqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-84922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84922-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dm10-20020a170907948a00b00a440fb611b7si298809ejc.727.2024.02.28.03.44.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 03:44:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-84922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84922-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 260FF1F25996 for ; Wed, 28 Feb 2024 11:42:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 621A214F96D; Wed, 28 Feb 2024 11:32:05 +0000 (UTC) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E88314DFD3; Wed, 28 Feb 2024 11:32:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709119924; cv=none; b=Xdnt02LNfOQ3J2eWC+Rvg4i8tblCaElqUME3KvG8OAYuUQseOOdn8nz89LBND728PKimUYaf7FYZZCxFgSJ0kT+KDRkJAZ5TcYqlE411OoXYziJpqCz7Wn3corJdnAXtpg31e19tzhonsJ6t4aVcFj6bQ+5kNbrE0kVhRj0xJZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709119924; c=relaxed/simple; bh=M42cRr9evUR9Mr0JSq1IeJJSWj3kvBrf77cxCU4NVhE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OJKrspOEGAk+lIsmBM51kPygIN5BWnX1hJSNjPr2ShF0W2ZQsUPBjUy8IJTPRp0nAqJ53dlEFb+YcLGBiAGEmLxRRYeT35KGyVLHRqsXOkytytqNBeD1xCXArl5XcQ22kcjBH1Mj+CYPaKlD4Rs3vW0OY51bIObtkqP1PXFFPjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a43f922b2c5so69130666b.3; Wed, 28 Feb 2024 03:32:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709119921; x=1709724721; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eeRdk5nsJWzv2xbJPbFyJWHca2KgoSDk84tifNfmBI8=; b=ckMFm2E1+8R0znaL8z3/V7tLd2oB0das6N0eDzfPX2deMnYNwNwjYTYHl8D6razvF7 BgdRxfQM3C7kyZmuRVHpYz2oR6wNLfG73oK2eSVbl04sgbSwPmZNiwqQDk2ehpnNZcqX PapVdPqG8t+qzfBmFMv+ynOK+xOUtGNTz8SK50WuqhLjleZvxwPDb6t6wgrrMJ8iIIjO wlv6wP0i0t7p2D1pNsofKdKDwhli7esUh/l5MG/XUmAyq+9+6C/rf0TSHUdePnnGBcmN zr9uciI06jqBIB+aLTA4iv87S+pJkunZ9SGy5aFdSnxWJn86RLYokqNkpgVusa0IahtK fNYA== X-Forwarded-Encrypted: i=1; AJvYcCXJuhJ+NzUsSti3Dx94VWNJbknkdPcRhXhPbwR881FnkK0UoKK7icQo2XpBSGMQi1faiGEmSWW4vANoYUnaFkUmMA1ZrL/ORocXjbpe X-Gm-Message-State: AOJu0Yw65fvr+43mSn1F5TccMYP3q1+FVmU0gNANjJLf4BovGoalWsyA rSrOvN+SHHI8wOO3DQxjCs3iW+Kp8PUypdCOZeudB+Iy+qrbIKFU X-Received: by 2002:a17:906:4ecd:b0:a43:b472:9a57 with SMTP id i13-20020a1709064ecd00b00a43b4729a57mr3038624ejv.62.1709119921217; Wed, 28 Feb 2024 03:32:01 -0800 (PST) Received: from localhost (fwdproxy-lla-003.fbsv.net. [2a03:2880:30ff:3::face:b00c]) by smtp.gmail.com with ESMTPSA id ef3-20020a17090697c300b00a4396ea6628sm1736864ejb.210.2024.02.28.03.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 03:32:00 -0800 (PST) From: Breno Leitao To: kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com, edumazet@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, horms@kernel.org, dsahern@kernel.org Subject: [PATCH net-next 0/2] net: collect tstats automatically Date: Wed, 28 Feb 2024 03:31:20 -0800 Message-ID: <20240228113125.3473685-1-leitao@debian.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The commit 34d21de99cea9 ("net: Move {l,t,d}stats allocation to core and convert veth & vrf") added a field in struct_netdevice, which tells what type of statistics the driver supports. That field is used primarily to allocate stats structures automatically, but, it also could leveraged to simplify the drivers even further, such as, if the driver relies in the default stats collection, then it doesn't need to assign to .ndo_get_stats64. That means that drivers only assign functions to .ndo_get_stats64 if they are using something special. I started to move some of these drivers[1][2][3] to use the core allocation, and with this change in, I just need to touch the driver once, and be able to simplify the whole stats allocation and collection for generic case. There are 44 devices today that could benefit from this simplification. # grep -r .ndo_get_stats64 | grep dev_get_tstats64 | wc -l 44 As of today, netnext only has the `sit` driver fully ported to core stats allocation, hence the second patch. Links: [1] https://lore.kernel.org/all/20240227182338.2739884-1-leitao@debian.org/ [2] https://lore.kernel.org/all/20240222144117.1370101-1-leitao@debian.org/ [3] https://lore.kernel.org/all/20240223115839.3572852-1-leitao@debian.org/ Breno Leitao (2): net: get stats64 if device if driver is configured net: sit: Do not set .ndo_get_stats64 net/core/dev.c | 2 ++ net/ipv6/sit.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.43.0