Message ID | 1322657043.2403.18.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Wed, 30 Nov 2011 13:44:03 +0100 > [PATCH net-next] sfc: fix race in efx_enqueue_skb_tso() > > As soon as skb is pushed to hardware, it can be completed and freed, so > we should not dereference skb anymore. > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Applied, thanks Eric. -- 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
On Wed, 2011-11-30 at 17:12 -0500, David Miller wrote: > From: Eric Dumazet <eric.dumazet@gmail.com> > Date: Wed, 30 Nov 2011 13:44:03 +0100 > > > [PATCH net-next] sfc: fix race in efx_enqueue_skb_tso() > > > > As soon as skb is pushed to hardware, it can be completed and freed, so > > we should not dereference skb anymore. > > > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> > > Applied, thanks Eric. Thanks to all. Ben.
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index ab4c635..e0e00b3 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c @@ -1173,11 +1173,11 @@ static int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue, goto mem_err; } + netdev_tx_sent_queue(tx_queue->core_txq, skb->len); + /* Pass off to hardware */ efx_nic_push_buffers(tx_queue); - netdev_tx_sent_queue(tx_queue->core_txq, skb->len); - tx_queue->tso_bursts++; return NETDEV_TX_OK;