diff mbox series

[RFC,ipsec-next] xfrm: interface: enable TSO on xfrm interfaces

Message ID 20201223071538.3573783-1-eyal.birger@gmail.com
State Superseded
Headers show
Series [RFC,ipsec-next] xfrm: interface: enable TSO on xfrm interfaces | expand

Commit Message

Eyal Birger Dec. 23, 2020, 7:15 a.m. UTC
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>
---
 net/xfrm/xfrm_interface.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Steffen Klassert Jan. 4, 2021, 8:44 a.m. UTC | #1
On Wed, Dec 23, 2020 at 09:15:38AM +0200, Eyal Birger wrote:
> 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>


Looks ok to me.
Eyal Birger Jan. 4, 2021, 5:50 p.m. UTC | #2
Hi Steffen,

On Mon, Jan 4, 2021 at 10:44 AM Steffen Klassert
<steffen.klassert@secunet.com> wrote:
>

> On Wed, Dec 23, 2020 at 09:15:38AM +0200, Eyal Birger wrote:

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

>

> Looks ok to me.


Great, Thanks for the review.

 Should I submit a non-rfc patch once the merge window opens?

Eyal.
Steffen Klassert Jan. 5, 2021, 8:12 a.m. UTC | #3
On Mon, Jan 04, 2021 at 07:50:49PM +0200, Eyal Birger wrote:
> Hi Steffen,

> 

> On Mon, Jan 4, 2021 at 10:44 AM Steffen Klassert

> <steffen.klassert@secunet.com> wrote:

> >

> > On Wed, Dec 23, 2020 at 09:15:38AM +0200, Eyal Birger wrote:

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

> >

> > Looks ok to me.

> 

> Great, Thanks for the review.

> 

>  Should I submit a non-rfc patch once the merge window opens?


Yes, please do so.
diff mbox series

Patch

diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index 9b8e292a7c6a..d28e9f05d9dd 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)) {
@@ -579,6 +580,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);
@@ -596,6 +602,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;