]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: allow driver to quietly refuse offload
authorShannon Nelson <shannon.nelson@oracle.com>
Wed, 22 Aug 2018 21:38:10 +0000 (14:38 -0700)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 29 Aug 2018 06:04:44 +0000 (08:04 +0200)
commit9739428fcfece64b2cc7ecc068410967b03eeb56
treedfda8c43c591cd8266a5a3e0f0ace7dc513f1ef3
parent5f3a838397d144991bd27aee3afb4bfae7170647
xfrm: allow driver to quietly refuse offload

If the "offload" attribute is used to create an IPsec SA
and the .xdo_dev_state_add() fails, the SA creation fails.
However, if the "offload" attribute is used on a device that
doesn't offer it, the attribute is quietly ignored and the SA
is created without an offload.

Along the same line of that second case, it would be good to
have a way for the device to refuse to offload an SA without
failing the whole SA creation.  This patch adds that feature
by allowing the driver to return -EOPNOTSUPP as a signal that
the SA may be fine, it just can't be offloaded.

This allows the user a little more flexibility in requesting
offloads and not needing to know every detail at all times about
each specific NIC when trying to create SAs.

Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Documentation/networking/xfrm_device.txt
net/xfrm/xfrm_device.c