lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240915171044.72aed6cd@kernel.org>
Date: Sun, 15 Sep 2024 17:10:44 +0200
From: Jakub Kicinski <kuba@...nel.org>
To: Jijie Shao <shaojijie@...wei.com>
Cc: <davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
 <shenjian15@...wei.com>, <wangpeiyang1@...wei.com>,
 <liuyonglong@...wei.com>, <chenhao418@...wei.com>,
 <sudongming1@...wei.com>, <xujunsheng@...wei.com>,
 <shiyongbang@...wei.com>, <libaihan@...wei.com>, <andrew@...n.ch>,
 <jdamato@...tly.com>, <horms@...nel.org>,
 <kalesh-anakkur.purayil@...adcom.com>, <jonathan.cameron@...wei.com>,
 <shameerali.kolothum.thodi@...wei.com>, <salil.mehta@...wei.com>,
 <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V10 net-next 01/10] net: hibmcge: Add pci table
 supported in this module

On Thu, 12 Sep 2024 10:51:18 +0800 Jijie Shao wrote:
> +	netdev->tstats = devm_netdev_alloc_pcpu_stats(&pdev->dev,
> +						      struct pcpu_sw_netstats);
> +	if (!netdev->tstats)
> +		return -ENOMEM;
> +	netdev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;

take a look at how pcpu_stat_type is used in net/core/dev.c
core will automatically allocate the stats for you and handle them in
the ndo for reading stats
your current code repeats what core already does so it will leak the
memory and I think double count

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ