Skip to content

Commit 9b49f55

Browse files
PatrisiousHaddadklassert
authored andcommitted
xfrm: Remove documentation WARN_ON to limit return values for offloaded SA
The original idea to put WARN_ON() on return value from driver code was to make sure that packet offload doesn't have silent fallback to SW implementation, like crypto offload has. In reality, this is not needed as all *swan implementations followed this request and used explicit configuration style to make sure that "users will get what they ask". So instead of forcing drivers to make sure that even their internal flows don't return -EOPNOTSUPP, let's remove this WARN_ON. Signed-off-by: Patrisious Haddad <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 8e0c0ec commit 9b49f55

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

net/xfrm/xfrm_device.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,8 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
328328
/* User explicitly requested packet offload mode and configured
329329
* policy in addition to the XFRM state. So be civil to users,
330330
* and return an error instead of taking fallback path.
331-
*
332-
* This WARN_ON() can be seen as a documentation for driver
333-
* authors to do not return -EOPNOTSUPP in packet offload mode.
334331
*/
335-
WARN_ON(err == -EOPNOTSUPP && is_packet_offload);
336-
if (err != -EOPNOTSUPP || is_packet_offload) {
332+
if ((err != -EOPNOTSUPP && !is_packet_offload) || is_packet_offload) {
337333
NL_SET_ERR_MSG_WEAK(extack, "Device failed to offload this state");
338334
return err;
339335
}

0 commit comments

Comments
 (0)