Skip to contentSkip to conversation

gianfar: update txq->trans_start rather than dev->trans_start

RFC PATCH In review Sandeep Gopalpet 3 participants 3 messages Dec 16, 2009 – Dec 26, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 gianfar: update txq->trans_start rather than dev->trans_start

---

*. Please let me know if updating txq->trans_start in gfar_start is
alright, although updating txq->trans_start in gfar_start_xmit( ) should be done.

 drivers/net/gianfar.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
drivers/net/gianfar.c +7 -2
index e0620d0..f8bcc72 100644
@@ -1665,6 +1665,7 @@ void gfar_start(struct net_device *dev)
 {
 	struct gfar_private *priv = netdev_priv(dev);
 	struct gfar __iomem *regs = priv->gfargrp[0].regs;
+	struct netdev_queue *txq;
 	u32 tempval;
 	int i = 0;
 
@@ -1692,7 +1693,11 @@ void gfar_start(struct net_device *dev)
 		gfar_write(&regs->imask, IMASK_DEFAULT);
 	}
 
-	dev->trans_start = jiffies;
+	/* Update the trans_start for each queue */
+	for (i = 0; i < priv->num_tx_queues; i++) {
+		txq = netdev_get_tx_queue(dev, i);
+		txq->trans_start = jiffies;
+	}
 }
 
 void gfar_configure_coalescing(struct gfar_private *priv,
@@ -2069,7 +2074,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	/* reduce TxBD free count */
 	tx_queue->num_txbdfree -= (nr_frags + 1);
 
-	dev->trans_start = jiffies;
+	txq->trans_start = jiffies;
 
 	/* If the next BD still needs to be cleaned up, then the bds
 	   are full.  We need to tell the kernel to stop sending us stuff. */
Signature · 1 line
1.6.5.6
maintainer
#1 lore raw

From: Sandeep Gopalpet <[email protected]>
Date: Wed, 16 Dec 2009 19:34:41 +0530

Quoted 6 lines

---

*. Please let me know if updating txq->trans_start in gfar_start is
alright, although updating txq->trans_start in gfar_start_xmit( ) should be done.

See commit 08baf561083bc27a953aa087dd8a664bb2b88e8e, you don't have to update *->trans_start at all, the generic code will do it for you.

For example, this is why you won't be able to find any trans_start references in drivers such as ixgbe

#2 lore raw
Quoted 16 lines

-----Original Message-----
From: David Miller [mailto:[email protected]]
Sent: Saturday, December 26, 2009 8:15 AM
To: Kumar Gopalpet-B05799
Cc: [email protected]; [email protected]
Subject: Re: [RFC PATCH] gianfar: update txq->trans_start rather than dev->trans_start

From: Sandeep Gopalpet <[email protected]>
Date: Wed, 16 Dec 2009 19:34:41 +0530

Quoted 3 lines

---

Quoted 8 lines
Quoted 3 lines

*. Please let me know if updating txq->trans_start in gfar_start is
alright, although updating txq->trans_start in gfar_start_xmit( ) should be done.

See commit 08baf561083bc27a953aa087dd8a664bb2b88e8e, you don't have to update *->trans_start at all, the generic code will do it for you.

OK. Thanks David.

Quoted 3 lines

For example, this is why you won't be able to find any trans_start references in drivers such as ixgbe