From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 1F7C231FC for ; Tue, 29 May 2018 09:34:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 00:34:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,455,1520924400"; d="scan'208";a="45001540" Received: from dpdk15.sh.intel.com ([10.67.111.77]) by orsmga008.jf.intel.com with ESMTP; 29 May 2018 00:34:04 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: konstantin.ananyev@intel.com, Jiayu Hu Date: Tue, 29 May 2018 15:41:09 +0800 Message-Id: <1527579670-91026-3-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527579670-91026-1-git-send-email-jiayu.hu@intel.com> References: <1527579670-91026-1-git-send-email-jiayu.hu@intel.com> Subject: [dpdk-dev] [PATCH 2/3] app/testpmd: enable UDP GSO in the checksum forwarding engine X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2018 07:34:06 -0000 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 --- app/test-pmd/cmdline.c | 5 +++-- app/test-pmd/csumonly.c | 2 ++ app/test-pmd/testpmd.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 27e2aa8..4239e91 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4792,8 +4792,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 35cf266..b5766ff 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -777,7 +777,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. */ -- 2.7.4