Commit fc1a8db3 authored by David S. Miller's avatar David S. Miller

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next

Steffen Klassert says:

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

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.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 8cf5d8cc 4ac7a6ee
...@@ -285,7 +285,7 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_ ...@@ -285,7 +285,7 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_
esp.esph = ip_esp_hdr(skb); 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); esp.nfrags = esp_output_head(x, skb, &esp);
if (esp.nfrags < 0) if (esp.nfrags < 0)
return esp.nfrags; return esp.nfrags;
......
...@@ -788,7 +788,7 @@ int esp6_input_done2(struct sk_buff *skb, int err) ...@@ -788,7 +788,7 @@ int esp6_input_done2(struct sk_buff *skb, int err)
int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
int hdr_len = skb_network_header_len(skb); 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); kfree(ESP_SKB_CB(skb)->tmp);
if (unlikely(err)) if (unlikely(err))
......
...@@ -296,7 +296,8 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) ...@@ -296,7 +296,8 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
} }
mtu = dst_mtu(dst); 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); skb_dst_update_pmtu_no_confirm(skb, mtu);
if (skb->protocol == htons(ETH_P_IPV6)) { if (skb->protocol == htons(ETH_P_IPV6)) {
...@@ -564,6 +565,11 @@ static void xfrmi_dev_setup(struct net_device *dev) ...@@ -564,6 +565,11 @@ static void xfrmi_dev_setup(struct net_device *dev)
eth_broadcast_addr(dev->broadcast); 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) static int xfrmi_dev_init(struct net_device *dev)
{ {
struct xfrm_if *xi = netdev_priv(dev); struct xfrm_if *xi = netdev_priv(dev);
...@@ -581,6 +587,8 @@ static int xfrmi_dev_init(struct net_device *dev) ...@@ -581,6 +587,8 @@ static int xfrmi_dev_init(struct net_device *dev)
} }
dev->features |= NETIF_F_LLTX; dev->features |= NETIF_F_LLTX;
dev->features |= XFRMI_FEATURES;
dev->hw_features |= XFRMI_FEATURES;
if (phydev) { if (phydev) {
dev->needed_headroom = phydev->needed_headroom; dev->needed_headroom = phydev->needed_headroom;
......
...@@ -2504,7 +2504,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, ...@@ -2504,7 +2504,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
encap = kmemdup(nla_data(attrs[XFRMA_ENCAP]), encap = kmemdup(nla_data(attrs[XFRMA_ENCAP]),
sizeof(*encap), GFP_KERNEL); sizeof(*encap), GFP_KERNEL);
if (!encap) if (!encap)
return 0; return -ENOMEM;
} }
err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap); err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment