layerscape: reverse changes to ndo_get_stats64
[openwrt/staging/chunkeey.git] / target / linux / layerscape / patches-4.9 / 603-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch
1 From 3d33284eb087deb7f62639a2d2c03b9d0a3eeb34 Mon Sep 17 00:00:00 2001
2 From: Camelia Groza <camelia.groza@nxp.com>
3 Date: Mon, 11 Sep 2017 17:20:41 +0800
4 Subject: [PATCH] sdk_dpaa: update the xmit timestamp to avoid watchdog
5 timeouts
6
7 [core-linux part]
8
9 Update txq0's trans_start in order to prevent the netdev watchdog from
10 triggering too quickly. Since we set the LLTX flag, the stack won't update
11 the jiffies for other tx queues. Prevent the watchdog from checking the
12 other tx queues by adding the NETIF_HW_ACCEL_MQ flag.
13
14 Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
15 ---
16 include/linux/netdev_features.h | 2 ++
17 net/sched/sch_generic.c | 7 +++++++
18 2 files changed, 9 insertions(+)
19
20 diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
21 index 9c6c8ef2e9e7..90b4107ebeff 100644
22 --- a/include/linux/netdev_features.h
23 +++ b/include/linux/netdev_features.h
24 @@ -74,6 +74,7 @@ enum {
25 NETIF_F_BUSY_POLL_BIT, /* Busy poll */
26
27 NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */
28 + NETIF_F_HW_ACCEL_MQ_BIT, /* Hardware-accelerated multiqueue */
29
30 /*
31 * Add your fresh new feature above and remember to update
32 @@ -136,6 +137,7 @@ enum {
33 #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
34 #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
35 #define NETIF_F_HW_TC __NETIF_F(HW_TC)
36 +#define NETIF_F_HW_ACCEL_MQ __NETIF_F(HW_ACCEL_MQ)
37
38 #define for_each_netdev_feature(mask_addr, bit) \
39 for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT)
40 diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
41 index 6cfb6e9038c2..3fab16cb7c58 100644
42 --- a/net/sched/sch_generic.c
43 +++ b/net/sched/sch_generic.c
44 @@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long arg)
45 txq->trans_timeout++;
46 break;
47 }
48 +
49 + /* Devices with HW_ACCEL_MQ have multiple txqs
50 + * but update only the first one's transmission
51 + * timestamp so avoid checking the rest.
52 + */
53 + if (dev->features & NETIF_F_HW_ACCEL_MQ)
54 + break;
55 }
56
57 if (some_queue_timedout) {
58 --
59 2.11.1
60