diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-05-10 05:01:31 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-10 05:01:31 -0700 |
commit | 1ae5dc342ac78d7a42965fd1f323815f6f5ef2c1 (patch) | |
tree | d1955a7639e99832590df26466a34d5786a880ae /drivers/net/tulip | |
parent | 2b0b05ddc04b6d45e71cd36405df512075786f1e (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.c | 1 | ||||
-rw-r--r-- | drivers/net/tulip/de4x5.c | 5 | ||||
-rw-r--r-- | drivers/net/tulip/dmfe.c | 4 | ||||
-rw-r--r-- | drivers/net/tulip/pnic.c | 2 | ||||
-rw-r--r-- | drivers/net/tulip/tulip_core.c | 4 | ||||
-rw-r--r-- | drivers/net/tulip/uli526x.c | 4 | ||||
-rw-r--r-- | drivers/net/tulip/winbond-840.c | 4 |
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, /* Trigger an immediate transmit demand. */ dw32(TxPoll, NormalTxPoll); - dev->trans_start = jiffies; return NETDEV_TX_OK; } 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) } lp->interrupt = UNMASK_INTERRUPTS; - dev->trans_start = jiffies; + dev->trans_start = jiffies; /* prevent tx timeout */ START_DE4X5; @@ -1507,7 +1507,6 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */ lp->tx_new = (++lp->tx_new) % lp->txRingSize; - dev->trans_start = jiffies; if (TX_BUFFS_AVAIL) { netif_start_queue(dev); /* Another pkt may be queued */ @@ -1937,7 +1936,7 @@ set_multicast_list(struct net_device *dev) lp->tx_new = (++lp->tx_new) % lp->txRingSize; outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ - dev->trans_start = jiffies; + dev->trans_start = jiffies; /* prevent tx timeout */ } } } 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) /* TX polling kick monitor */ if ( db->tx_packet_cnt && - time_after(jiffies, dev->trans_start + DMFE_TX_KICK) ) { + time_after(jiffies, dev_trans_start(dev) + DMFE_TX_KICK) ) { outl(0x1, dev->base_addr + DCR1); /* Tx polling again */ /* TX Timeout */ - if ( time_after(jiffies, dev->trans_start + DMFE_TX_TIMEOUT) ) { + if (time_after(jiffies, dev_trans_start(dev) + DMFE_TX_TIMEOUT) ) { db->reset_TXtimeout++; db->wait_reset = 1; 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) */ if (tulip_media_cap[dev->if_port] & MediaIsMII) return; - if (! tp->nwayset || time_after(jiffies, dev->trans_start + 1*HZ)) { + if (! tp->nwayset || time_after(jiffies, dev_trans_start(dev) + 1*HZ)) { tp->csr6 = 0x00420000 | (tp->csr6 & 0x0000fdff); iowrite32(tp->csr6, ioaddr + CSR6); 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) out_unlock: spin_unlock_irqrestore (&tp->lock, flags); - dev->trans_start = jiffies; + dev->trans_start = jiffies; /* prevent tx timeout */ netif_wake_queue (dev); } @@ -707,8 +707,6 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev) spin_unlock_irqrestore(&tp->lock, flags); - dev->trans_start = jiffies; - return NETDEV_TX_OK; } 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) /* TX polling kick monitor */ if ( db->tx_packet_cnt && - time_after(jiffies, dev->trans_start + ULI526X_TX_KICK) ) { + time_after(jiffies, dev_trans_start(dev) + ULI526X_TX_KICK) ) { outl(0x1, dev->base_addr + DCR1); // Tx polling again // TX Timeout - if ( time_after(jiffies, dev->trans_start + ULI526X_TX_TIMEOUT) ) { + if ( time_after(jiffies, dev_trans_start(dev) + ULI526X_TX_TIMEOUT) ) { db->reset_TXtimeout++; db->wait_reset = 1; 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) enable_irq(dev->irq); netif_wake_queue(dev); - dev->trans_start = jiffies; + dev->trans_start = jiffies; /* prevent tx timeout */ np->stats.tx_errors++; return; } @@ -1055,8 +1055,6 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev) } spin_unlock_irq(&np->lock); - dev->trans_start = jiffies; - if (debug > 4) { printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d\n", dev->name, np->cur_tx, entry); |