Re: [PATCH v2 1/5] ethdev: introduce Tx generic tunnel offloads
From: Xueming(Steven) Li <hidden>
Date: 2018-01-30 15:47:54
-----Original Message----- From: Ananyev, Konstantin [mailto:konstantin.ananyev@intel.com] Sent: Tuesday, January 30, 2018 11:34 PM To: Xueming(Steven) Li <redacted>; Olivier MATZ [off-list ref] Cc: dev@dpdk.org; Wu, Jingjing <redacted>; Shahaf Shuler [off-list ref]; Yongseok Koh [off-list ref]; Thomas Monjalon [off-list ref]; Yigit, Ferruh [off-list ref] Subject: RE: [dpdk-dev] [PATCH v2 1/5] ethdev: introduce Tx generic tunnel offloadsquoted
-----Original Message----- From: Xueming(Steven) Li [mailto:xuemingl@mellanox.com] Sent: Tuesday, January 30, 2018 3:27 PM To: Ananyev, Konstantin <redacted>; Olivier MATZ [off-list ref] Cc: dev@dpdk.org; Wu, Jingjing <redacted>; Shahaf Shuler [off-list ref]; Yongseok Koh [off-list ref]; Thomas Monjalon [off-list ref]; Yigit, Ferruh [off-list ref] Subject: RE: [dpdk-dev] [PATCH v2 1/5] ethdev: introduce Tx generic tunnel offloads Hi Ananyev,quoted
-----Original Message----- From: Ananyev, Konstantin [mailto:konstantin.ananyev@intel.com] Sent: Tuesday, January 30, 2018 9:28 PM To: Xueming(Steven) Li <redacted>; Olivier MATZ [off-list ref] Cc: dev@dpdk.org; Wu, Jingjing <redacted>; Shahaf Shuler [off-list ref]; Yongseok Koh [off-list ref]; Thomas Monjalon [off-list ref]; Yigit, Ferruh [off-list ref] Subject: RE: [dpdk-dev] [PATCH v2 1/5] ethdev: introduce Tx generic tunnel offloads Hi Xueming,quoted
quoted
quoted
This patch introduce new TX offloads flag for devices that support tunnel agnostic checksum and TSO offloads. The support from the device is for inner and outer checksums on IPV4/TCP/UDP and TSO for *any packet with the followingformat*:quoted
quoted
quoted
quoted
quoted
< some headers > / [optional IPv4/IPv6] / [optional TCP/UDP] / <some headers> / [optional inner IPv4/IPv6] / [optional TCP/UDP] For example the following packets can use this feature: 1. eth / ipv4 / udp / VXLAN / ip / tcp 2. eth / ipv4 / GRE / MPLS / ipv4 / udpSo in terms of usage - what is the difference with current TSOtypes?quoted
quoted
quoted
quoted
KonstantinTraditionally, HW only recognize "known" tunnel type, do TSO calculation based on L3/L4 headers known to tunnel type. For example, it must be L2 header after VXLAN, then L3. While this Generic offloading provides inner/outer L3/L4 header info(len and offset) to HW, and thus tunnel info become less important. Please note the MPLS over GRE tunnel in last example above.Ok, but I wonder when the user would like to do TSO on tunnel packet, for this offload - would he need to do something differently from what he has to do now: raise PKT_TX_TCP_SEG and related flags, raise appropriate PKT_TX_TUNNEL_* flag, fill l2_len, l3_len,l4_len,tso_segsz,outer_l2_len,outer_l3_len?quoted
quoted
Yes, these fields are sufficient except PKT_TX_TUNNEL_*, major target of this new feature is to support "unknown" tunnel offloading, itsupports "known"quoted
tunnel type as well.Ok, but user would still need to set some flag to indicate that this is a tunnel packet, and he wants TSO over it, right? For pre-defined tunnel types it can be one of PKT_TX_TUNNEL_* (which actually means that user still have to know tunnel type anyway?) But for some not defined tunnel type - what it would be? Konstantin
As this feature target to TX path, Outer length as tunnel indication, leave it empty if tunnel not defined. But I think it good to define something like: PKT_TX_TUNNEL_GENERIC = PKT_TX_TUNNEL_MASK And a new flag PKT_TX_OUTER_UDP, how do you think?
quoted
PKT_TX_TUNNEL_VXLAN has to be used as a hint if outer UDP expected.quoted
Konstantinquoted
quoted
quoted
Signed-off-by: Xueming Li <redacted> --- lib/librte_ether/rte_ethdev.h | 10 ++++++++++ 1 file changed, 10 insertions(+)diff --git a/lib/librte_ether/rte_ethdev.hb/lib/librte_ether/rte_ethdev.h index 1a5b4cdc5..d8d08ccb2 100644--- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h@@ -979,6 +979,16 @@ struct rte_eth_conf { * the same mempool and has refcnt = 1. */ #define DEV_TX_OFFLOAD_SECURITY 0x00020000 +/**< Device supports generic tunnel checksum and TSO offloading. + * Checksum and TSO are done based on following mbuf fields: + * - Length of each header + * - Type of outer/inner L3 type, IPv4 or IPv6 + * - Type of outer/inner L4 type, TCP or UDP. + * - PKT_TX_TUNNEL_VXLAN implies outer UDP type. + * - PKT_TX_TCP_SEG implies inner TCP type. + * Tunnel type is optional except PKT_TX_TUNNEL_VXLAN to hint +outerUDP.quoted
quoted
quoted
+ */ +#define DEV_TX_OFFLOAD_GENERIC_TNL_CKSUM_TSO 0x00040000 /* * If new Tx offload capabilities are defined, they also must be -- 2.13.3