Re: [PATCH V7 net-next 01/11] net: hibmcge: Add pci table supported in this module

From: Jakub Kicinski
Date: Fri Sep 06 2024 - 21:45:32 EST


On Thu, 5 Sep 2024 22:31:10 +0800 Jijie Shao wrote:
> + netdev->tstats = devm_netdev_alloc_pcpu_stats(&pdev->dev,
> + struct pcpu_sw_netstats);
> + if (!netdev->tstats)
> + return -ENOMEM;

Please set

dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;

will allocate and free the stats for you.
This will also let other parts of the stack use the stats
since the type will be known (netdev->tstats is part of
a union).
--
pw-bot: cr