RE: [EXTERNAL] Re: [PATCH net v1 1/2] octeon_ep: avoid compiler and IQ/OQ reordering
From: Vimlesh Kumar
Date: Fri Jan 30 2026 - 08:13:09 EST
Hi @'Paolo Abeni',
Is our reply adequate or do we need to make any other changes?
Regards.
> -----Original Message-----
> From: Vimlesh Kumar
> Sent: Friday, January 9, 2026 7:56 PM
> To: 'Paolo Abeni' <pabeni@xxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Cc: Sathesh B Edara <sedara@xxxxxxxxxxx>; Shinas Rasheed
> <srasheed@xxxxxxxxxxx>; Haseeb Gani <hgani@xxxxxxxxxxx>;
> Veerasenareddy Burru <vburru@xxxxxxxxxxx>; Andrew Lunn
> <andrew+netdev@xxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>; Eric
> Dumazet <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>;
> Satananda Burla <sburla@xxxxxxxxxxx>; Abhijit Ayarekar
> <aayarekar@xxxxxxxxxxx>
> Subject: RE: [EXTERNAL] Re: [PATCH net v1 1/2] octeon_ep: avoid compiler
> and IQ/OQ reordering
>
>
>
> > -----Original Message-----
> > From: Paolo Abeni <pabeni@xxxxxxxxxx>
> > Sent: Monday, December 29, 2025 9:45 PM
> > To: Vimlesh Kumar <vimleshk@xxxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx;
> > linux- kernel@xxxxxxxxxxxxxxx
> > Cc: Sathesh B Edara <sedara@xxxxxxxxxxx>; Shinas Rasheed
> > <srasheed@xxxxxxxxxxx>; Haseeb Gani <hgani@xxxxxxxxxxx>;
> > Veerasenareddy Burru <vburru@xxxxxxxxxxx>; Andrew Lunn
> > <andrew+netdev@xxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>; Eric
> > Dumazet <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>;
> > Satananda Burla <sburla@xxxxxxxxxxx>; Abhijit Ayarekar
> > <aayarekar@xxxxxxxxxxx>
> > Subject: [EXTERNAL] Re: [PATCH net v1 1/2] octeon_ep: avoid compiler
> > and IQ/OQ reordering On 12/19/25 8:29 AM, Vimlesh Kumar wrote:
> > > Utilize READ_ONCE and WRITE_ONCE APIs for IO queue Tx/Rx variable
> > > access to prevent compiler optimization and reordering.
> > > Additionally, ensure IO queue OUT/IN_CNT registers are flushed by
> > > performing a read-back after writing.
> >
> > Please explain why such _ONCE() annotation are required, and what
> > could be reordered otherwise.
> >
> > I don't think they are needed,
> >
>
> We use READ_ONCE and WRITE_ONCE APIs in the data path to prevent the
> compiler from optimizing or reordering read/write operations.
> The APIs are used to access RX and TX queue counter fields that are shared
> between the Octeon hardware device and its device driver. These APIs ensure
> that the driver always reads the most current values from the hardware for
> various RX and TX counter fields. Additionally, they prevent the compiler from
> optimizing or reordering read/write operations on these counter fields.
>
> > /P