From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id AB0AE1041 for ; Tue, 12 Sep 2017 04:40:51 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Sep 2017 19:40:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,381,1500966000"; d="scan'208";a="1194022467" Received: from dpdk15.sh.intel.com ([10.67.111.77]) by fmsmga001.fm.intel.com with ESMTP; 11 Sep 2017 19:40:41 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: konstantin.ananyev@intel.com, mark.b.kavanagh@intel.com, jianfeng.tan@intel.com, Jiayu Hu Date: Tue, 12 Sep 2017 10:43:26 +0800 Message-Id: <1505184211-36728-1-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504598270-60080-1-git-send-email-jiayu.hu@intel.com> References: <1504598270-60080-1-git-send-email-jiayu.hu@intel.com> Subject: [dpdk-dev] [PATCH v3 0/5] Support TCP/IPv4, VxLAN and GRE GSO in DPDK 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, 12 Sep 2017 02:40:52 -0000 Generic Segmentation Offload (GSO) is a SW technique to split large packets into small ones. Akin to TSO, GSO enables applications to operate on large packets, thus reducing per-packet processing overhead. To enable more flexibility to applications, DPDK GSO is implemented as a standalone library. Applications explicitly use the GSO library to segment packets. This patch adds GSO support to DPDK for specific packet types: specifically, TCP/IPv4, VxLAN, and GRE. The first patch introduces the GSO API framework. The second patch adds GSO support for TCP/IPv4 packets (containing an optional VLAN tag). The third patch adds GSO support for VxLAN packets that contain outer IPv4, and inner TCP/IPv4 headers (plus optional inner and/or outer VLAN tags). The fourth patch adds GSO support for GRE packets that contain outer IPv4, and inner TCP/IPv4 headers (with optional outer VLAN tag). The last patch in the series enables TCP/IPv4, VxLAN, and GRE GSO in testpmd's checksum forwarding engine. The performance of TCP/IPv4 GSO on a 10Gbps link is demonstrated using iperf. Setup for the test is described as follows: a. Connect 2 x 10Gbps physical ports (P0, P1), which are in the same machine, together physically. b. Launch testpmd with P0 and a vhost-user port, and use csum forwarding engine with "retry". c. Select IP and TCP HW checksum calculation for P0; select TCP HW checksum calculation for vhost-user port. d. Launch a VM with csum and tso offloading enabled. e. Run iperf-client on virtio-net port in the VM to send TCP packets. With enabling csum and tso, the VM can send large TCP/IPv4 packets (mss is up to 64KB). f. P1 is assigned to linux kernel and enabled kernel GRO. Run iperf-server on P1. We conduct three iperf tests: test-1: enable GSO for P0 in testpmd, and set max GSO segment length to 1518B. Run two iperf-client in the VM. test-2: enable TSO for P0 in testpmd, and set TSO segsz to 1518B. Run two iperf-client in the VM. test-3: disable GSO and TSO in testpmd. Run two iperf-client in the VM. Throughput of the above three tests: test-1: ~9Gbps test-2: 9.5Gbps test-3: 3Mbps The experimental data of VxLAN and GRE will be shown later. Change log ========== v3: - support all IPv4 header flags, including RTE_PTYPE_(INNER_)L3_IPV4, RTE_PTYPE_(INNER_)L3_IPV4_EXT and RTE_PTYPE_(INNER_)L3_IPV4_EXT_ UNKNOWN. - fill mbuf->packet_type instead of using rte_net_get_ptype() in csumonly.c, since rte_net_get_ptype() doesn't support vxlan. - store the input packet into pkts_out inside gso_tcp4_segment() and gso_tunnel_tcp4_segment() instead of rte_gso_segment(), when no GSO is performed. - add missing incldues. - optimize file names, function names and function description. - fix one bug in testpmd. v2: - merge data segments whose data_len is less than mss into a large data segment in gso_do_segment(). - use mbuf->packet_type/l2_len/l3_len etc. instead of parsing the packet header in rte_gso_segment(). - provide IP id macros for applications to select fixed or incremental IP ids. - change the defination of gso_types in struct rte_gso_ctx. - replace rte_pktmbuf_detach() with rte_pktmbuf_free(). - refactor gso_update_pkt_headers(). - change the return value of rte_gso_segment(). - remove parameter checks in rte_gso_segment(). - use rte_net_get_ptype() in app/test-pmd/csumonly.c to fill mbuf->packet_type. - add a new GSO command in testpmd to show GSO configuration for ports. - misc: fix typo and optimize function description. Jiayu Hu (3): gso: add Generic Segmentation Offload API framework gso: add TCP/IPv4 GSO support app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Mark Kavanagh (2): gso: add VxLAN GSO support gso: add GRE GSO support app/test-pmd/cmdline.c | 178 +++++++++++++++++++++ app/test-pmd/config.c | 24 +++ app/test-pmd/csumonly.c | 102 +++++++++++- app/test-pmd/testpmd.c | 16 ++ app/test-pmd/testpmd.h | 10 ++ config/common_base | 5 + lib/Makefile | 2 + lib/librte_eal/common/include/rte_log.h | 1 + lib/librte_gso/Makefile | 52 ++++++ lib/librte_gso/gso_common.c | 270 ++++++++++++++++++++++++++++++++ lib/librte_gso/gso_common.h | 165 +++++++++++++++++++ lib/librte_gso/gso_tcp4.c | 83 ++++++++++ lib/librte_gso/gso_tcp4.h | 76 +++++++++ lib/librte_gso/gso_tunnel_tcp4.c | 85 ++++++++++ lib/librte_gso/gso_tunnel_tcp4.h | 76 +++++++++ lib/librte_gso/rte_gso.c | 91 +++++++++++ lib/librte_gso/rte_gso.h | 133 ++++++++++++++++ lib/librte_gso/rte_gso_version.map | 7 + mk/rte.app.mk | 1 + 19 files changed, 1373 insertions(+), 4 deletions(-) create mode 100644 lib/librte_gso/Makefile create mode 100644 lib/librte_gso/gso_common.c create mode 100644 lib/librte_gso/gso_common.h create mode 100644 lib/librte_gso/gso_tcp4.c create mode 100644 lib/librte_gso/gso_tcp4.h create mode 100644 lib/librte_gso/gso_tunnel_tcp4.c create mode 100644 lib/librte_gso/gso_tunnel_tcp4.h create mode 100644 lib/librte_gso/rte_gso.c create mode 100644 lib/librte_gso/rte_gso.h create mode 100644 lib/librte_gso/rte_gso_version.map -- 2.7.4