aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/proc.c')
-rw-r--r--net/ipv6/proc.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 1008ce94bc33..fdeb6d03da81 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -142,11 +142,7 @@ static const struct snmp_mib snmp6_udplite6_list[] = {
142 SNMP_MIB_SENTINEL 142 SNMP_MIB_SENTINEL
143}; 143};
144 144
145/* can be called either with percpu mib (pcpumib != NULL), 145static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, atomic_long_t *smib)
146 * or shared one (smib != NULL)
147 */
148static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void __percpu **pcpumib,
149 atomic_long_t *smib)
150{ 146{
151 char name[32]; 147 char name[32];
152 int i; 148 int i;
@@ -163,14 +159,14 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void __percpu **pcpum
163 snprintf(name, sizeof(name), "Icmp6%s%s", 159 snprintf(name, sizeof(name), "Icmp6%s%s",
164 i & 0x100 ? "Out" : "In", p); 160 i & 0x100 ? "Out" : "In", p);
165 seq_printf(seq, "%-32s\t%lu\n", name, 161 seq_printf(seq, "%-32s\t%lu\n", name,
166 pcpumib ? snmp_fold_field(pcpumib, i) : atomic_long_read(smib + i)); 162 atomic_long_read(smib + i));
167 } 163 }
168 164
169 /* print by number (nonzero only) - ICMPMsgStat format */ 165 /* print by number (nonzero only) - ICMPMsgStat format */
170 for (i = 0; i < ICMP6MSG_MIB_MAX; i++) { 166 for (i = 0; i < ICMP6MSG_MIB_MAX; i++) {
171 unsigned long val; 167 unsigned long val;
172 168
173 val = pcpumib ? snmp_fold_field(pcpumib, i) : atomic_long_read(smib + i); 169 val = atomic_long_read(smib + i);
174 if (!val) 170 if (!val)
175 continue; 171 continue;
176 snprintf(name, sizeof(name), "Icmp6%sType%u", 172 snprintf(name, sizeof(name), "Icmp6%sType%u",
@@ -215,8 +211,7 @@ static int snmp6_seq_show(struct seq_file *seq, void *v)
215 snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp)); 211 snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp));
216 snmp6_seq_show_item(seq, (void __percpu **)net->mib.icmpv6_statistics, 212 snmp6_seq_show_item(seq, (void __percpu **)net->mib.icmpv6_statistics,
217 NULL, snmp6_icmp6_list); 213 NULL, snmp6_icmp6_list);
218 snmp6_seq_show_icmpv6msg(seq, 214 snmp6_seq_show_icmpv6msg(seq, net->mib.icmpv6msg_statistics->mibs);
219 (void __percpu **)net->mib.icmpv6msg_statistics, NULL);
220 snmp6_seq_show_item(seq, (void __percpu **)net->mib.udp_stats_in6, 215 snmp6_seq_show_item(seq, (void __percpu **)net->mib.udp_stats_in6,
221 NULL, snmp6_udp6_list); 216 NULL, snmp6_udp6_list);
222 snmp6_seq_show_item(seq, (void __percpu **)net->mib.udplite_stats_in6, 217 snmp6_seq_show_item(seq, (void __percpu **)net->mib.udplite_stats_in6,
@@ -246,7 +241,7 @@ static int snmp6_dev_seq_show(struct seq_file *seq, void *v)
246 snmp6_ipstats_list); 241 snmp6_ipstats_list);
247 snmp6_seq_show_item(seq, NULL, idev->stats.icmpv6dev->mibs, 242 snmp6_seq_show_item(seq, NULL, idev->stats.icmpv6dev->mibs,
248 snmp6_icmp6_list); 243 snmp6_icmp6_list);
249 snmp6_seq_show_icmpv6msg(seq, NULL, idev->stats.icmpv6msgdev->mibs); 244 snmp6_seq_show_icmpv6msg(seq, idev->stats.icmpv6msgdev->mibs);
250 return 0; 245 return 0;
251} 246}
252 247