bonding: remove useless updating of slave->dev->last_rx
[firefly-linux-kernel-4.4.55.git] / include / linux / netdevice.h
index 440a02ee6f92cda68d3438ab88af3896d7c41af2..891432a994c0b1104c13da1b68baf1ea7c8d95cf 100644 (file)
@@ -1312,13 +1312,7 @@ struct net_device {
 /*
  * Cache lines mostly used on receive path (including eth_type_trans())
  */
-       unsigned long           last_rx;        /* Time of last Rx
-                                                * This should not be set in
-                                                * drivers, unless really needed,
-                                                * because network stack (bonding)
-                                                * use it if/when necessary, to
-                                                * avoid dirtying this cache line.
-                                                */
+       unsigned long           last_rx;        /* Time of last Rx */
 
        /* Interface address info used in eth_type_trans() */
        unsigned char           *dev_addr;      /* hw address, (before bcast
@@ -1726,6 +1720,20 @@ struct pcpu_sw_netstats {
        struct u64_stats_sync   syncp;
 };
 
+#define netdev_alloc_pcpu_stats(type)                          \
+({                                                             \
+       typeof(type) *pcpu_stats = alloc_percpu(type);          \
+       if (pcpu_stats) {                                       \
+               int i;                                          \
+               for_each_possible_cpu(i) {                      \
+                       typeof(type) *stat;                     \
+                       stat = per_cpu_ptr(pcpu_stats, i);      \
+                       u64_stats_init(&stat->syncp);           \
+               }                                               \
+       }                                                       \
+       pcpu_stats;                                             \
+})
+
 #include <linux/notifier.h>
 
 /* netdevice notifier chain. Please remember to update the rtnetlink