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/pcmcia | |
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/pcmcia')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 4 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 3 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 1 | ||||
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 4 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 3 |
7 files changed, 6 insertions, 13 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 757f87bb1db3..b6d9313cec00 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -739,7 +739,7 @@ static void el3_tx_timeout(struct net_device *dev) | |||
739 | printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); | 739 | printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); |
740 | dump_status(dev); | 740 | dump_status(dev); |
741 | dev->stats.tx_errors++; | 741 | dev->stats.tx_errors++; |
742 | dev->trans_start = jiffies; | 742 | dev->trans_start = jiffies; /* prevent tx timeout */ |
743 | /* Issue TX_RESET and TX_START commands. */ | 743 | /* Issue TX_RESET and TX_START commands. */ |
744 | tc574_wait_for_completion(dev, TxReset); | 744 | tc574_wait_for_completion(dev, TxReset); |
745 | outw(TxEnable, ioaddr + EL3_CMD); | 745 | outw(TxEnable, ioaddr + EL3_CMD); |
@@ -790,8 +790,6 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb, | |||
790 | /* ... and the packet rounded to a doubleword. */ | 790 | /* ... and the packet rounded to a doubleword. */ |
791 | outsl(ioaddr + TX_FIFO, skb->data, (skb->len+3)>>2); | 791 | outsl(ioaddr + TX_FIFO, skb->data, (skb->len+3)>>2); |
792 | 792 | ||
793 | dev->trans_start = jiffies; | ||
794 | |||
795 | /* TxFree appears only in Window 1, not offset 0x1c. */ | 793 | /* TxFree appears only in Window 1, not offset 0x1c. */ |
796 | if (inw(ioaddr + TxFree) <= 1536) { | 794 | if (inw(ioaddr + TxFree) <= 1536) { |
797 | netif_stop_queue(dev); | 795 | netif_stop_queue(dev); |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 580977f56ad0..d6a459dd4894 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -563,7 +563,7 @@ static void el3_tx_timeout(struct net_device *dev) | |||
563 | netdev_warn(dev, "Transmit timed out!\n"); | 563 | netdev_warn(dev, "Transmit timed out!\n"); |
564 | dump_status(dev); | 564 | dump_status(dev); |
565 | dev->stats.tx_errors++; | 565 | dev->stats.tx_errors++; |
566 | dev->trans_start = jiffies; | 566 | dev->trans_start = jiffies; /* prevent tx timeout */ |
567 | /* Issue TX_RESET and TX_START commands. */ | 567 | /* Issue TX_RESET and TX_START commands. */ |
568 | tc589_wait_for_completion(dev, TxReset); | 568 | tc589_wait_for_completion(dev, TxReset); |
569 | outw(TxEnable, ioaddr + EL3_CMD); | 569 | outw(TxEnable, ioaddr + EL3_CMD); |
@@ -611,7 +611,6 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb, | |||
611 | /* ... and the packet rounded to a doubleword. */ | 611 | /* ... and the packet rounded to a doubleword. */ |
612 | outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); | 612 | outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); |
613 | 613 | ||
614 | dev->trans_start = jiffies; | ||
615 | if (inw(ioaddr + TX_FREE) <= 1536) { | 614 | if (inw(ioaddr + TX_FREE) <= 1536) { |
616 | netif_stop_queue(dev); | 615 | netif_stop_queue(dev); |
617 | /* Interrupt us when the FIFO has room for max-sized packet. */ | 616 | /* Interrupt us when the FIFO has room for max-sized packet. */ |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 70fc9591821f..a1a6b087e242 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1005,7 +1005,7 @@ static void axnet_tx_timeout(struct net_device *dev) | |||
1005 | { | 1005 | { |
1006 | long e8390_base = dev->base_addr; | 1006 | long e8390_base = dev->base_addr; |
1007 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 1007 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); |
1008 | int txsr, isr, tickssofar = jiffies - dev->trans_start; | 1008 | int txsr, isr, tickssofar = jiffies - dev_trans_start(dev); |
1009 | unsigned long flags; | 1009 | unsigned long flags; |
1010 | 1010 | ||
1011 | dev->stats.tx_errors++; | 1011 | dev->stats.tx_errors++; |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 6734f7d6da98..16fc3e53c5cb 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -890,7 +890,6 @@ static netdev_tx_t fjn_start_xmit(struct sk_buff *skb, | |||
890 | lp->sent = lp->tx_queue ; | 890 | lp->sent = lp->tx_queue ; |
891 | lp->tx_queue = 0; | 891 | lp->tx_queue = 0; |
892 | lp->tx_queue_len = 0; | 892 | lp->tx_queue_len = 0; |
893 | dev->trans_start = jiffies; | ||
894 | lp->tx_started = 1; | 893 | lp->tx_started = 1; |
895 | netif_start_queue(dev); | 894 | netif_start_queue(dev); |
896 | } else { | 895 | } else { |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index c516c1996354..ca4efd2871f3 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -903,7 +903,7 @@ static void mace_tx_timeout(struct net_device *dev) | |||
903 | #else /* #if RESET_ON_TIMEOUT */ | 903 | #else /* #if RESET_ON_TIMEOUT */ |
904 | printk("NOT resetting card\n"); | 904 | printk("NOT resetting card\n"); |
905 | #endif /* #if RESET_ON_TIMEOUT */ | 905 | #endif /* #if RESET_ON_TIMEOUT */ |
906 | dev->trans_start = jiffies; | 906 | dev->trans_start = jiffies; /* prevent tx timeout */ |
907 | netif_wake_queue(dev); | 907 | netif_wake_queue(dev); |
908 | } | 908 | } |
909 | 909 | ||
@@ -945,8 +945,6 @@ static netdev_tx_t mace_start_xmit(struct sk_buff *skb, | |||
945 | outb(skb->data[skb->len-1], ioaddr + AM2150_XMT); | 945 | outb(skb->data[skb->len-1], ioaddr + AM2150_XMT); |
946 | } | 946 | } |
947 | 947 | ||
948 | dev->trans_start = jiffies; | ||
949 | |||
950 | #if MULTI_TX | 948 | #if MULTI_TX |
951 | if (lp->tx_free_frames > 0) | 949 | if (lp->tx_free_frames > 0) |
952 | netif_start_queue(dev); | 950 | netif_start_queue(dev); |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 949ac1a12537..b5c62db251db 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -1254,7 +1254,7 @@ static void smc_tx_timeout(struct net_device *dev) | |||
1254 | dev->name, inw(ioaddr)&0xff, inw(ioaddr + 2)); | 1254 | dev->name, inw(ioaddr)&0xff, inw(ioaddr + 2)); |
1255 | dev->stats.tx_errors++; | 1255 | dev->stats.tx_errors++; |
1256 | smc_reset(dev); | 1256 | smc_reset(dev); |
1257 | dev->trans_start = jiffies; | 1257 | dev->trans_start = jiffies; /* prevent tx timeout */ |
1258 | smc->saved_skb = NULL; | 1258 | smc->saved_skb = NULL; |
1259 | netif_wake_queue(dev); | 1259 | netif_wake_queue(dev); |
1260 | } | 1260 | } |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 656be931207a..6622f0401794 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -1295,7 +1295,7 @@ xirc2ps_tx_timeout_task(struct work_struct *work) | |||
1295 | struct net_device *dev = local->dev; | 1295 | struct net_device *dev = local->dev; |
1296 | /* reset the card */ | 1296 | /* reset the card */ |
1297 | do_reset(dev,1); | 1297 | do_reset(dev,1); |
1298 | dev->trans_start = jiffies; | 1298 | dev->trans_start = jiffies; /* prevent tx timeout */ |
1299 | netif_wake_queue(dev); | 1299 | netif_wake_queue(dev); |
1300 | } | 1300 | } |
1301 | 1301 | ||
@@ -1358,7 +1358,6 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1358 | PutByte(XIRCREG_CR, TransmitPacket|EnableIntr); | 1358 | PutByte(XIRCREG_CR, TransmitPacket|EnableIntr); |
1359 | 1359 | ||
1360 | dev_kfree_skb (skb); | 1360 | dev_kfree_skb (skb); |
1361 | dev->trans_start = jiffies; | ||
1362 | dev->stats.tx_bytes += pktlen; | 1361 | dev->stats.tx_bytes += pktlen; |
1363 | netif_start_queue(dev); | 1362 | netif_start_queue(dev); |
1364 | return NETDEV_TX_OK; | 1363 | return NETDEV_TX_OK; |