Skip to content

Commit a695641

Browse files
xli98kuba-moo
authored andcommitted
gve: Support IPv6 Big TCP on DQ
Add support for using IPv6 Big TCP on DQ which can handle large TSO/GRO packets. See https://lwn.net/Articles/895398/. This can improve the throughput and CPU usage. Perf test result: ip -d link show $DEV gso_max_size 185000 gso_max_segs 65535 tso_max_size 262143 tso_max_segs 65535 gro_max_size 185000 For performance, tested with neper using 9k MTU on hardware that supports 200Gb/s line rate. In single streams when line rate is not saturated, we expect throughput improvements. When the networking is performing at line rate, we expect cpu usage improvements. Tcp_stream (unidirectional stream test, T=thread, F=flow): skb=180kb, T=1, F=1, no zerocopy: throughput average=64576.88 Mb/s, sender stime=8.3, receiver stime=10.68 skb=64kb, T=1, F=1, no zerocopy: throughput average=64862.54 Mb/s, sender stime=9.96, receiver stime=12.67 skb=180kb, T=1, F=1, yes zerocopy: throughput average=146604.97 Mb/s, sender stime=10.61, receiver stime=5.52 skb=64kb, T=1, F=1, yes zerocopy: throughput average=131357.78 Mb/s, sender stime=12.11, receiver stime=12.25 skb=180kb, T=20, F=100, no zerocopy: throughput average=182411.37 Mb/s, sender stime=41.62, receiver stime=79.4 skb=64kb, T=20, F=100, no zerocopy: throughput average=182892.02 Mb/s, sender stime=57.39, receiver stime=72.69 skb=180kb, T=20, F=100, yes zerocopy: throughput average=182337.65 Mb/s, sender stime=27.94, receiver stime=39.7 skb=64kb, T=20, F=100, yes zerocopy: throughput average=182144.20 Mb/s, sender stime=47.06, receiver stime=39.01 Signed-off-by: Ziwei Xiao <ziweixiao@google.com> Signed-off-by: Coco Li <lixiaoyan@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20230522201552.3585421-1-ziweixiao@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 51c78a4 commit a695641

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
// Minimum amount of time between queue kicks in msec (10 seconds)
3333
#define MIN_TX_TIMEOUT_GAP (1000 * 10)
34+
#define DQO_TX_MAX 0x3FFFF
3435

3536
const char gve_version_str[] = GVE_VERSION;
3637
static const char gve_version_prefix[] = GVE_VERSION_PREFIX;
@@ -2047,6 +2048,10 @@ static int gve_init_priv(struct gve_priv *priv, bool skip_describe_device)
20472048
goto err;
20482049
}
20492050

2051+
/* Big TCP is only supported on DQ*/
2052+
if (!gve_is_gqi(priv))
2053+
netif_set_tso_max_size(priv->dev, DQO_TX_MAX);
2054+
20502055
priv->num_registered_pages = 0;
20512056
priv->rx_copybreak = GVE_DEFAULT_RX_COPYBREAK;
20522057
/* gvnic has one Notification Block per MSI-x vector, except for the

drivers/net/ethernet/google/gve/gve_tx_dqo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "gve_adminq.h"
99
#include "gve_utils.h"
1010
#include "gve_dqo.h"
11+
#include <net/ip.h>
1112
#include <linux/tcp.h>
1213
#include <linux/slab.h>
1314
#include <linux/skbuff.h>
@@ -646,6 +647,9 @@ static int gve_try_tx_skb(struct gve_priv *priv, struct gve_tx_ring *tx,
646647
goto drop;
647648
}
648649

650+
if (unlikely(ipv6_hopopt_jumbo_remove(skb)))
651+
goto drop;
652+
649653
num_buffer_descs = gve_num_buffer_descs_needed(skb);
650654
} else {
651655
num_buffer_descs = gve_num_buffer_descs_needed(skb);

0 commit comments

Comments
 (0)