netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	<netdev@vger.kernel.org>
Subject: [PATCH 01/11] xfrm: Remove documentation WARN_ON to limit return values for offloaded SA
Date: Mon, 9 Sep 2024 12:03:18 +0200	[thread overview]
Message-ID: <20240909100328.1838963-2-steffen.klassert@secunet.com> (raw)
In-Reply-To: <20240909100328.1838963-1-steffen.klassert@secunet.com>

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(-)

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;
 		}
-- 
2.34.1


  reply	other threads:[~2024-09-09 10:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09 10:03 [PATCH 0/11] pull request (net-next): ipsec-next 2024-09-09 Steffen Klassert
2024-09-09 10:03 ` Steffen Klassert [this message]
2024-09-09 10:03 ` [PATCH 02/11] net: add copy from skb_seq_state to buffer function Steffen Klassert
2024-09-09 10:03 ` [PATCH 03/11] xfrm: Correct spelling in xfrm.h Steffen Klassert
2024-09-09 10:03 ` [PATCH 04/11] selftests: add xfrm policy insertion speed test script Steffen Klassert
2024-09-09 10:03 ` [PATCH 05/11] xfrm: policy: don't iterate inexact policies twice at insert time Steffen Klassert
2024-09-09 10:03 ` [PATCH 06/11] xfrm: switch migrate to xfrm_policy_lookup_bytype Steffen Klassert
2024-09-09 11:01   ` Florian Westphal
2024-09-09 13:18     ` Steffen Klassert
2024-09-09 10:03 ` [PATCH 07/11] xfrm: policy: remove remaining use of inexact list Steffen Klassert
2024-09-09 10:03 ` [PATCH 08/11] xfrm: add SA information to the offloaded packet Steffen Klassert
2024-09-09 10:03 ` [PATCH 09/11] xfrm: policy: use recently added helper in more places Steffen Klassert
2024-09-09 10:59   ` Florian Westphal
2024-09-09 13:19     ` Steffen Klassert
2024-09-09 10:03 ` [PATCH 10/11] xfrm: minor update to sdb and xfrm_policy comments Steffen Klassert
2024-09-09 10:03 ` [PATCH 11/11] Revert "xfrm: add SA information to the offloaded packet" Steffen Klassert
2024-09-09 13:21 ` [PATCH 0/11] pull request (net-next): ipsec-next 2024-09-09 Steffen Klassert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240909100328.1838963-2-steffen.klassert@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).