From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 71470326B for ; Tue, 4 Apr 2017 14:31:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491309115; x=1522845115; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Vu0aQ76FgqCfavaQUYPtoqghfUGY2Y1MjHWrpmVK33k=; b=O7tEGbGPBvjnsEyf9IU1TPRp81iPFkQ0YfWNbPnL2LlxYKGU2OrkVj1f LZyVdBo6JQV37M8cxDzKYGSU1TDrYA==; Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2017 05:31:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,275,1486454400"; d="scan'208";a="1115218512" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.128.234]) by orsmga001.jf.intel.com with ESMTP; 04 Apr 2017 05:31:52 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: konstantin.ananyev@intel.com, keith.wiles@intel.com, yuanhan.liu@linux.intel.com, stephen@networkplumber.org, Jiayu Hu Date: Tue, 4 Apr 2017 20:31:43 +0800 Message-Id: <1491309106-94264-1-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490175137-108413-1-git-send-email-jiayu.hu@intel.com> References: <1490175137-108413-1-git-send-email-jiayu.hu@intel.com> Subject: [dpdk-dev] [PATCH v2 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: Tue, 04 Apr 2017 12:31:56 -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; 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 ========== 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 | 293 ++++++++++++++++++++++++++++++++++++++++ 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, 902 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