Re: [PATCH] net/af_packet: fix statistics

2024-05-02 Thread Mattias Rönnblom
On 2024-05-02 18:16, Stephen Hemminger wrote: On Thu, 2 May 2024 15:12:43 +0100 Ferruh Yigit wrote: I am not referring multiple core sharing a queue, this is wrong for DPDK. For single core case, if a variable doesn't have 'volatile' qualifier and load/stores are not atomic, as compiler is no

Re: [PATCH] net/af_packet: fix statistics

2024-05-02 Thread Stephen Hemminger
On Thu, 2 May 2024 15:12:43 +0100 Ferruh Yigit wrote: > I am not referring multiple core sharing a queue, this is wrong for DPDK. > > For single core case, if a variable doesn't have 'volatile' qualifier > and load/stores are not atomic, as compiler is not aware that there may > be other threads

Re: [PATCH] net/af_packet: fix statistics

2024-05-02 Thread Ferruh Yigit
On 5/1/2024 5:43 PM, Stephen Hemminger wrote: > On Wed, 1 May 2024 17:25:59 +0100 > Ferruh Yigit wrote: > >>> - Do not mark statistics as volatile. >>>Instead, READ_ONCE() where necessary. >>> >> >> I did similar [1], and Mattias has some comments on it. >> Issue is not in the reader (sta

Re: [PATCH] net/af_packet: fix statistics

2024-05-02 Thread Ferruh Yigit
On 5/1/2024 5:42 PM, Stephen Hemminger wrote: > On Wed, 1 May 2024 17:25:59 +0100 > Ferruh Yigit wrote: > >> On 4/30/2024 4:39 PM, Stephen Hemminger wrote: >>> The statistics in af_packet driver do not follow the standard >>> practice of other drivers: >>> >>> - Statistics should be maintained a

Re: [PATCH] net/af_packet: fix statistics

2024-05-02 Thread Ferruh Yigit
On 5/1/2024 7:18 PM, Morten Brørup wrote: >> From: Stephen Hemminger [mailto:step...@networkplumber.org] >> Sent: Wednesday, 1 May 2024 18.45 >> >> On Wed, 1 May 2024 17:25:59 +0100 >> Ferruh Yigit wrote: >> - Remove the tx_error counter since it was not correct. When transmit ring i

RE: [PATCH] net/af_packet: fix statistics

2024-05-01 Thread Morten Brørup
> From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Wednesday, 1 May 2024 18.45 > > On Wed, 1 May 2024 17:25:59 +0100 > Ferruh Yigit wrote: > > > > - Remove the tx_error counter since it was not correct. > > >When transmit ring is full it is not an error and > > >the d

Re: [PATCH] net/af_packet: fix statistics

2024-05-01 Thread Stephen Hemminger
On Wed, 1 May 2024 17:25:59 +0100 Ferruh Yigit wrote: > > - Remove the tx_error counter since it was not correct. > >When transmit ring is full it is not an error and > >the driver correctly returns only the number sent. > > > > nack > Transmit full is not only return case here. > Th

Re: [PATCH] net/af_packet: fix statistics

2024-05-01 Thread Stephen Hemminger
On Wed, 1 May 2024 17:25:59 +0100 Ferruh Yigit wrote: > > - Do not mark statistics as volatile. > >Instead, READ_ONCE() where necessary. > > > > I did similar [1], and Mattias has some comments on it. > Issue is not in the reader (stats_get) side. Without volatile writer > (datapath thre

Re: [PATCH] net/af_packet: fix statistics

2024-05-01 Thread Stephen Hemminger
On Wed, 1 May 2024 17:25:59 +0100 Ferruh Yigit wrote: > On 4/30/2024 4:39 PM, Stephen Hemminger wrote: > > The statistics in af_packet driver do not follow the standard > > practice of other drivers: > > > > - Statistics should be maintained as 64 bit even on 32 bit. > > > > ack > > > - R

Re: [PATCH] net/af_packet: fix statistics

2024-05-01 Thread Ferruh Yigit
On 4/30/2024 4:39 PM, Stephen Hemminger wrote: > The statistics in af_packet driver do not follow the standard > practice of other drivers: > > - Statistics should be maintained as 64 bit even on 32 bit. > ack > - Remove the tx_error counter since it was not correct. >When transmit ring i

[PATCH] net/af_packet: fix statistics

2024-04-30 Thread Stephen Hemminger
The statistics in af_packet driver do not follow the standard practice of other drivers: - Statistics should be maintained as 64 bit even on 32 bit. - Remove the tx_error counter since it was not correct. When transmit ring is full it is not an error and the driver correctly returns only