summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiayu Hu <jiayu.hu@intel.com>2018-07-06 09:02:23 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-07-11 23:49:37 +0200
commitaaacd052cea499e146dbd12f92e7027ec07d505d (patch)
tree63fffe6e792c7c3d542454d62a1482432e7ca44a
parentb166d4f30b667b054bdd8bd1cbf30610061f8cc0 (diff)
downloaddpdk-aaacd052cea499e146dbd12f92e7027ec07d505d.zip
dpdk-aaacd052cea499e146dbd12f92e7027ec07d505d.tar.gz
dpdk-aaacd052cea499e146dbd12f92e7027ec07d505d.tar.xz
app/testpmd: enable UDP GSO in csum engine
This patch enables GSO for UDP/IPv4 packets. Oversized UDP/IPv4 packets transmitted over a GSO-enabled port will undergo segmentation. Signed-off-by: Jiayu Hu <jiayu.hu@intel.com> Acked-by: Xiao Wang <xiao.w.wang@intel.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com> Tested-by: Yuwei Zhang <yuwei1.zhang@intel.com>
-rw-r--r--app/test-pmd/cmdline.c5
-rw-r--r--app/test-pmd/csumonly.c2
-rw-r--r--app/test-pmd/testpmd.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 74a8cd9..15d35da 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -4802,8 +4802,9 @@ cmd_gso_show_parsed(void *parsed_result,
if (gso_ports[res->cmd_pid].enable) {
printf("Max GSO'd packet size: %uB\n"
"Supported GSO types: TCP/IPv4, "
- "VxLAN with inner TCP/IPv4 packet, "
- "GRE with inner TCP/IPv4 packet\n",
+ "UDP/IPv4, VxLAN with inner "
+ "TCP/IPv4 packet, GRE with inner "
+ "TCP/IPv4 packet\n",
gso_max_segment_size);
} else
printf("GSO is not enabled on Port %u\n", res->cmd_pid);
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 0bb88cf..4948292 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -411,6 +411,8 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
info->ethertype);
}
}
+ if (info->gso_enable)
+ ol_flags |= PKT_TX_UDP_SEG;
} else if (info->l4_proto == IPPROTO_TCP) {
tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + info->l3_len);
tcp_hdr->cksum = 0;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index dde7d43..31e9f95 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -776,7 +776,7 @@ init_config(void)
init_port_config();
gso_types = DEV_TX_OFFLOAD_TCP_TSO | DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
- DEV_TX_OFFLOAD_GRE_TNL_TSO;
+ DEV_TX_OFFLOAD_GRE_TNL_TSO | DEV_TX_OFFLOAD_UDP_TSO;
/*
* Records which Mbuf pool to use by each logical core, if needed.
*/