From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1AE2A2BAE for ; Mon, 24 Apr 2017 10:09:26 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2017 01:09:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,243,1488873600"; d="scan'208";a="80232243" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.128.234]) by orsmga004.jf.intel.com with ESMTP; 24 Apr 2017 01:09:24 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: konstantin.ananyev@intel.com, keith.wiles@intel.com, yuanhan.liu@linux.intel.com, Jiayu Hu Date: Mon, 24 Apr 2017 16:09:55 +0800 Message-Id: <1493021398-115955-1-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491309106-94264-1-git-send-email-jiayu.hu@intel.com> References: <1491309106-94264-1-git-send-email-jiayu.hu@intel.com> Subject: [dpdk-dev] [PATCH v3 0/3] support GRO 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: Mon, 24 Apr 2017 08:09:27 -0000 Generic Receive Offload (GRO) is a widely used SW-based offloading technique to reduce per-packet processing overhead. It gains performance by reassembling small packets into large ones. Therefore, we propose to add GRO support in DPDK. DPDK GRO is designed as a device ability, which is turned off by default. The unit to enable/disable GRO is port. And once a port is enabled GRO, all of its queues will reassemble packets as many as possible. For applications, the procedure of merging packets is entirely invisible. To use GRO, they just need to decide which ports need/needn't GRO and invoke GRO enabling/disabling functions for these ports. For a port, if it's enabled GRO, one generic reassembly function is registered as a RX callback for all of its queues. That is, the reassembly procedure is performed inside rte_eth_rx_burst. This patchset is to support GRO in DPDK. The first patch is to provide a GRO API framework, which enables applications to use GRO ability and enable developers to add GRO supports for specific protocols. The second patch supports TCP/IPv4 GRO. The last patch demonstrates how to use GRO ability in app/testpmd. We perform two iperf tests (with DPDK GRO and without DPDK GRO) to see the performance gains from DPDK GRO. Specifically, the experiment environment is: a. Two 10Gbps physical ports (p0 and p1) on one host are linked together; b. p0 is in networking namespace ns1, whose IP is 1.1.2.3. Iperf client runs on p0, which sends TCP/IPv4 packets. Compile DPDK with optimization level -O3; c. testpmd runs on p1. Besides, testpmd has a vdev which connects to a VM via vhost-user and virtio-kernel. The VM runs iperf server, whose IP is 1.1.2.4; d. p0 turns on TSO; VM turns off kernel GRO; testpmd runs in iofwd mode. iperf client and server use the following commands: - client: ip netns exec ns1 iperf -c 1.1.2.4 -i2 -t 60 -f g -m - server: iperf -s -f g Two test cases are: a. w/o DPDK GRO: run testpmd without GRO b. w DPDK GRO: testpmd enables GRO for p1 Result: With GRO, the throughput improvement is around 50%. Change log ========== v3: - fix compilation issues. v2: - provide generic reassembly function; - implement GRO as a device ability: add APIs for devices to support GRO; add APIs for applications to enable/disable GRO; - update testpmd example. Jiayu Hu (3): lib: add Generic Receive Offload API framework lib/gro: add TCP/IPv4 GRO support app/testpmd: enable GRO feature app/test-pmd/cmdline.c | 45 ++++++ app/test-pmd/config.c | 26 ++++ app/test-pmd/iofwd.c | 1 + app/test-pmd/testpmd.c | 5 + app/test-pmd/testpmd.h | 3 + config/common_base | 5 + lib/Makefile | 1 + lib/librte_gro/Makefile | 51 +++++++ lib/librte_gro/rte_gro.c | 297 ++++++++++++++++++++++++++++++++++++++++ lib/librte_gro/rte_gro.h | 29 ++++ lib/librte_gro/rte_gro_common.h | 77 +++++++++++ lib/librte_gro/rte_gro_tcp.c | 270 ++++++++++++++++++++++++++++++++++++ lib/librte_gro/rte_gro_tcp.h | 95 +++++++++++++ mk/rte.app.mk | 1 + 14 files changed, 906 insertions(+) create mode 100644 lib/librte_gro/Makefile create mode 100644 lib/librte_gro/rte_gro.c create mode 100644 lib/librte_gro/rte_gro.h create mode 100644 lib/librte_gro/rte_gro_common.h create mode 100644 lib/librte_gro/rte_gro_tcp.c create mode 100644 lib/librte_gro/rte_gro_tcp.h -- 2.7.4