RE: [PATCH net-next v20 07/13] rtase: Implement a function to receive packets

From: Justin Lai
Date: Mon Jun 17 2024 - 23:41:26 EST


> On Mon, 17 Jun 2024 06:44:55 +0000 Justin Lai wrote:
> > > > + /* make sure discriptor has been updated */
> > > > + rmb();
> > >
> > > Barriers are between things. What is this barrier between?
> >
> > At the end of this do while loop, it fetches the next descriptor. This
> > barrier is mainly used between fetching the next descriptor and using
> > the next descriptor, to ensure that the content of the next descriptor
> > is completely fetched before using it.
>
> What does it mean to "fetch the next descriptor"? The prefetch?
> Prefetches are not ordered at all.

Let me explain again, at the end of the do while loop in rx_handler, we
have changed the address pointed by desc to the next descriptor.
Therefore, the main purpose of this barrier is to ensure that both desc
and cur_rx have been updated to the next entry.