Skip to content

Commit c9fa320

Browse files
raed-salemrleon
authored andcommitted
xfrm: copy_to_user_state fetch offloaded SA packets/bytes statistics
Both in RX and TX, the traffic that performs IPsec packet offload transformation is accounted by HW only. Consequently, the HW should be queried for packets/bytes statistics when user asks for such transformation data. Signed-off-by: Raed Salem <[email protected]> Link: https://lore.kernel.org/r/d90ec74186452b1509ee94875d942cb777b7181e.1678714336.git.leon@kernel.org Acked-by: Steffen Klassert <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent e0aeb9b commit c9fa320

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/xfrm/xfrm_user.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,8 @@ static void copy_to_user_state(struct xfrm_state *x, struct xfrm_usersa_info *p)
901901
memcpy(&p->id, &x->id, sizeof(p->id));
902902
memcpy(&p->sel, &x->sel, sizeof(p->sel));
903903
memcpy(&p->lft, &x->lft, sizeof(p->lft));
904+
if (x->xso.dev)
905+
xfrm_dev_state_update_curlft(x);
904906
memcpy(&p->curlft, &x->curlft, sizeof(p->curlft));
905907
put_unaligned(x->stats.replay_window, &p->stats.replay_window);
906908
put_unaligned(x->stats.replay, &p->stats.replay);

0 commit comments

Comments
 (0)