]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/ip.h
Merge tag 'mfd-for-linus-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
[karo-tx-linux.git] / include / net / ip.h
index 9742b92dc93386ea1e8cc86911feecd0f650fa9e..bc43c0fcae122daea994a17843abcd84f6e6adb1 100644 (file)
@@ -219,6 +219,29 @@ static inline u64 snmp_fold_field64(void __percpu *mib, int offt, size_t syncp_o
 }
 #endif
 
+#define snmp_get_cpu_field64_batch(buff64, stats_list, mib_statistic, offset) \
+{ \
+       int i, c; \
+       for_each_possible_cpu(c) { \
+               for (i = 0; stats_list[i].name; i++) \
+                       buff64[i] += snmp_get_cpu_field64( \
+                                       mib_statistic, \
+                                       c, stats_list[i].entry, \
+                                       offset); \
+       } \
+}
+
+#define snmp_get_cpu_field_batch(buff, stats_list, mib_statistic) \
+{ \
+       int i, c; \
+       for_each_possible_cpu(c) { \
+               for (i = 0; stats_list[i].name; i++) \
+                       buff[i] += snmp_get_cpu_field( \
+                                               mib_statistic, \
+                                               c, stats_list[i].entry); \
+       } \
+}
+
 void inet_get_local_port_range(struct net *net, int *low, int *high);
 
 #ifdef CONFIG_SYSCTL