netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6 net-next-2.6] vxge: Use fifo based trans_start time
@ 2010-07-08 19:21 Jon Mason
  2010-07-09  6:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Mason @ 2010-07-08 19:21 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Sreenivasa Honnur, Ramkrishna Vepa

Use the fifo based netdev_queue->trans_start time in vxge_xmit, instead
of the device based netdev->trans_start time.

Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@exar.com>
---
 drivers/net/vxge/vxge-main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index e78703d..b8eed71 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -802,6 +802,7 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
 	unsigned long flags = 0;
 	int vpath_no = 0;
 	int do_spin_tx_lock = 1;
+	struct netdev_queue *txq;
 
 	vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d",
 			dev->name, __func__, __LINE__);
@@ -968,8 +969,10 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
 					VXGE_HW_FIFO_TXD_TX_CKO_UDP_EN);
 
 	vxge_hw_fifo_txdl_post(fifo_hw, dtr);
+
 #ifdef NETIF_F_LLTX
-	dev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
+	txq = netdev_get_tx_queue(dev, vpath_no);
+	txq->trans_start = jiffies;
 #endif
 	spin_unlock_irqrestore(&fifo->tx_lock, flags);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/6 net-next-2.6] vxge: Use fifo based trans_start time
  2010-07-08 19:21 [PATCH 2/6 net-next-2.6] vxge: Use fifo based trans_start time Jon Mason
@ 2010-07-09  6:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-07-09  6:34 UTC (permalink / raw)
  To: jon.mason; +Cc: netdev, sreenivasa.honnur, ram.vepa

From: Jon Mason <jon.mason@exar.com>
Date: Thu, 8 Jul 2010 14:21:26 -0500

> @@ -968,8 +969,10 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
>  					VXGE_HW_FIFO_TXD_TX_CKO_UDP_EN);
>  
>  	vxge_hw_fifo_txdl_post(fifo_hw, dtr);
> +
>  #ifdef NETIF_F_LLTX
> -	dev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
> +	txq = netdev_get_tx_queue(dev, vpath_no);
> +	txq->trans_start = jiffies;
>  #endif

This comment was placed there not just for it's artistic value,
you should heed what it's saying when making changes like this.

NETIF_F_LLTX drivers cannot use the per-txq trans_start mechanism,
because doing so is racy.

The dev_watchdog() timer, which checks these ->trans_start values,
can only synchornize with the driver by the traditional means,
which is by taking the spinlock on the TX queue.  This is bypassed
by NETIF_F_LLTX drivers, so the driver can be in it's TX handler
while the watchdog timer is trying to evaluate the trans_start
state.

This is one of a many reasons why NETIF_F_LLTX is a bad idea and you
should convert your driver away from it.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-09  6:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-08 19:21 [PATCH 2/6 net-next-2.6] vxge: Use fifo based trans_start time Jon Mason
2010-07-09  6:34 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).