Skip to content

Commit

Permalink
app/testpmd: fix IPv6 tunnel checksum
Browse files Browse the repository at this point in the history
When ipv6 packet is tunnel packet, "PKT_TX_OUTER_IPV6" flag must
be set, to let prepare the correct mbuf meta data for tx forward.

Fixes: 2b76648 ("net/e1000: add Tx preparation")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
  • Loading branch information
Jeff Guo authored and Thomas Monjalon committed Apr 10, 2017
1 parent ff643f7 commit 3c32113
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/test-pmd/csumonly.c
Expand Up @@ -417,7 +417,7 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
ol_flags |= PKT_TX_OUTER_IP_CKSUM;
else
ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
} else if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)
} else
ol_flags |= PKT_TX_OUTER_IPV6;

if (info->outer_l4_proto != IPPROTO_UDP)
Expand Down Expand Up @@ -756,7 +756,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)

if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) {
(testpmd_ol_flags &
TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) ||
(tx_ol_flags & PKT_TX_OUTER_IPV6)) {
m->outer_l2_len = info.outer_l2_len;
m->outer_l3_len = info.outer_l3_len;
m->l2_len = info.l2_len;
Expand Down Expand Up @@ -826,8 +828,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
"m->l4_len=%d\n",
m->l2_len, m->l3_len, m->l4_len);
if (info.is_tunnel == 1) {
if (testpmd_ol_flags &
TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)
if ((testpmd_ol_flags &
TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) ||
(tx_ol_flags & PKT_TX_OUTER_IPV6))
printf("tx: m->outer_l2_len=%d "
"m->outer_l3_len=%d\n",
m->outer_l2_len,
Expand Down

0 comments on commit 3c32113

Please sign in to comment.