Re: [PATCH net-next 5/9] sunvnet: add memory barrier before check for tx enable

From: Shannon Nelson
Date: Sat Feb 04 2017 - 17:39:56 EST


On 2/3/2017 2:11 PM, Eric Dumazet wrote:

Transmit completion might happen on another cpu, regardless of ldom.

Therefore you need smp_rmb() here ( like mellanox/mlx4/en_tx.c) , or
even smp_mb() as bnx2x does.

dma_rmb() is never used in this context.


In that case, it looks like there are a couple other similar issues in this code that need attention, that cropped up when the new dma_*mb() interface was added. I'll see what I can do with those as well.

The comments and code a few lines above, some of DaveM's original driver code, seem to dissuade us from the SMP version and originally used the bare wmb(). Perhaps the bare rmb() should be used here? Again, I suppose it doesn't matter much as it looks like they all boil down to the same bit of asm, at least on sparc, which is all that matters for this driver.

Thanks,
sln