netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull request (net-next): ipsec-next 2021-02-09
@ 2021-02-09  9:43 Steffen Klassert
  2021-02-09  9:43 ` [PATCH 1/4] xfrm: interface: enable TSO on xfrm interfaces Steffen Klassert
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Steffen Klassert @ 2021-02-09  9:43 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

1) Support TSO on xfrm interfaces.
   From Eyal Birger.

2) Variable calculation simplifications in esp4/esp6.
   From Jiapeng Chong / Jiapeng Zhong.

3) Fix a return code in xfrm_do_migrate.
   From Zheng Yongjun.

Please pull or let me know if there are problems.

Thanks!

The following changes since commit ede71cae72855f8d6f6268510895210adc317666:

  net-next: docs: Fix typos in snmp_counter.rst (2021-01-05 17:07:38 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master

for you to fetch changes up to 4ac7a6eecbec90c7f83d5ea6f0498d9fa9c62917:

  xfrm: Return the correct errno code (2021-02-04 09:29:27 +0100)

----------------------------------------------------------------
Eyal Birger (1):
      xfrm: interface: enable TSO on xfrm interfaces

Jiapeng Chong (1):
      esp: Simplify the calculation of variables

Jiapeng Zhong (1):
      net: Simplify the calculation of variables

Zheng Yongjun (1):
      xfrm: Return the correct errno code

 net/ipv4/esp4_offload.c   |  2 +-
 net/ipv6/esp6.c           |  2 +-
 net/xfrm/xfrm_interface.c | 10 +++++++++-
 net/xfrm/xfrm_user.c      |  2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

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

* [PATCH 1/4] xfrm: interface: enable TSO on xfrm interfaces
  2021-02-09  9:43 pull request (net-next): ipsec-next 2021-02-09 Steffen Klassert
@ 2021-02-09  9:43 ` Steffen Klassert
  2021-02-09 19:40   ` patchwork-bot+netdevbpf
  2021-02-09  9:43 ` [PATCH 2/4] net: Simplify the calculation of variables Steffen Klassert
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Steffen Klassert @ 2021-02-09  9:43 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: Eyal Birger <eyal.birger@gmail.com>

Underlying xfrm output supports gso packets.
Declare support in hw_features and adapt the xmit MTU check to pass GSO
packets.

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_interface.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index 697cdcfbb5e1..495b1f5c979b 100644
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -296,7 +296,8 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
 	}
 
 	mtu = dst_mtu(dst);
-	if (skb->len > mtu) {
+	if ((!skb_is_gso(skb) && skb->len > mtu) ||
+	    (skb_is_gso(skb) && !skb_gso_validate_network_len(skb, mtu))) {
 		skb_dst_update_pmtu_no_confirm(skb, mtu);
 
 		if (skb->protocol == htons(ETH_P_IPV6)) {
@@ -564,6 +565,11 @@ static void xfrmi_dev_setup(struct net_device *dev)
 	eth_broadcast_addr(dev->broadcast);
 }
 
+#define XFRMI_FEATURES (NETIF_F_SG |		\
+			NETIF_F_FRAGLIST |	\
+			NETIF_F_GSO_SOFTWARE |	\
+			NETIF_F_HW_CSUM)
+
 static int xfrmi_dev_init(struct net_device *dev)
 {
 	struct xfrm_if *xi = netdev_priv(dev);
@@ -581,6 +587,8 @@ static int xfrmi_dev_init(struct net_device *dev)
 	}
 
 	dev->features |= NETIF_F_LLTX;
+	dev->features |= XFRMI_FEATURES;
+	dev->hw_features |= XFRMI_FEATURES;
 
 	if (phydev) {
 		dev->needed_headroom = phydev->needed_headroom;
-- 
2.25.1


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

* [PATCH 2/4] net: Simplify the calculation of variables
  2021-02-09  9:43 pull request (net-next): ipsec-next 2021-02-09 Steffen Klassert
  2021-02-09  9:43 ` [PATCH 1/4] xfrm: interface: enable TSO on xfrm interfaces Steffen Klassert
@ 2021-02-09  9:43 ` Steffen Klassert
  2021-02-09  9:43 ` [PATCH 3/4] esp: " Steffen Klassert
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Steffen Klassert @ 2021-02-09  9:43 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>

Fix the following coccicheck warnings:

 ./net/ipv4/esp4_offload.c:288:32-34: WARNING !A || A && B is
equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv4/esp4_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 5bda5aeda579..601f5fbfc63f 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -285,7 +285,7 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb,  netdev_features_
 	esp.esph = ip_esp_hdr(skb);
 
 
-	if (!hw_offload || (hw_offload && !skb_is_gso(skb))) {
+	if (!hw_offload || !skb_is_gso(skb)) {
 		esp.nfrags = esp_output_head(x, skb, &esp);
 		if (esp.nfrags < 0)
 			return esp.nfrags;
-- 
2.25.1


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

* [PATCH 3/4] esp: Simplify the calculation of variables
  2021-02-09  9:43 pull request (net-next): ipsec-next 2021-02-09 Steffen Klassert
  2021-02-09  9:43 ` [PATCH 1/4] xfrm: interface: enable TSO on xfrm interfaces Steffen Klassert
  2021-02-09  9:43 ` [PATCH 2/4] net: Simplify the calculation of variables Steffen Klassert
@ 2021-02-09  9:43 ` Steffen Klassert
  2021-02-09  9:43 ` [PATCH 4/4] xfrm: Return the correct errno code Steffen Klassert
  2021-02-09 19:40 ` pull request (net-next): ipsec-next 2021-02-09 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 7+ messages in thread
From: Steffen Klassert @ 2021-02-09  9:43 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Fix the following coccicheck warnings:

./net/ipv6/esp6.c:791:16-18: WARNING !A || A && B is equivalent
to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/esp6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 52c2f063529f..53eb76b1e708 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -793,7 +793,7 @@ int esp6_input_done2(struct sk_buff *skb, int err)
 	int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
 	int hdr_len = skb_network_header_len(skb);
 
-	if (!xo || (xo && !(xo->flags & CRYPTO_DONE)))
+	if (!xo || !(xo->flags & CRYPTO_DONE))
 		kfree(ESP_SKB_CB(skb)->tmp);
 
 	if (unlikely(err))
-- 
2.25.1


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

* [PATCH 4/4] xfrm: Return the correct errno code
  2021-02-09  9:43 pull request (net-next): ipsec-next 2021-02-09 Steffen Klassert
                   ` (2 preceding siblings ...)
  2021-02-09  9:43 ` [PATCH 3/4] esp: " Steffen Klassert
@ 2021-02-09  9:43 ` Steffen Klassert
  2021-02-09 19:40 ` pull request (net-next): ipsec-next 2021-02-09 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 7+ messages in thread
From: Steffen Klassert @ 2021-02-09  9:43 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: Zheng Yongjun <zhengyongjun3@huawei.com>

When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 0727ac853b55..5a0ef4361e43 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2504,7 +2504,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
 		encap = kmemdup(nla_data(attrs[XFRMA_ENCAP]),
 				sizeof(*encap), GFP_KERNEL);
 		if (!encap)
-			return 0;
+			return -ENOMEM;
 	}
 
 	err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap);
-- 
2.25.1


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

* Re: pull request (net-next): ipsec-next 2021-02-09
  2021-02-09  9:43 pull request (net-next): ipsec-next 2021-02-09 Steffen Klassert
                   ` (3 preceding siblings ...)
  2021-02-09  9:43 ` [PATCH 4/4] xfrm: Return the correct errno code Steffen Klassert
@ 2021-02-09 19:40 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-09 19:40 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: davem, kuba, herbert, netdev

Hello:

This pull request was applied to netdev/net-next.git (refs/heads/master):

On Tue, 9 Feb 2021 10:43:01 +0100 you wrote:
> 1) Support TSO on xfrm interfaces.
>    From Eyal Birger.
> 
> 2) Variable calculation simplifications in esp4/esp6.
>    From Jiapeng Chong / Jiapeng Zhong.
> 
> 3) Fix a return code in xfrm_do_migrate.
>    From Zheng Yongjun.
> 
> [...]

Here is the summary with links:
  - pull request (net-next): ipsec-next 2021-02-09
    https://git.kernel.org/netdev/net-next/c/fc1a8db3d560

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH 1/4] xfrm: interface: enable TSO on xfrm interfaces
  2021-02-09  9:43 ` [PATCH 1/4] xfrm: interface: enable TSO on xfrm interfaces Steffen Klassert
@ 2021-02-09 19:40   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-09 19:40 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: davem, kuba, herbert, netdev

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Tue, 9 Feb 2021 10:43:02 +0100 you wrote:
> From: Eyal Birger <eyal.birger@gmail.com>
> 
> Underlying xfrm output supports gso packets.
> Declare support in hw_features and adapt the xmit MTU check to pass GSO
> packets.
> 
> Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> 
> [...]

Here is the summary with links:
  - [1/4] xfrm: interface: enable TSO on xfrm interfaces
    https://git.kernel.org/netdev/net-next/c/18f976960bca
  - [2/4] net: Simplify the calculation of variables
    https://git.kernel.org/netdev/net-next/c/0c87b1ac6045
  - [3/4] esp: Simplify the calculation of variables
    https://git.kernel.org/netdev/net-next/c/bf3da527bbc9
  - [4/4] xfrm: Return the correct errno code
    https://git.kernel.org/netdev/net-next/c/4ac7a6eecbec

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-02-09 19:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  9:43 pull request (net-next): ipsec-next 2021-02-09 Steffen Klassert
2021-02-09  9:43 ` [PATCH 1/4] xfrm: interface: enable TSO on xfrm interfaces Steffen Klassert
2021-02-09 19:40   ` patchwork-bot+netdevbpf
2021-02-09  9:43 ` [PATCH 2/4] net: Simplify the calculation of variables Steffen Klassert
2021-02-09  9:43 ` [PATCH 3/4] esp: " Steffen Klassert
2021-02-09  9:43 ` [PATCH 4/4] xfrm: Return the correct errno code Steffen Klassert
2021-02-09 19:40 ` pull request (net-next): ipsec-next 2021-02-09 patchwork-bot+netdevbpf

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