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/hp100.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/hp100.c')
-rw-r--r-- | drivers/net/hp100.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 0f3f6c2e6942..68e5ac8832ad 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -1102,7 +1102,7 @@ static int hp100_open(struct net_device *dev) | |||
1102 | return -EAGAIN; | 1102 | return -EAGAIN; |
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | dev->trans_start = jiffies; | 1105 | dev->trans_start = jiffies; /* prevent tx timeout */ |
1106 | netif_start_queue(dev); | 1106 | netif_start_queue(dev); |
1107 | 1107 | ||
1108 | lp->lan_type = hp100_sense_lan(dev); | 1108 | lp->lan_type = hp100_sense_lan(dev); |
@@ -1510,7 +1510,7 @@ static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb, | |||
1510 | printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name); | 1510 | printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name); |
1511 | #endif | 1511 | #endif |
1512 | /* not waited long enough since last tx? */ | 1512 | /* not waited long enough since last tx? */ |
1513 | if (time_before(jiffies, dev->trans_start + HZ)) | 1513 | if (time_before(jiffies, dev_trans_start(dev) + HZ)) |
1514 | goto drop; | 1514 | goto drop; |
1515 | 1515 | ||
1516 | if (hp100_check_lan(dev)) | 1516 | if (hp100_check_lan(dev)) |
@@ -1547,7 +1547,6 @@ static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb, | |||
1547 | } | 1547 | } |
1548 | } | 1548 | } |
1549 | 1549 | ||
1550 | dev->trans_start = jiffies; | ||
1551 | goto drop; | 1550 | goto drop; |
1552 | } | 1551 | } |
1553 | 1552 | ||
@@ -1585,7 +1584,6 @@ static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb, | |||
1585 | /* Update statistics */ | 1584 | /* Update statistics */ |
1586 | lp->stats.tx_packets++; | 1585 | lp->stats.tx_packets++; |
1587 | lp->stats.tx_bytes += skb->len; | 1586 | lp->stats.tx_bytes += skb->len; |
1588 | dev->trans_start = jiffies; | ||
1589 | 1587 | ||
1590 | return NETDEV_TX_OK; | 1588 | return NETDEV_TX_OK; |
1591 | 1589 | ||
@@ -1663,7 +1661,7 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, | |||
1663 | printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i); | 1661 | printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i); |
1664 | #endif | 1662 | #endif |
1665 | /* not waited long enough since last failed tx try? */ | 1663 | /* not waited long enough since last failed tx try? */ |
1666 | if (time_before(jiffies, dev->trans_start + HZ)) { | 1664 | if (time_before(jiffies, dev_trans_start(dev) + HZ)) { |
1667 | #ifdef HP100_DEBUG | 1665 | #ifdef HP100_DEBUG |
1668 | printk("hp100: %s: trans_start timing problem\n", | 1666 | printk("hp100: %s: trans_start timing problem\n", |
1669 | dev->name); | 1667 | dev->name); |
@@ -1701,7 +1699,6 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, | |||
1701 | mdelay(1); | 1699 | mdelay(1); |
1702 | } | 1700 | } |
1703 | } | 1701 | } |
1704 | dev->trans_start = jiffies; | ||
1705 | goto drop; | 1702 | goto drop; |
1706 | } | 1703 | } |
1707 | 1704 | ||
@@ -1745,7 +1742,6 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, | |||
1745 | 1742 | ||
1746 | lp->stats.tx_packets++; | 1743 | lp->stats.tx_packets++; |
1747 | lp->stats.tx_bytes += skb->len; | 1744 | lp->stats.tx_bytes += skb->len; |
1748 | dev->trans_start = jiffies; | ||
1749 | hp100_ints_on(); | 1745 | hp100_ints_on(); |
1750 | spin_unlock_irqrestore(&lp->lock, flags); | 1746 | spin_unlock_irqrestore(&lp->lock, flags); |
1751 | 1747 | ||