From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6ED16A057B; Tue, 24 Mar 2020 13:15:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B26DD1C0C9; Tue, 24 Mar 2020 13:15:22 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C78C01C0C9 for ; Tue, 24 Mar 2020 13:15:21 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 24 Mar 2020 14:15:19 +0200 Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 02OCFJwV011585; Tue, 24 Mar 2020 14:15:19 +0200 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id 02OCFJkC029054; Tue, 24 Mar 2020 12:15:19 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 02OCFJrw029053; Tue, 24 Mar 2020 12:15:19 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: matan@mellanox.com, stable@dpdk.org Date: Tue, 24 Mar 2020 12:15:18 +0000 Message-Id: <1585052118-29013-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix metadata for compressed Rx CQEs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 packets with the same metadata are received with compressed CQE the metadata value is not copied from the title packet in vectorized rx_burst routines, it causes wrong metadat values seeing by applications. Fixes: a18ac6113331 ("net/mlx5: add metadata support to Rx datapath") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 13 +++++++++++++ drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 13 +++++++++++++ drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 14 +++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h index aa43cab..ae5c857 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h +++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h @@ -263,6 +263,19 @@ elts[pos + 2]->hash.fdir.hi = flow_tag; elts[pos + 3]->hash.fdir.hi = flow_tag; } + if (rte_flow_dynf_metadata_avail()) { + const uint32_t meta = *RTE_FLOW_DYNF_METADATA(t_pkt); + + /* Check if title packet has valid metadata. */ + if (meta) { + MLX5_ASSERT(t_pkt->ol_flags & + PKT_RX_DYNF_METADATA); + *RTE_FLOW_DYNF_METADATA(elts[pos]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 2]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 3]) = meta; + } + } pos += MLX5_VPMD_DESCS_PER_LOOP; /* Move to next CQE and invalidate consumed CQEs. */ diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h index 6d952df..701e5e0 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h @@ -205,6 +205,19 @@ elts[pos + 2]->hash.fdir.hi = flow_tag; elts[pos + 3]->hash.fdir.hi = flow_tag; } + if (rte_flow_dynf_metadata_avail()) { + const uint32_t meta = *RTE_FLOW_DYNF_METADATA(t_pkt); + + /* Check if title packet has valid metadata. */ + if (meta) { + MLX5_ASSERT(t_pkt->ol_flags & + PKT_RX_DYNF_METADATA); + *RTE_FLOW_DYNF_METADATA(elts[pos]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 2]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 3]) = meta; + } + } pos += MLX5_VPMD_DESCS_PER_LOOP; /* Move to next CQE and invalidate consumed CQEs. */ if (!(pos & 0x7) && pos < mcqe_n) { diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h index 406f23f..a4086df 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h @@ -118,7 +118,6 @@ 14, 15, 6, 7, 10, 11, 2, 3); #endif - /* * A. load mCQEs into a 128bit register. * B. store rearm data to mbuf. @@ -191,6 +190,19 @@ elts[pos + 2]->hash.fdir.hi = flow_tag; elts[pos + 3]->hash.fdir.hi = flow_tag; } + if (rte_flow_dynf_metadata_avail()) { + const uint32_t meta = *RTE_FLOW_DYNF_METADATA(t_pkt); + + /* Check if title packet has valid metadata. */ + if (meta) { + MLX5_ASSERT(t_pkt->ol_flags & + PKT_RX_DYNF_METADATA); + *RTE_FLOW_DYNF_METADATA(elts[pos]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 2]) = meta; + *RTE_FLOW_DYNF_METADATA(elts[pos + 3]) = meta; + } + } pos += MLX5_VPMD_DESCS_PER_LOOP; /* Move to next CQE and invalidate consumed CQEs. */ if (!(pos & 0x7) && pos < mcqe_n) { -- 1.8.3.1