gso: support TCP/IPv4 GSO
authorJiayu Hu <jiayu.hu@intel.com>
Sat, 7 Oct 2017 14:56:40 +0000 (22:56 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 12 Oct 2017 00:36:57 +0000 (01:36 +0100)
commit119583797b6ae44990934d7b965e76463530ca7a
treed3ccf61f48411031add1cbe8c26fac3178c1bc7a
parentec51443cc99a6e20e8e2210d92d59ae760971f90
gso: support TCP/IPv4 GSO

This patch adds GSO support for TCP/IPv4 packets. Supported packets
may include a single VLAN tag. TCP/IPv4 GSO doesn't check if input
packets have correct checksums, and doesn't update checksums for
output packets (the responsibility for this lies with the application).
Additionally, TCP/IPv4 GSO doesn't process IP fragmented packets.

TCP/IPv4 GSO uses two chained MBUFs, one direct MBUF and one indrect
MBUF, to organize an output packet. Note that we refer to these two
chained MBUFs as a two-segment MBUF. The direct MBUF stores the packet
header, while the indirect mbuf simply points to a location within the
original packet's payload. Consequently, use of the GSO library requires
multi-segment MBUF support in the TX functions of the NIC driver.

If a packet is GSO'd, TCP/IPv4 GSO reduces its MBUF refcnt by 1. As a
result, when all of its GSOed segments are freed, the packet is freed
automatically.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
doc/guides/rel_notes/release_17_11.rst
lib/Makefile
lib/librte_eal/common/include/rte_log.h
lib/librte_gso/Makefile
lib/librte_gso/gso_common.c [new file with mode: 0644]
lib/librte_gso/gso_common.h [new file with mode: 0644]
lib/librte_gso/gso_tcp4.c [new file with mode: 0644]
lib/librte_gso/gso_tcp4.h [new file with mode: 0644]
lib/librte_gso/rte_gso.c
lib/librte_gso/rte_gso.h