]> git.ipfire.org Git - thirdparty/linux.git/commit
xfrm: Skip redundant statistics update for crypto offload
authorJianbo Liu <jianbol@nvidia.com>
Thu, 3 Jul 2025 08:45:27 +0000 (11:45 +0300)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 4 Jul 2025 07:30:22 +0000 (09:30 +0200)
commit95cfe23285a6de17f11715378c93e6aee6d0ca75
treea7f50223b2110abe89b60b00026a884e9da9ed0b
parent94f39804d891cffe4ce17737d295f3b195bc7299
xfrm: Skip redundant statistics update for crypto offload

In the crypto offload path, every packet is still processed by the
software stack. The state's statistics required for the expiration
check are being updated in software.

However, the code also calls xfrm_dev_state_update_stats(), which
triggers a query to the hardware device to fetch statistics. This
hardware query is redundant and introduces unnecessary performance
overhead.

Skip this call when it's crypto offload (not packet offload) to avoid
the unnecessary hardware access, thereby improving performance.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_state.c