[dpdk-dev] [PATCH v3 0/3] support GRO in DPDK

Jiayu Hu jiayu.hu at intel.com
Mon Apr 24 10:09:55 CEST 2017


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



More information about the dev mailing list