netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfrm: support output_mark for offload ESP packets
@ 2020-01-14 13:29 Ulrich Weber
  2020-01-15  9:53 ` Steffen Klassert
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weber @ 2020-01-14 13:29 UTC (permalink / raw)
  To: steffen.klassert; +Cc: netdev, Ulrich Weber

Commit 9b42c1f179a6 ("xfrm: Extend the output_mark") added output_mark
support but missed ESP offload support.

xfrm_smark_get() is not called within xfrm_input() for packets coming
from esp4_gro_receive() or esp6_gro_receive(). Therefore call
xfrm_smark_get() directly within these functions.

Signed-off-by: Ulrich Weber <ulrich.weber@gmail.com>
---
 net/ipv4/esp4_offload.c | 2 ++
 net/ipv6/esp6_offload.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 0e4a7cf6bc87..e2e219c7854a 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -57,6 +57,8 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
 		if (!x)
 			goto out_reset;
 
+		skb->mark = xfrm_smark_get(skb->mark, x);
+
 		sp->xvec[sp->len++] = x;
 		sp->olen++;
 
diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index e31626ffccd1..fd535053245b 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -79,6 +79,8 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
 		if (!x)
 			goto out_reset;
 
+		skb->mark = xfrm_smark_get(skb->mark, x);
+
 		sp->xvec[sp->len++] = x;
 		sp->olen++;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfrm: support output_mark for offload ESP packets
  2020-01-14 13:29 [PATCH] xfrm: support output_mark for offload ESP packets Ulrich Weber
@ 2020-01-15  9:53 ` Steffen Klassert
  2020-01-15 11:11   ` [PATCH v2] " Ulrich Weber
  0 siblings, 1 reply; 4+ messages in thread
From: Steffen Klassert @ 2020-01-15  9:53 UTC (permalink / raw)
  To: Ulrich Weber; +Cc: netdev

On Tue, Jan 14, 2020 at 02:29:54PM +0100, Ulrich Weber wrote:
> Commit 9b42c1f179a6 ("xfrm: Extend the output_mark") added output_mark
> support but missed ESP offload support.
> 
> xfrm_smark_get() is not called within xfrm_input() for packets coming
> from esp4_gro_receive() or esp6_gro_receive(). Therefore call
> xfrm_smark_get() directly within these functions.
> 
> Signed-off-by: Ulrich Weber <ulrich.weber@gmail.com>

Can you please add a 'Fixes' tag, so that it can be properly backported
to the -stable trees.

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] xfrm: support output_mark for offload ESP packets
  2020-01-15  9:53 ` Steffen Klassert
@ 2020-01-15 11:11   ` Ulrich Weber
  2020-01-16 13:00     ` Steffen Klassert
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weber @ 2020-01-15 11:11 UTC (permalink / raw)
  To: steffen.klassert; +Cc: netdev

Commit 9b42c1f179a6 ("xfrm: Extend the output_mark") added output_mark
support but missed ESP offload support.

xfrm_smark_get() is not called within xfrm_input() for packets coming
from esp4_gro_receive() or esp6_gro_receive(). Therefore call
xfrm_smark_get() directly within these functions.

Fixes: 9b42c1f179a6 ("xfrm: Extend the output_mark to support input direction and masking.")
Signed-off-by: Ulrich Weber <ulrich.weber@gmail.com>
---
 net/ipv4/esp4_offload.c | 2 ++
 net/ipv6/esp6_offload.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 0e4a7cf6bc87..e2e219c7854a 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -57,6 +57,8 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
 		if (!x)
 			goto out_reset;
 
+		skb->mark = xfrm_smark_get(skb->mark, x);
+
 		sp->xvec[sp->len++] = x;
 		sp->olen++;
 
diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index e31626ffccd1..fd535053245b 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -79,6 +79,8 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
 		if (!x)
 			goto out_reset;
 
+		skb->mark = xfrm_smark_get(skb->mark, x);
+
 		sp->xvec[sp->len++] = x;
 		sp->olen++;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] xfrm: support output_mark for offload ESP packets
  2020-01-15 11:11   ` [PATCH v2] " Ulrich Weber
@ 2020-01-16 13:00     ` Steffen Klassert
  0 siblings, 0 replies; 4+ messages in thread
From: Steffen Klassert @ 2020-01-16 13:00 UTC (permalink / raw)
  To: Ulrich Weber; +Cc: netdev

On Wed, Jan 15, 2020 at 12:11:29PM +0100, Ulrich Weber wrote:
> Commit 9b42c1f179a6 ("xfrm: Extend the output_mark") added output_mark
> support but missed ESP offload support.
> 
> xfrm_smark_get() is not called within xfrm_input() for packets coming
> from esp4_gro_receive() or esp6_gro_receive(). Therefore call
> xfrm_smark_get() directly within these functions.
> 
> Fixes: 9b42c1f179a6 ("xfrm: Extend the output_mark to support input direction and masking.")
> Signed-off-by: Ulrich Weber <ulrich.weber@gmail.com>

Applied, thanks Ulrich!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-16 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-14 13:29 [PATCH] xfrm: support output_mark for offload ESP packets Ulrich Weber
2020-01-15  9:53 ` Steffen Klassert
2020-01-15 11:11   ` [PATCH v2] " Ulrich Weber
2020-01-16 13:00     ` Steffen Klassert

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