aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2018-02-07 13:57:30 -0800
committerFelix Fietkau <nbd@nbd.name>2018-02-28 12:46:02 +0100
commit810659a22c11ea0d2d94f3e09ddf7eb2d2bb1f1e (patch)
treef76c6928d9579dfadd8103d31f3b94654939042c
parent83d8df1ea21d4ab6d8d3f890d8f8a8e4718a80e8 (diff)
downloadupstream-810659a22c11ea0d2d94f3e09ddf7eb2d2bb1f1e.tar.gz
upstream-810659a22c11ea0d2d94f3e09ddf7eb2d2bb1f1e.tar.bz2
upstream-810659a22c11ea0d2d94f3e09ddf7eb2d2bb1f1e.zip
ag71xx: Move timestamp struct member outside of struct.
With this change, the timestamp variable is only used in ag71xx_check_dma_stuck. Small tx speedup. Based on a Qualcomm commit. ag->timestamp = jiffies was not replaced with netif_trans_update(dev) because of this quote: It should be noted that after this series several instances of netif_trans_update() are useless (if they occur in .ndo_start_xmit and driver doesn't set LLTX flag -- stack already did an update). From: http://lists.openwall.net/netdev/2016/05/03/87 Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h2
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h
index 38dcc915f9..35318fb713 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h
@@ -169,8 +169,6 @@ struct ag71xx {
struct napi_struct napi;
u32 msg_enable;
- unsigned long timestamp;
-
/*
* From this point onwards we're not looking at per-packet fields.
*/
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 47b4c69c4d..95682b7641 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -816,7 +816,6 @@ static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb,
i = (ring->curr + n - 1) & ring_mask;
ring->buf[i].len = skb->len;
ring->buf[i].skb = skb;
- ag->timestamp = jiffies;
netdev_sent_queue(dev, skb->len);
@@ -928,9 +927,11 @@ static void ag71xx_restart_work_func(struct work_struct *work)
static bool ag71xx_check_dma_stuck(struct ag71xx *ag)
{
+ unsigned long timestamp;
u32 rx_sm, tx_sm, rx_fd;
- if (likely(time_before(jiffies, ag->timestamp + HZ/10)))
+ timestamp = netdev_get_tx_queue(ag->dev, 0)->trans_start;
+ if (likely(time_before(jiffies, timestamp + HZ/10)))
return false;
if (!netif_carrier_ok(ag->dev))