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/sun3lance.c | |
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/sun3lance.c')
-rw-r--r-- | drivers/net/sun3lance.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c index 1694ca5bfb41..358c22f9acbe 100644 --- a/drivers/net/sun3lance.c +++ b/drivers/net/sun3lance.c | |||
@@ -523,8 +523,8 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
523 | 523 | ||
524 | /* Transmitter timeout, serious problems. */ | 524 | /* Transmitter timeout, serious problems. */ |
525 | if (netif_queue_stopped(dev)) { | 525 | if (netif_queue_stopped(dev)) { |
526 | int tickssofar = jiffies - dev->trans_start; | 526 | int tickssofar = jiffies - dev_trans_start(dev); |
527 | if (tickssofar < 20) | 527 | if (tickssofar < HZ/5) |
528 | return NETDEV_TX_BUSY; | 528 | return NETDEV_TX_BUSY; |
529 | 529 | ||
530 | DPRINTK( 1, ( "%s: transmit timed out, status %04x, resetting.\n", | 530 | DPRINTK( 1, ( "%s: transmit timed out, status %04x, resetting.\n", |
@@ -559,7 +559,6 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
559 | REGA( CSR0 ) = CSR0_INEA | CSR0_INIT | CSR0_STRT; | 559 | REGA( CSR0 ) = CSR0_INEA | CSR0_INIT | CSR0_STRT; |
560 | 560 | ||
561 | netif_start_queue(dev); | 561 | netif_start_queue(dev); |
562 | dev->trans_start = jiffies; | ||
563 | 562 | ||
564 | return NETDEV_TX_OK; | 563 | return NETDEV_TX_OK; |
565 | } | 564 | } |
@@ -637,8 +636,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
637 | AREG = CSR0; | 636 | AREG = CSR0; |
638 | DPRINTK( 2, ( "%s: lance_start_xmit() exiting, csr0 %4.4x.\n", | 637 | DPRINTK( 2, ( "%s: lance_start_xmit() exiting, csr0 %4.4x.\n", |
639 | dev->name, DREG )); | 638 | dev->name, DREG )); |
640 | dev->trans_start = jiffies; | 639 | dev_kfree_skb(skb); |
641 | dev_kfree_skb( skb ); | ||
642 | 640 | ||
643 | lp->lock = 0; | 641 | lp->lock = 0; |
644 | if ((MEM->tx_head[(entry+1) & TX_RING_MOD_MASK].flag & TMD1_OWN) == | 642 | if ((MEM->tx_head[(entry+1) & TX_RING_MOD_MASK].flag & TMD1_OWN) == |