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

From: Jakub Kicinski
Date: Wed Jun 12 2024 - 20:43:19 EST


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?

> + status = le32_to_cpu(desc->desc_status.opts1);
> +
> + if (status & RTASE_DESC_OWN)
> + break;