[dpdk-dev,v1,6/6] app/testpmd: conserve mbuf indirection flag
Checks
Commit Message
If PMD delivers Rx packets with mbuf indirection, ol_flags should not be
overwritten. For mlx5 PMD, if Multi-Packet RQ is enabled, Rx packets could
be indirect mbufs.
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
app/test-pmd/csumonly.c | 2 ++
app/test-pmd/macfwd.c | 2 ++
app/test-pmd/macswap.c | 2 ++
3 files changed, 6 insertions(+)
@@ -770,6 +770,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
m->l4_len = info.l4_len;
m->tso_segsz = info.tso_segsz;
}
+ if (RTE_MBUF_INDIRECT(m))
+ tx_ol_flags |= IND_ATTACHED_MBUF;
m->ol_flags = tx_ol_flags;
/* Do split & copy for the packet. */
@@ -96,6 +96,8 @@ pkt_burst_mac_forward(struct fwd_stream *fs)
ð_hdr->d_addr);
ether_addr_copy(&ports[fs->tx_port].eth_addr,
ð_hdr->s_addr);
+ if (RTE_MBUF_INDIRECT(mb))
+ ol_flags |= IND_ATTACHED_MBUF;
mb->ol_flags = ol_flags;
mb->l2_len = sizeof(struct ether_hdr);
mb->l3_len = sizeof(struct ipv4_hdr);
@@ -127,6 +127,8 @@ pkt_burst_mac_swap(struct fwd_stream *fs)
ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr);
ether_addr_copy(&addr, ð_hdr->s_addr);
+ if (RTE_MBUF_INDIRECT(mb))
+ ol_flags |= IND_ATTACHED_MBUF;
mb->ol_flags = ol_flags;
mb->l2_len = sizeof(struct ether_hdr);
mb->l3_len = sizeof(struct ipv4_hdr);