2024-02-28 11:44:39

by Breno Leitao

[permalink] [raw]
Subject: [PATCH net-next 0/2] net: collect tstats automatically

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/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/[email protected]/

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



2024-02-29 12:00:39

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next 0/2] net: collect tstats automatically

Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <[email protected]>:

On Wed, 28 Feb 2024 03:31:20 -0800 you wrote:
> 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.
>
> [...]

Here is the summary with links:
- [net-next,1/2] net: get stats64 if device if driver is configured
https://git.kernel.org/netdev/net-next/c/3e2f544dd8a3
- [net-next,2/2] net: sit: Do not set .ndo_get_stats64
https://git.kernel.org/netdev/net-next/c/fa0cd9021369

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html