diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-05-10 08:01:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-10 08:01:31 -0400 |
commit | 1ae5dc342ac78d7a42965fd1f323815f6f5ef2c1 (patch) | |
tree | d1955a7639e99832590df26466a34d5786a880ae /drivers/net/wan | |
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/wan')
-rw-r--r-- | drivers/net/wan/dscc4.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/hd64570.c | 1 | ||||
-rw-r--r-- | drivers/net/wan/hd64572.c | 1 | ||||
-rw-r--r-- | drivers/net/wan/ixp4xx_hss.c | 1 | ||||
-rw-r--r-- | drivers/net/wan/lmc/lmc_main.c | 6 | ||||
-rw-r--r-- | drivers/net/wan/pc300_drv.c | 3 | ||||
-rw-r--r-- | drivers/net/wan/wanxl.c | 1 |
7 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c index a4859f7a7cc0..d45b08d1dbc9 100644 --- a/drivers/net/wan/dscc4.c +++ b/drivers/net/wan/dscc4.c | |||
@@ -1175,8 +1175,6 @@ static netdev_tx_t dscc4_start_xmit(struct sk_buff *skb, | |||
1175 | spin_unlock(&dpriv->lock); | 1175 | spin_unlock(&dpriv->lock); |
1176 | #endif | 1176 | #endif |
1177 | 1177 | ||
1178 | dev->trans_start = jiffies; | ||
1179 | |||
1180 | if (debug > 2) | 1178 | if (debug > 2) |
1181 | dscc4_tx_print(dev, dpriv, "Xmit"); | 1179 | dscc4_tx_print(dev, dpriv, "Xmit"); |
1182 | /* To be cleaned(unsigned int)/optimized. Later, ok ? */ | 1180 | /* To be cleaned(unsigned int)/optimized. Later, ok ? */ |
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c index 4dde2ea4a189..a3ea27ce04f2 100644 --- a/drivers/net/wan/hd64570.c +++ b/drivers/net/wan/hd64570.c | |||
@@ -658,7 +658,6 @@ static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev) | |||
658 | #endif | 658 | #endif |
659 | writew(len, &desc->len); | 659 | writew(len, &desc->len); |
660 | writeb(ST_TX_EOM, &desc->stat); | 660 | writeb(ST_TX_EOM, &desc->stat); |
661 | dev->trans_start = jiffies; | ||
662 | 661 | ||
663 | port->txin = next_desc(port, port->txin, 1); | 662 | port->txin = next_desc(port, port->txin, 1); |
664 | sca_outw(desc_offset(port, port->txin, 1), | 663 | sca_outw(desc_offset(port, port->txin, 1), |
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index aad9ed45c254..ea476cbd38b5 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c | |||
@@ -585,7 +585,6 @@ static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev) | |||
585 | 585 | ||
586 | writew(len, &desc->len); | 586 | writew(len, &desc->len); |
587 | writeb(ST_TX_EOM, &desc->stat); | 587 | writeb(ST_TX_EOM, &desc->stat); |
588 | dev->trans_start = jiffies; | ||
589 | 588 | ||
590 | port->txin = (port->txin + 1) % card->tx_ring_buffers; | 589 | port->txin = (port->txin + 1) % card->tx_ring_buffers; |
591 | sca_outl(desc_offset(port, port->txin, 1), | 590 | sca_outl(desc_offset(port, port->txin, 1), |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 0c2cdde686a0..88e363033e23 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
@@ -891,7 +891,6 @@ static int hss_hdlc_xmit(struct sk_buff *skb, struct net_device *dev) | |||
891 | 891 | ||
892 | wmb(); | 892 | wmb(); |
893 | queue_put_desc(queue_ids[port->id].tx, tx_desc_phys(port, n), desc); | 893 | queue_put_desc(queue_ids[port->id].tx, tx_desc_phys(port, n), desc); |
894 | dev->trans_start = jiffies; | ||
895 | 894 | ||
896 | if (qmgr_stat_below_low_watermark(txreadyq)) { /* empty */ | 895 | if (qmgr_stat_below_low_watermark(txreadyq)) { /* empty */ |
897 | #if DEBUG_TX | 896 | #if DEBUG_TX |
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index b27850377121..e2c6f7f4f51c 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c | |||
@@ -1506,8 +1506,6 @@ static netdev_tx_t lmc_start_xmit(struct sk_buff *skb, | |||
1506 | /* send now! */ | 1506 | /* send now! */ |
1507 | LMC_CSR_WRITE (sc, csr_txpoll, 0); | 1507 | LMC_CSR_WRITE (sc, csr_txpoll, 0); |
1508 | 1508 | ||
1509 | dev->trans_start = jiffies; | ||
1510 | |||
1511 | spin_unlock_irqrestore(&sc->lmc_lock, flags); | 1509 | spin_unlock_irqrestore(&sc->lmc_lock, flags); |
1512 | 1510 | ||
1513 | lmc_trace(dev, "lmc_start_xmit_out"); | 1511 | lmc_trace(dev, "lmc_start_xmit_out"); |
@@ -2103,7 +2101,7 @@ static void lmc_driver_timeout(struct net_device *dev) | |||
2103 | printk("%s: Xmitter busy|\n", dev->name); | 2101 | printk("%s: Xmitter busy|\n", dev->name); |
2104 | 2102 | ||
2105 | sc->extra_stats.tx_tbusy_calls++; | 2103 | sc->extra_stats.tx_tbusy_calls++; |
2106 | if (jiffies - dev->trans_start < TX_TIMEOUT) | 2104 | if (jiffies - dev_trans_start(dev) < TX_TIMEOUT) |
2107 | goto bug_out; | 2105 | goto bug_out; |
2108 | 2106 | ||
2109 | /* | 2107 | /* |
@@ -2135,7 +2133,7 @@ static void lmc_driver_timeout(struct net_device *dev) | |||
2135 | sc->lmc_device->stats.tx_errors++; | 2133 | sc->lmc_device->stats.tx_errors++; |
2136 | sc->extra_stats.tx_ProcTimeout++; /* -baz */ | 2134 | sc->extra_stats.tx_ProcTimeout++; /* -baz */ |
2137 | 2135 | ||
2138 | dev->trans_start = jiffies; | 2136 | dev->trans_start = jiffies; /* prevent tx timeout */ |
2139 | 2137 | ||
2140 | bug_out: | 2138 | bug_out: |
2141 | 2139 | ||
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 17502d80b65a..c6aa66e5b52f 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -1790,7 +1790,7 @@ static void cpc_tx_timeout(struct net_device *dev) | |||
1790 | cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) & | 1790 | cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) & |
1791 | ~(CPLD_REG2_FALC_LED1 << (2 * ch))); | 1791 | ~(CPLD_REG2_FALC_LED1 << (2 * ch))); |
1792 | } | 1792 | } |
1793 | dev->trans_start = jiffies; | 1793 | dev->trans_start = jiffies; /* prevent tx timeout */ |
1794 | CPC_UNLOCK(card, flags); | 1794 | CPC_UNLOCK(card, flags); |
1795 | netif_wake_queue(dev); | 1795 | netif_wake_queue(dev); |
1796 | } | 1796 | } |
@@ -1849,7 +1849,6 @@ static int cpc_queue_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1849 | if (d->trace_on) { | 1849 | if (d->trace_on) { |
1850 | cpc_trace(dev, skb, 'T'); | 1850 | cpc_trace(dev, skb, 'T'); |
1851 | } | 1851 | } |
1852 | dev->trans_start = jiffies; | ||
1853 | 1852 | ||
1854 | /* Start transmission */ | 1853 | /* Start transmission */ |
1855 | CPC_LOCK(card, flags); | 1854 | CPC_LOCK(card, flags); |
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 541c700dceef..db73a7be199f 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c | |||
@@ -298,7 +298,6 @@ static netdev_tx_t wanxl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
298 | desc->stat = PACKET_FULL; | 298 | desc->stat = PACKET_FULL; |
299 | writel(1 << (DOORBELL_TO_CARD_TX_0 + port->node), | 299 | writel(1 << (DOORBELL_TO_CARD_TX_0 + port->node), |
300 | port->card->plx + PLX_DOORBELL_TO_CARD); | 300 | port->card->plx + PLX_DOORBELL_TO_CARD); |
301 | dev->trans_start = jiffies; | ||
302 | 301 | ||
303 | port->tx_out = (port->tx_out + 1) % TX_BUFFERS; | 302 | port->tx_out = (port->tx_out + 1) % TX_BUFFERS; |
304 | 303 | ||