diff mbox series

[01/13] xfrm: Remove documentation WARN_ON to limit return values for offloaded SA

Message ID 20240910065507.2436394-2-steffen.klassert@secunet.com (mailing list archive)
State Accepted
Commit 9b49f55838b1f42b2624216ce494f0536669e8f0
Delegated to: Netdev Maintainers
Headers show
Series [01/13] xfrm: Remove documentation WARN_ON to limit return values for offloaded SA | expand

Checks

Context Check Description
netdev/series_format warning Pull request is its own cover letter; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 2 maintainers not CCed: pabeni@redhat.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch warning WARNING: line length of 86 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Steffen Klassert Sept. 10, 2024, 6:54 a.m. UTC
From: Patrisious Haddad <phaddad@nvidia.com>

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 <phaddad@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_device.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 11, 2024, 2:20 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Steffen Klassert <steffen.klassert@secunet.com>:

On Tue, 10 Sep 2024 08:54:55 +0200 you wrote:
> From: Patrisious Haddad <phaddad@nvidia.com>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [01/13] xfrm: Remove documentation WARN_ON to limit return values for offloaded SA
    https://git.kernel.org/netdev/net-next/c/9b49f55838b1
  - [02/13] net: add copy from skb_seq_state to buffer function
    https://git.kernel.org/netdev/net-next/c/6ad8bc92a477
  - [03/13] xfrm: Correct spelling in xfrm.h
    https://git.kernel.org/netdev/net-next/c/54f2f78d6b9f
  - [04/13] selftests: add xfrm policy insertion speed test script
    https://git.kernel.org/netdev/net-next/c/9c5b6d4e33dd
  - [05/13] xfrm: policy: don't iterate inexact policies twice at insert time
    https://git.kernel.org/netdev/net-next/c/33f611cf7d52
  - [06/13] xfrm: switch migrate to xfrm_policy_lookup_bytype
    https://git.kernel.org/netdev/net-next/c/563d5ca93e88
  - [07/13] xfrm: policy: remove remaining use of inexact list
    https://git.kernel.org/netdev/net-next/c/a54ad727f745
  - [08/13] xfrm: add SA information to the offloaded packet
    https://git.kernel.org/netdev/net-next/c/e7cd191f83fd
  - [09/13] xfrm: policy: use recently added helper in more places
    https://git.kernel.org/netdev/net-next/c/08c2182cf0b4
  - [10/13] xfrm: minor update to sdb and xfrm_policy comments
    https://git.kernel.org/netdev/net-next/c/17163f23678c
  - [11/13] Revert "xfrm: add SA information to the offloaded packet"
    https://git.kernel.org/netdev/net-next/c/69716a3babe1
  - [12/13] xfrm: policy: fix null dereference
    https://git.kernel.org/netdev/net-next/c/6a13f5afd39d
  - [13/13] xfrm: policy: Restore dir assignments in xfrm_hash_rebuild()
    https://git.kernel.org/netdev/net-next/c/e62d39332d4b

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 9a44d363ba62..f123b7c9ec82 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -328,12 +328,8 @@  int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
 		/* User explicitly requested packet offload mode and configured
 		 * policy in addition to the XFRM state. So be civil to users,
 		 * and return an error instead of taking fallback path.
-		 *
-		 * This WARN_ON() can be seen as a documentation for driver
-		 * authors to do not return -EOPNOTSUPP in packet offload mode.
 		 */
-		WARN_ON(err == -EOPNOTSUPP && is_packet_offload);
-		if (err != -EOPNOTSUPP || is_packet_offload) {
+		if ((err != -EOPNOTSUPP && !is_packet_offload) || is_packet_offload) {
 			NL_SET_ERR_MSG_WEAK(extack, "Device failed to offload this state");
 			return err;
 		}