aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-05-10 08:01:31 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-10 08:01:31 -0400
commit1ae5dc342ac78d7a42965fd1f323815f6f5ef2c1 (patch)
treed1955a7639e99832590df26466a34d5786a880ae /drivers/net/tulip
parent2b0b05ddc04b6d45e71cd36405df512075786f1e (diff)
net: trans_start cleanups
Now that core network takes care of trans_start updates, dont do it in drivers themselves, if possible. Drivers can avoid one cache miss (on dev->trans_start) in their start_xmit() handler. Exceptions are NETIF_F_LLTX drivers Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/de2104x.c1
-rw-r--r--drivers/net/tulip/de4x5.c5
-rw-r--r--drivers/net/tulip/dmfe.c4
-rw-r--r--drivers/net/tulip/pnic.c2
-rw-r--r--drivers/net/tulip/tulip_core.c4
-rw-r--r--drivers/net/tulip/uli526x.c4
-rw-r--r--drivers/net/tulip/winbond-840.c4
7 files changed, 9 insertions, 15 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 9c0f29ce8ba7..c0e70006374e 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -654,7 +654,6 @@ static netdev_tx_t de_start_xmit (struct sk_buff *skb,
654 654
655 /* Trigger an immediate transmit demand. */ 655 /* Trigger an immediate transmit demand. */
656 dw32(TxPoll, NormalTxPoll); 656 dw32(TxPoll, NormalTxPoll);
657 dev->trans_start = jiffies;
658 657
659 return NETDEV_TX_OK; 658 return NETDEV_TX_OK;
660} 659}
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index d818456f4713..9522baf8d997 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1337,7 +1337,7 @@ de4x5_open(struct net_device *dev)
1337 } 1337 }
1338 1338
1339 lp->interrupt = UNMASK_INTERRUPTS; 1339 lp->interrupt = UNMASK_INTERRUPTS;
1340 dev->trans_start = jiffies; 1340 dev->trans_start = jiffies; /* prevent tx timeout */
1341 1341
1342 START_DE4X5; 1342 START_DE4X5;
1343 1343
@@ -1507,7 +1507,6 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
1507 outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */ 1507 outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */
1508 1508
1509 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 1509 lp->tx_new = (++lp->tx_new) % lp->txRingSize;
1510 dev->trans_start = jiffies;
1511 1510
1512 if (TX_BUFFS_AVAIL) { 1511 if (TX_BUFFS_AVAIL) {
1513 netif_start_queue(dev); /* Another pkt may be queued */ 1512 netif_start_queue(dev); /* Another pkt may be queued */
@@ -1937,7 +1936,7 @@ set_multicast_list(struct net_device *dev)
1937 1936
1938 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 1937 lp->tx_new = (++lp->tx_new) % lp->txRingSize;
1939 outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ 1938 outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */
1940 dev->trans_start = jiffies; 1939 dev->trans_start = jiffies; /* prevent tx timeout */
1941 } 1940 }
1942 } 1941 }
1943} 1942}
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 7278ecb823cb..bdb25b8b1017 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -1180,11 +1180,11 @@ static void dmfe_timer(unsigned long data)
1180 1180
1181 /* TX polling kick monitor */ 1181 /* TX polling kick monitor */
1182 if ( db->tx_packet_cnt && 1182 if ( db->tx_packet_cnt &&
1183 time_after(jiffies, dev->trans_start + DMFE_TX_KICK) ) { 1183 time_after(jiffies, dev_trans_start(dev) + DMFE_TX_KICK) ) {
1184 outl(0x1, dev->base_addr + DCR1); /* Tx polling again */ 1184 outl(0x1, dev->base_addr + DCR1); /* Tx polling again */
1185 1185
1186 /* TX Timeout */ 1186 /* TX Timeout */
1187 if ( time_after(jiffies, dev->trans_start + DMFE_TX_TIMEOUT) ) { 1187 if (time_after(jiffies, dev_trans_start(dev) + DMFE_TX_TIMEOUT) ) {
1188 db->reset_TXtimeout++; 1188 db->reset_TXtimeout++;
1189 db->wait_reset = 1; 1189 db->wait_reset = 1;
1190 dev_warn(&dev->dev, "Tx timeout - resetting\n"); 1190 dev_warn(&dev->dev, "Tx timeout - resetting\n");
diff --git a/drivers/net/tulip/pnic.c b/drivers/net/tulip/pnic.c
index 966efa1a27d7..a63e64b6863d 100644
--- a/drivers/net/tulip/pnic.c
+++ b/drivers/net/tulip/pnic.c
@@ -67,7 +67,7 @@ void pnic_lnk_change(struct net_device *dev, int csr5)
67 */ 67 */
68 if (tulip_media_cap[dev->if_port] & MediaIsMII) 68 if (tulip_media_cap[dev->if_port] & MediaIsMII)
69 return; 69 return;
70 if (! tp->nwayset || time_after(jiffies, dev->trans_start + 1*HZ)) { 70 if (! tp->nwayset || time_after(jiffies, dev_trans_start(dev) + 1*HZ)) {
71 tp->csr6 = 0x00420000 | (tp->csr6 & 0x0000fdff); 71 tp->csr6 = 0x00420000 | (tp->csr6 & 0x0000fdff);
72 iowrite32(tp->csr6, ioaddr + CSR6); 72 iowrite32(tp->csr6, ioaddr + CSR6);
73 iowrite32(0x30, ioaddr + CSR12); 73 iowrite32(0x30, ioaddr + CSR12);
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 22e766e90063..254643ed945e 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -605,7 +605,7 @@ static void tulip_tx_timeout(struct net_device *dev)
605 605
606out_unlock: 606out_unlock:
607 spin_unlock_irqrestore (&tp->lock, flags); 607 spin_unlock_irqrestore (&tp->lock, flags);
608 dev->trans_start = jiffies; 608 dev->trans_start = jiffies; /* prevent tx timeout */
609 netif_wake_queue (dev); 609 netif_wake_queue (dev);
610} 610}
611 611
@@ -707,8 +707,6 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
707 707
708 spin_unlock_irqrestore(&tp->lock, flags); 708 spin_unlock_irqrestore(&tp->lock, flags);
709 709
710 dev->trans_start = jiffies;
711
712 return NETDEV_TX_OK; 710 return NETDEV_TX_OK;
713} 711}
714 712
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index c7f972852921..96de5829b940 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -1040,11 +1040,11 @@ static void uli526x_timer(unsigned long data)
1040 1040
1041 /* TX polling kick monitor */ 1041 /* TX polling kick monitor */
1042 if ( db->tx_packet_cnt && 1042 if ( db->tx_packet_cnt &&
1043 time_after(jiffies, dev->trans_start + ULI526X_TX_KICK) ) { 1043 time_after(jiffies, dev_trans_start(dev) + ULI526X_TX_KICK) ) {
1044 outl(0x1, dev->base_addr + DCR1); // Tx polling again 1044 outl(0x1, dev->base_addr + DCR1); // Tx polling again
1045 1045
1046 // TX Timeout 1046 // TX Timeout
1047 if ( time_after(jiffies, dev->trans_start + ULI526X_TX_TIMEOUT) ) { 1047 if ( time_after(jiffies, dev_trans_start(dev) + ULI526X_TX_TIMEOUT) ) {
1048 db->reset_TXtimeout++; 1048 db->reset_TXtimeout++;
1049 db->wait_reset = 1; 1049 db->wait_reset = 1;
1050 printk( "%s: Tx timeout - resetting\n", 1050 printk( "%s: Tx timeout - resetting\n",
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 18c8cedf4cac..60a87542f8f0 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -969,7 +969,7 @@ static void tx_timeout(struct net_device *dev)
969 enable_irq(dev->irq); 969 enable_irq(dev->irq);
970 970
971 netif_wake_queue(dev); 971 netif_wake_queue(dev);
972 dev->trans_start = jiffies; 972 dev->trans_start = jiffies; /* prevent tx timeout */
973 np->stats.tx_errors++; 973 np->stats.tx_errors++;
974 return; 974 return;
975} 975}
@@ -1055,8 +1055,6 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
1055 } 1055 }
1056 spin_unlock_irq(&np->lock); 1056 spin_unlock_irq(&np->lock);
1057 1057
1058 dev->trans_start = jiffies;
1059
1060 if (debug > 4) { 1058 if (debug > 4) {
1061 printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d\n", 1059 printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d\n",
1062 dev->name, np->cur_tx, entry); 1060 dev->name, np->cur_tx, entry);