From patchwork Fri Jul 6 01:02:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hu, Jiayu" X-Patchwork-Id: 42446 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6338B1BE4C; Fri, 6 Jul 2018 02:54:33 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id BE3171BE0F for ; Fri, 6 Jul 2018 02:54:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2018 17:54:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,314,1526367600"; d="scan'208";a="213788574" Received: from dpdk15.sh.intel.com ([10.67.111.146]) by orsmga004.jf.intel.com with ESMTP; 05 Jul 2018 17:54:28 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: thomas@monjalon.net, Jiayu Hu Date: Fri, 6 Jul 2018 09:02:23 +0800 Message-Id: <1530838944-51791-3-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530838944-51791-1-git-send-email-jiayu.hu@intel.com> References: <1529646843-45903-1-git-send-email-jiayu.hu@intel.com> <1530838944-51791-1-git-send-email-jiayu.hu@intel.com> Subject: [dpdk-dev] [PATCH v4 2/3] app/testpmd: enable UDP GSO in csum 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Xiao Wang Acked-by: Bernard Iremonger Tested-by: Yuwei Zhang --- 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 24c1998..fa9208d 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. */ From patchwork Fri Jul 6 01:02:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hu, Jiayu" X-Patchwork-Id: 42447 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19B431BE93; Fri, 6 Jul 2018 02:54:35 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 522791BE1E for ; Fri, 6 Jul 2018 02:54:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2018 17:54:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,314,1526367600"; d="scan'208";a="213788580" Received: from dpdk15.sh.intel.com ([10.67.111.146]) by orsmga004.jf.intel.com with ESMTP; 05 Jul 2018 17:54:29 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: thomas@monjalon.net, Jiayu Hu Date: Fri, 6 Jul 2018 09:02:24 +0800 Message-Id: <1530838944-51791-4-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530838944-51791-1-git-send-email-jiayu.hu@intel.com> References: <1529646843-45903-1-git-send-email-jiayu.hu@intel.com> <1530838944-51791-1-git-send-email-jiayu.hu@intel.com> Subject: [dpdk-dev] [PATCH v4 3/3] gso: update documents for UDP/IPv4 GSO 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch updates the programmer guide and testpmd user guide for UDP/IPv4 GSO. Signed-off-by: Jiayu Hu Acked-by: Xiao Wang --- doc/guides/prog_guide/generic_segmentation_offload_lib.rst | 10 ++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/doc/guides/prog_guide/generic_segmentation_offload_lib.rst b/doc/guides/prog_guide/generic_segmentation_offload_lib.rst index 9959f0d..0cfc119 100644 --- a/doc/guides/prog_guide/generic_segmentation_offload_lib.rst +++ b/doc/guides/prog_guide/generic_segmentation_offload_lib.rst @@ -43,6 +43,7 @@ Limitations #. Currently, the GSO library supports the following IPv4 packet types: - TCP + - UDP - VxLAN - GRE @@ -146,6 +147,15 @@ TCP/IPv4 GSO TCP/IPv4 GSO supports segmentation of suitably large TCP/IPv4 packets, which may also contain an optional VLAN tag. +UDP/IPv4 GSO +~~~~~~~~~~~~ +UDP/IPv4 GSO supports segmentation of suitably large UDP/IPv4 packets, which +may also contain an optional VLAN tag. UDP GSO is the same as IP fragmentation. +Specifically, UDP GSO treats the UDP header as a part of the payload and +does not modify it during segmentation. Therefore, after UDP GSO, only the +first output packet has the original UDP header, and others just have l2 +and l3 headers. + VxLAN GSO ~~~~~~~~~ VxLAN packets GSO supports segmentation of suitably large VxLAN packets, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 0d6fd50..6f2de24 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1059,6 +1059,13 @@ By default, GSO is disabled for all ports. testpmd> csum set tcp hw + UDP GSO is the same as IP fragmentation, which treats the UDP header + as the payload and does not modify it during segmentation. That is, + after UDP GSO, only the first output fragment has the original UDP + header. Therefore, users need to enable HW IP checksum calculation + and SW UDP checksum calculation for GSO-enabled ports, if they want + correct checksums for UDP/IPv4 packets. + set gso segsz ~~~~~~~~~~~~~