Having said that, you might need a memory barrier before reading tx_bd_prod in
the consumer if the producer waggles a flag in memory to indicate to the
consumer that it should consume, and a memory barrier in the producer before
waggling that flag:
[producer]
...
smp_wmb(); /* commit buffer contents before incrementing index */
fp->tx_bd_prod = TX_BD(bd_prod + 1);
smp_wmb(); /* commit increment index before prodding consumer */
prod_consumer();
[consumer]
check_prod_flag();
smp_rmb(); /* read producer index after checking prod flag */
bd_prod = fp->tx_bd_prod;
bd_cons = fp->tx_bd_cons;
smp_read_barrier_depends(); /* read index before reading contents */
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html