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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3fd3b7fc-b698-4cf3-9d43-4751bfb40646@yunsilicon.com>
Date: Thu, 5 Jun 2025 15:25:21 +0800
From: "Xin Tian" <tianx@...silicon.com>
To: "Jakub Kicinski" <kuba@...nel.org>
Cc: <netdev@...r.kernel.org>, <leon@...nel.org>, <andrew+netdev@...n.ch>, 
	<pabeni@...hat.com>, <edumazet@...gle.com>, <davem@...emloft.net>, 
	<jeff.johnson@....qualcomm.com>, <przemyslaw.kitszel@...el.com>, 
	<weihg@...silicon.com>, <wanry@...silicon.com>, <jacky@...silicon.com>, 
	<horms@...nel.org>, <parthiban.veerasooran@...rochip.com>, 
	<masahiroy@...nel.org>, <kalesh-anakkur.purayil@...adcom.com>, 
	<geert+renesas@...der.be>, <geert@...ux-m68k.org>
Subject: Re: [PATCH net-next v11 14/14] xsc: add ndo_get_stats64

在 2025/4/25 9:48, Jakub Kicinski 写道:
> On Wed, 23 Apr 2025 18:40:01 +0800 Xin Tian wrote:
>> @@ -242,11 +243,13 @@ static uint32_t xsc_eth_xmit_frame(struct sk_buff *skb,
>>   		mss       = skb_shinfo(skb)->gso_size;
>>   		ihs       = xsc_tx_get_gso_ihs(sq, skb);
>>   		num_bytes = skb->len;
>> +		stats->packets += skb_shinfo(skb)->gso_segs;
>>   	} else {
>>   		opcode    = XSC_OPCODE_RAW;
>>   		mss       = 0;
>>   		ihs       = 0;
>>   		num_bytes = skb->len;
>> +		stats->packets++;
>>   	}
>>   
>>   	/*linear data in skb*/
>> @@ -284,10 +287,12 @@ static uint32_t xsc_eth_xmit_frame(struct sk_buff *skb,
>>   
>>   	xsc_txwqe_complete(sq, skb, opcode, ds_cnt, num_wqebbs, num_bytes,
>>   			   num_dma, wi);
>> +	stats->bytes     += num_bytes;
> For TSO packets this doesn't look right. You should count the length
> after TSO, IOW the number of bytes that will reach the wire.
>
> Also you should use helpers from include/linux/u64_stats_sync.h
> to make sure there are no races when accessing the statistics

Hi, Jakub

Apologies for the delayed reply.

Regarding TSO packets:
Thanks for pointing that out. I will include the missing segment header 
length.

Regarding u64_stats_sync.h helpers:
Since our driver ​​exclusively runs on 64-bit platforms​​ (ARM64 or x86_64)
where u64 accesses are atomic, is it still necessary to use these helpers?

Thanks,
Xin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ