From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yongseok Koh Subject: [PATCH v1 6/6] app/testpmd: conserve mbuf indirection flag Date: Fri, 9 Mar 2018 17:25:32 -0800 Message-ID: <20180310012532.15809-7-yskoh@mellanox.com> References: <20180310012532.15809-1-yskoh@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, Yongseok Koh To: wenzhuo.lu@intel.com, jingjing.wu@intel.com, adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, olivier.matz@6wind.com Return-path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0072.outbound.protection.outlook.com [104.47.1.72]) by dpdk.org (Postfix) with ESMTP id 30E617CF1 for ; Sat, 10 Mar 2018 02:26:02 +0100 (CET) In-Reply-To: <20180310012532.15809-1-yskoh@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- app/test-pmd/csumonly.c | 2 ++ app/test-pmd/macfwd.c | 2 ++ app/test-pmd/macswap.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 5f5ab64aa..1dd4d7130 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -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. */ diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index 2adce7019..7e096ee78 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -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); diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c index e2cc4812c..39f96c1e0 100644 --- a/app/test-pmd/macswap.c +++ b/app/test-pmd/macswap.c @@ -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); -- 2.11.0