netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] gso: enable udp gso for virtual devices
@ 2019-06-12 23:12 Jason Baron
  2019-06-13 17:15 ` Alexander Duyck
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Baron @ 2019-06-12 23:12 UTC (permalink / raw)
  To: davem; +Cc: netdev, Joshua Hunt, Alexander Duyck, Willem de Bruijn, Paolo Abeni

Now that the stack supports UDP GRO, we can enable udp gso for virtual
devices. If packets are looped back locally, and UDP GRO is not enabled
then they will be segmented to gso_size via udp_rcv_segment(). This
essentiallly just reverts: 8eea1ca gso: limit udp gso to egress-only
virtual devices.

Tested by connecting two namespaces via macvlan and then ran
udpgso_bench_tx:

before:
udp tx:   2068 MB/s    35085 calls/s  35085 msg/s

after (no UDP_GRO):
udp tx:   3438 MB/s    58319 calls/s  58319 msg/s

after (UDP_GRO):
udp tx:   8037 MB/s   136314 calls/s 136314 msg/s

Signed-off-by: Jason Baron <jbaron@akamai.com>
Co-developed-by: Joshua Hunt <johunt@akamai.com>
Signed-off-by: Joshua Hunt <johunt@akamai.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
---
 drivers/net/bonding/bond_main.c | 5 ++---
 drivers/net/team/team.c         | 5 ++---
 include/linux/netdev_features.h | 1 +
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4f5b3ba..c4260be 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1120,8 +1120,7 @@ static void bond_compute_features(struct bonding *bond)
 
 done:
 	bond_dev->vlan_features = vlan_features;
-	bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
-				    NETIF_F_GSO_UDP_L4;
+	bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
 	bond_dev->mpls_features = mpls_features;
 	bond_dev->gso_max_segs = gso_max_segs;
 	netif_set_gso_max_size(bond_dev, gso_max_size);
@@ -4308,7 +4307,7 @@ void bond_setup(struct net_device *bond_dev)
 				NETIF_F_HW_VLAN_CTAG_RX |
 				NETIF_F_HW_VLAN_CTAG_FILTER;
 
-	bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4;
+	bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
 	bond_dev->features |= bond_dev->hw_features;
 }
 
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index b48006e..30299e3 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1003,8 +1003,7 @@ static void __team_compute_features(struct team *team)
 	}
 
 	team->dev->vlan_features = vlan_features;
-	team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
-				     NETIF_F_GSO_UDP_L4;
+	team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
 	team->dev->hard_header_len = max_hard_header_len;
 
 	team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
@@ -2132,7 +2131,7 @@ static void team_setup(struct net_device *dev)
 			   NETIF_F_HW_VLAN_CTAG_RX |
 			   NETIF_F_HW_VLAN_CTAG_FILTER;
 
-	dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4;
+	dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
 	dev->features |= dev->hw_features;
 }
 
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 4b19c54..188127c 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -237,6 +237,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)
 				 NETIF_F_GSO_GRE_CSUM |			\
 				 NETIF_F_GSO_IPXIP4 |			\
 				 NETIF_F_GSO_IPXIP6 |			\
+				 NETIF_F_GSO_UDP_L4 |			\
 				 NETIF_F_GSO_UDP_TUNNEL |		\
 				 NETIF_F_GSO_UDP_TUNNEL_CSUM)
 
-- 
2.7.4


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

end of thread, other threads:[~2019-08-09 19:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 23:12 [PATCH net-next] gso: enable udp gso for virtual devices Jason Baron
2019-06-13 17:15 ` Alexander Duyck
2019-06-13 19:03   ` Jason Baron
2019-06-13 21:20     ` Willem de Bruijn
2019-06-14 20:53       ` Jason Baron
2019-06-26 19:15         ` Jason Baron
2019-06-26 23:41           ` Willem de Bruijn
2019-08-09 18:58             ` Josh Hunt
2019-08-09 19:13               ` Willem de Bruijn

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