diff options
author | Fan Du <fan.du@windriver.com> | 2014-01-02 22:18:28 -0500 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2014-01-03 01:29:11 -0500 |
commit | 6de9ace4aeef861bf093c5e9b55dc65d1558d1b3 (patch) | |
tree | dcec80ef362e37941a271bc9c1b46ea9cc684d33 /net | |
parent | 0af0a4136b456d3b337948c76a3d709a38d80d2c (diff) |
{pktgen, xfrm} Add statistics counting when transforming
so /proc/net/xfrm_stat could give user clue about what's
wrong in this process.
Signed-off-by: Fan Du <fan.du@windriver.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/pktgen.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index b0075865d29b..156d57b616ac 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -2479,6 +2479,7 @@ static int pktgen_output_ipsec(struct sk_buff *skb, struct pktgen_dev *pkt_dev) | |||
2479 | { | 2479 | { |
2480 | struct xfrm_state *x = pkt_dev->flows[pkt_dev->curfl].x; | 2480 | struct xfrm_state *x = pkt_dev->flows[pkt_dev->curfl].x; |
2481 | int err = 0; | 2481 | int err = 0; |
2482 | struct net *net = dev_net(pkt_dev->odev); | ||
2482 | 2483 | ||
2483 | if (!x) | 2484 | if (!x) |
2484 | return 0; | 2485 | return 0; |
@@ -2488,12 +2489,15 @@ static int pktgen_output_ipsec(struct sk_buff *skb, struct pktgen_dev *pkt_dev) | |||
2488 | return 0; | 2489 | return 0; |
2489 | 2490 | ||
2490 | err = x->outer_mode->output(x, skb); | 2491 | err = x->outer_mode->output(x, skb); |
2491 | if (err) | 2492 | if (err) { |
2493 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEMODEERROR); | ||
2492 | goto error; | 2494 | goto error; |
2495 | } | ||
2493 | err = x->type->output(x, skb); | 2496 | err = x->type->output(x, skb); |
2494 | if (err) | 2497 | if (err) { |
2498 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEPROTOERROR); | ||
2495 | goto error; | 2499 | goto error; |
2496 | 2500 | } | |
2497 | spin_lock_bh(&x->lock); | 2501 | spin_lock_bh(&x->lock); |
2498 | x->curlft.bytes += skb->len; | 2502 | x->curlft.bytes += skb->len; |
2499 | x->curlft.packets++; | 2503 | x->curlft.packets++; |