diff mbox series

[net-next,4/4] xfrm: Support UDP encapsulation in packet offload mode

Message ID 051ea7f99b08e90bedb429123bf5e0a1ae0b0757.1689757619.git.leon@kernel.org (mailing list archive)
State Accepted
Commit 89edf40220be8e68922beb54a06fdfc66f743c39
Delegated to: Netdev Maintainers
Headers show
Series Support UDP encapsulation in packet offload mode | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
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: 1344 this patch: 1344
netdev/cc_maintainers warning 1 maintainers not CCed: davem@davemloft.net
netdev/build_clang success Errors and warnings before: 1365 this patch: 1365
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: 1367 this patch: 1367
netdev/checkpatch warning WARNING: line length of 91 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Leon Romanovsky July 19, 2023, 9:26 a.m. UTC
From: Leon Romanovsky <leonro@nvidia.com>

Since mlx5 supports UDP encapsulation in packet offload, change the XFRM
core to allow users to configure it.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 net/xfrm/xfrm_device.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Jakub Kicinski July 24, 2023, 10:22 p.m. UTC | #1
On Wed, 19 Jul 2023 12:26:56 +0300 Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> Since mlx5 supports UDP encapsulation in packet offload, change the XFRM
> core to allow users to configure it.
> 
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

Steffen, any opinion on this one? Would you like to take the whole series?
Steffen Klassert July 25, 2023, 2:21 a.m. UTC | #2
On Mon, Jul 24, 2023 at 03:22:56PM -0700, Jakub Kicinski wrote:
> On Wed, 19 Jul 2023 12:26:56 +0300 Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@nvidia.com>
> > 
> > Since mlx5 supports UDP encapsulation in packet offload, change the XFRM
> > core to allow users to configure it.
> > 
> > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> 
> Steffen, any opinion on this one? Would you like to take the whole series?

The xfrm changes are quite trivial compared to the driver changes.
So it will likely create less conflicts if you take it directly.

In case you want to do that:

Acked-by: Steffen Klassert <steffen.klassert@secunet.com>

Otherwise I can take it of course.
Paolo Abeni July 25, 2023, 1:14 p.m. UTC | #3
On Tue, 2023-07-25 at 04:21 +0200, Steffen Klassert wrote:
> On Mon, Jul 24, 2023 at 03:22:56PM -0700, Jakub Kicinski wrote:
> > On Wed, 19 Jul 2023 12:26:56 +0300 Leon Romanovsky wrote:
> > > From: Leon Romanovsky <leonro@nvidia.com>
> > > 
> > > Since mlx5 supports UDP encapsulation in packet offload, change the XFRM
> > > core to allow users to configure it.
> > > 
> > > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> > 
> > Steffen, any opinion on this one? Would you like to take the whole series?
> 
> The xfrm changes are quite trivial compared to the driver changes.
> So it will likely create less conflicts if you take it directly.
> 
> In case you want to do that:
> 
> Acked-by: Steffen Klassert <steffen.klassert@secunet.com>

Sounds good to me! I'm reviving the series in PW and applying it.

Thanks,

Paolo
Leon Romanovsky July 25, 2023, 1:16 p.m. UTC | #4
On Tue, Jul 25, 2023 at 03:14:51PM +0200, Paolo Abeni wrote:
> On Tue, 2023-07-25 at 04:21 +0200, Steffen Klassert wrote:
> > On Mon, Jul 24, 2023 at 03:22:56PM -0700, Jakub Kicinski wrote:
> > > On Wed, 19 Jul 2023 12:26:56 +0300 Leon Romanovsky wrote:
> > > > From: Leon Romanovsky <leonro@nvidia.com>
> > > > 
> > > > Since mlx5 supports UDP encapsulation in packet offload, change the XFRM
> > > > core to allow users to configure it.
> > > > 
> > > > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> > > 
> > > Steffen, any opinion on this one? Would you like to take the whole series?
> > 
> > The xfrm changes are quite trivial compared to the driver changes.
> > So it will likely create less conflicts if you take it directly.
> > 
> > In case you want to do that:
> > 
> > Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
> 
> Sounds good to me! I'm reviving the series in PW and applying it.

Thanks a lot.

> 
> Thanks,
> 
> Paolo
>
diff mbox series

Patch

diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 533697e2488f..3784534c9185 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -247,12 +247,6 @@  int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
 		return -EINVAL;
 	}
 
-	/* We don't yet support UDP encapsulation and TFC padding. */
-	if (x->encap || x->tfcpad) {
-		NL_SET_ERR_MSG(extack, "Encapsulation and TFC padding can't be offloaded");
-		return -EINVAL;
-	}
-
 	if (xuo->flags &
 	    ~(XFRM_OFFLOAD_IPV6 | XFRM_OFFLOAD_INBOUND | XFRM_OFFLOAD_PACKET)) {
 		NL_SET_ERR_MSG(extack, "Unrecognized flags in offload request");
@@ -260,6 +254,13 @@  int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
 	}
 
 	is_packet_offload = xuo->flags & XFRM_OFFLOAD_PACKET;
+
+	/* We don't yet support UDP encapsulation and TFC padding. */
+	if ((!is_packet_offload && x->encap) || x->tfcpad) {
+		NL_SET_ERR_MSG(extack, "Encapsulation and TFC padding can't be offloaded");
+		return -EINVAL;
+	}
+
 	dev = dev_get_by_index(net, xuo->ifindex);
 	if (!dev) {
 		if (!(xuo->flags & XFRM_OFFLOAD_INBOUND)) {