Skip to contentSkip to conversation

pull request (net-next): ipsec-next 2021-02-09

PATCH Applied Steffen Klassert 2 participants 7 messages Feb 9, 2021

Subsystems (3)
lore
Share & tools
lore

Steffen Klassert

author maintainer
#0 lore raw

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(-)
author maintainer
#1 lore raw

PATCH 1/4 xfrm: interface: enable TSO on xfrm interfaces

From: Eyal Birger <[email protected]>

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

---
 net/xfrm/xfrm_interface.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
net/xfrm/xfrm_interface.c +9 -1
index 697cdcfbb5e1..495b1f5c979b 100644
@@ -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;
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/4] xfrm: interface: enable TSO on xfrm interfaces

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

Hello:

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

Quoted 10 lines · On Tue, 9 Feb 2021 10:43:02 +0100 you wrote:

From: Eyal Birger <[email protected]>

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

[...]

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

author maintainer
#3 lore raw

PATCH 2/4 net: Simplify the calculation of variables

In reply to Steffen Klassert

From: Jiapeng Zhong <[email protected]>

Fix the following coccicheck warnings:

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

---
 net/ipv4/esp4_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/esp4_offload.c +1 -1
index 5bda5aeda579..601f5fbfc63f 100644
@@ -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;
Signature · 1 line
2.25.1
author maintainer
#4 lore raw

PATCH 3/4 esp: Simplify the calculation of variables

In reply to Steffen Klassert

From: Jiapeng Chong <[email protected]>

Fix the following coccicheck warnings:

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

---
 net/ipv6/esp6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/esp6.c +1 -1
index 52c2f063529f..53eb76b1e708 100644
@@ -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))
Signature · 1 line
2.25.1
author maintainer
#5 lore raw

PATCH 4/4 xfrm: Return the correct errno code

In reply to Steffen Klassert

From: Zheng Yongjun <[email protected]>

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

---
 net/xfrm/xfrm_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/xfrm/xfrm_user.c +1 -1
index 0727ac853b55..5a0ef4361e43 100644
@@ -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);
Signature · 1 line
2.25.1
#6 lore raw
In reply to Steffen Klassert
This pull request was applied to netdev/net-next.git (refs/heads/master):

Hello:

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

Quoted 10 lines · 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