[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <trinity-eed4d6ab-f658-4f47-94ff-5162845ba335-1463502971177@3capp-gmx-bs64>
Date: Tue, 17 May 2016 18:36:11 +0200
From: "Lino Sanfilippo" <LinoSanfilippo@....de>
To: "Shuyu Wei" <wsy2220@...il.com>
Cc: wxt@...k-chips.com, davem@...emloft.net, romieu@...zoreil.com,
heiko@...ech.de, linux-rockchip@...ts.infradead.org,
netdev@...r.kernel.org
Subject: Aw: [PATCH v2] ethernet:arc: Fix racing of TX ring buffer
Hi,
> Von: "Shuyu Wei" <wsy2220@...il.com>
> @@ -685,13 +684,15 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)
> wmb();
>
> skb_tx_timestamp(skb);
> + priv->tx_buff[*txbd_curr].skb = skb;
> +
> + dma_wmb();
>
> *info = cpu_to_le32(FOR_EMAC | FIRST_OR_LAST_MASK | len);
>
> /* Make sure info word is set */
> wmb();
>
> - priv->tx_buff[*txbd_curr].skb = skb;
>
> /* Increment index to point to the next BD */
> *txbd_curr = (*txbd_curr + 1) % TX_BD_NUM;
>
I wonder if this is correct. AFAIK a dma_wmb() only guarantees ordering of writes to DMA memory.
The assignment of the skb however is to RAM not to DMA.
Regards,
Lino
Powered by blists - more mailing lists