[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5115e5398ce742718a24ec31a0beaff5@realtek.com>
Date: Mon, 17 Jun 2024 06:44:55 +0000
From: Justin Lai <justinlai0215@...ltek.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com"
<edumazet@...gle.com>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"andrew@...n.ch"
<andrew@...n.ch>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"horms@...nel.org"
<horms@...nel.org>,
"rkannoth@...vell.com" <rkannoth@...vell.com>,
"Ping-Ke
Shih" <pkshih@...ltek.com>,
Larry Chiu <larry.chiu@...ltek.com>
Subject: RE: [PATCH net-next v20 07/13] rtase: Implement a function to receive packets
> On Fri, 7 Jun 2024 16:43:15 +0800 Justin Lai wrote:
> > +static int rx_handler(struct rtase_ring *ring, int budget) {
> > + const struct rtase_private *tp = ring->ivec->tp;
> > + union rtase_rx_desc *desc_base = ring->desc;
> > + u32 pkt_size, cur_rx, delta, entry, status;
> > + struct net_device *dev = tp->dev;
> > + union rtase_rx_desc *desc;
> > + struct sk_buff *skb;
> > + int workdone = 0;
> > +
> > + cur_rx = ring->cur_idx;
> > + entry = cur_rx % RTASE_NUM_DESC;
> > + desc = &desc_base[entry];
> > +
> > + do {
> > + /* 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.
>
> > + status = le32_to_cpu(desc->desc_status.opts1);
> > +
> > + if (status & RTASE_DESC_OWN)
> > + break;
Powered by blists - more mailing lists