Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123991
b: refs/heads/master
c: 91b208c
h: refs/heads/master
i:
  123989: 8326237
  123987: 6043b4e
  123983: 96e4dbe
v: v3
  • Loading branch information
Rusty Russell authored and David S. Miller committed Dec 30, 2008
1 parent 3522cab commit 3bdf922
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2d0658d4ef92e4958172c832bd88c961840e599e
refs/heads/master: 91b208c7c1db4cefa2247f8243fbda75b0472d24
17 changes: 2 additions & 15 deletions trunk/net/xfrm/xfrm_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,14 @@ static struct snmp_mib xfrm_mib_list[] = {
SNMP_MIB_SENTINEL
};

static unsigned long
fold_field(void *mib[], int offt)
{
unsigned long res = 0;
int i;

for_each_possible_cpu(i) {
res += *(((unsigned long *)per_cpu_ptr(mib[0], i)) + offt);
res += *(((unsigned long *)per_cpu_ptr(mib[1], i)) + offt);
}
return res;
}

static int xfrm_statistics_seq_show(struct seq_file *seq, void *v)
{
struct net *net = seq->private;
int i;
for (i=0; xfrm_mib_list[i].name; i++)
seq_printf(seq, "%-24s\t%lu\n", xfrm_mib_list[i].name,
fold_field((void **)net->mib.xfrm_statistics,
xfrm_mib_list[i].entry));
snmp_fold_field((void **)net->mib.xfrm_statistics,
xfrm_mib_list[i].entry));
return 0;
}

Expand Down

0 comments on commit 3bdf922

Please sign in to comment.