path: root/examples/ipv4_multicast
diff options
authorOlivier Matz <>2014-11-26 16:04:52 +0100
committerThomas Monjalon <>2014-11-26 19:35:56 +0100
commit4199fdea60c36f3ef0529a61896fd5ab0cc0ba1f (patch)
tree20253347e0e6cbd899d92e93cda01e8ef80d319b /examples/ipv4_multicast
parent6006818cfb26bbce0a03ddcb77e42b51a21cebb5 (diff)
mbuf: generic support for TCP segmentation offload
Some of the NICs supported by DPDK have a possibility to accelerate TCP traffic by using segmentation offload. The application prepares a packet with valid TCP header with size up to 64K and deleguates the segmentation to the NIC. Implement the generic part of TCP segmentation offload in rte_mbuf. It introduces 2 new fields in rte_mbuf: l4_len (length of L4 header in bytes) and tso_segsz (MSS of packets). To delegate the TCP segmentation to the hardware, the user has to: - set the PKT_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies PKT_TX_TCP_CKSUM) - set the flag PKT_TX_IPV4 or PKT_TX_IPV6 - set PKT_TX_IP_CKSUM if it's IPv4, and set the IP checksum to 0 in the packet - fill the mbuf offload information: l2_len, l3_len, l4_len, tso_segsz - calculate the pseudo header checksum without taking ip_len in account, and set it in the TCP header, for instance by using rte_ipv4_phdr_cksum(ip_hdr, ol_flags) The API is inspired from ixgbe hardware (the next commit adds the support for ixgbe), but it seems generic enough to be used for other hw/drivers in the future. This commit also reworks the way l2_len and l3_len are used in igb and ixgbe drivers as the l2_l3_len is not available anymore in mbuf. Signed-off-by: Mirek Walukiewicz <> Signed-off-by: Olivier Matz <> Acked-by: Konstantin Ananyev <>
Diffstat (limited to 'examples/ipv4_multicast')
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 590d11a..80c5140 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -302,7 +302,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
/* copy metadata from source packet*/
hdr->port = pkt->port;
hdr->vlan_tci = pkt->vlan_tci;
- hdr->l2_l3_len = pkt->l2_l3_len;
+ hdr->tx_offload = pkt->tx_offload;
hdr->hash = pkt->hash;
hdr->ol_flags = pkt->ol_flags;