On Mon, Aug 07, 2006 at 07:46:26PM -0700, Michael Chan wrote: > Fix a subtle race condition between tg3_start_xmit() and tg3_tx() > discovered by Herbert Xu <[EMAIL PROTECTED]>:
Thanks for the patch Michael. > 2. Eliminate the private tx_lock altogether and rely solely on > netif_tx_lock. This eliminates one spinlock in tg3_start_xmit() > when the ring is full. Why not get rid of the lock altogether? By making sure memory barriers are present on the stop/wake paths the locks are not needed anymore. > 4. Make tx_cons and tx_prod volatile to guarantee that > tg3_start_xmit() and tg3_tx() will see the latest ring indices. Such uses of volatile are bad inside the kernel because they don't actually provide hardware memory barriers and their effect on the compiler are given by constructs such as mb() anyway. So we should simply add memory barriers where needed. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html