Re: [PATCH] tg3: Fix tx race condition

2006-08-07 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]> Date: Mon, 07 Aug 2006 20:05:36 -0700 > Actually, I can probably hide it in the TX_BUFFS_AVAIL() macro. Sounds like a good idea. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordom

Re: [PATCH] tg3: Fix tx race condition

2006-08-07 Thread Michael Chan
On Tue, 2006-08-08 at 12:51 +1000, Herbert Xu wrote: > > 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

Re: [PATCH] tg3: Fix tx race condition

2006-08-07 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]> Date: Mon, 07 Aug 2006 19:46:26 -0700 > 4. Make tx_cons and tx_prod volatile to guarantee that > tg3_start_xmit() and tg3_tx() will see the latest ring indices. Marking variables volatile is always an error. If the locks and memory barriers are in the rig

Re: [PATCH] tg3: Fix tx race condition

2006-08-07 Thread Herbert Xu
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

[PATCH] tg3: Fix tx race condition

2006-08-07 Thread Michael Chan
Fix a subtle race condition between tg3_start_xmit() and tg3_tx() discovered by Herbert Xu <[EMAIL PROTECTED]>: CPU0CPU1 tg3_start_xmit() if (tx_ring_full) { tx_lock tg3_tx()