diff options
author | Leon Romanovsky <leonro@nvidia.com> | 2023-10-04 14:11:48 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2024-02-06 03:45:49 +0300 |
commit | f9f221c98fd83df518fbb2f5ad33980cfedfe1bf (patch) | |
tree | 628cc3e65fa3fda51edc9267a1695667b7dfbbf9 /net/xfrm/xfrm_state.c | |
parent | fd2bc4195d5107f88c1b90e1ec935888ccbfc5c0 (diff) | |
download | linux-f9f221c98fd83df518fbb2f5ad33980cfedfe1bf.tar.xz |
xfrm: get global statistics from the offloaded device
Iterate over all SAs in order to fill global IPsec statistics.
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r-- | net/xfrm/xfrm_state.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index d8701b2d0d57..0c306473a79d 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1957,6 +1957,19 @@ int xfrm_state_check_expire(struct xfrm_state *x) } EXPORT_SYMBOL(xfrm_state_check_expire); +void xfrm_state_update_stats(struct net *net) +{ + struct xfrm_state *x; + int i; + + spin_lock_bh(&net->xfrm.xfrm_state_lock); + for (i = 0; i <= net->xfrm.state_hmask; i++) { + hlist_for_each_entry(x, net->xfrm.state_bydst + i, bydst) + xfrm_dev_state_update_stats(x); + } + spin_unlock_bh(&net->xfrm.xfrm_state_lock); +} + struct xfrm_state * xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family) |