net/mlx5: fix assert in dynamic metadata handling
authorAlexander Kozyrev <akozyrev@mellanox.com>
Mon, 27 Apr 2020 18:20:11 +0000 (18:20 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 5 May 2020 13:54:26 +0000 (15:54 +0200)
The assert in dynamic flow metadata handling is wrong after the
fix for the performance degradation. The assert meant to check
the metadata mask but was updated with the metadata offset instead.
Fix this assert and restore proper metadata mask checking.

Fixes: 6c55b622a956 ("net/mlx5: set dynamic flow metadata in Rx queues")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
drivers/net/mlx5/mlx5_rxtx_vec_neon.h
drivers/net/mlx5/mlx5_rxtx_vec_sse.h

index 69b9347..26715ef 100644 (file)
@@ -264,14 +264,15 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
                        elts[pos + 2]->hash.fdir.hi = flow_tag;
                        elts[pos + 3]->hash.fdir.hi = flow_tag;
                }
-               if (!!rxq->flow_meta_mask) {
+               if (rxq->dynf_meta) {
                        int32_t offs = rxq->flow_meta_offset;
                        const uint32_t meta =
                                *RTE_MBUF_DYNFIELD(t_pkt, offs, uint32_t *);
 
                        /* Check if title packet has valid metadata. */
                        if (meta) {
-                               MLX5_ASSERT(t_pkt->ol_flags & offs);
+                               MLX5_ASSERT(t_pkt->ol_flags &
+                                           rxq->flow_meta_mask);
                                *RTE_MBUF_DYNFIELD(elts[pos], offs,
                                                        uint32_t *) = meta;
                                *RTE_MBUF_DYNFIELD(elts[pos + 1], offs,
@@ -1028,7 +1029,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
                        pkts[pos + 3]->timestamp =
                                rte_be_to_cpu_64(cq[pos + p3].timestamp);
                }
-               if (!!rxq->flow_meta_mask) {
+               if (rxq->dynf_meta) {
                        uint64_t flag = rxq->flow_meta_mask;
                        int32_t offs = rxq->flow_meta_offset;
                        uint32_t metadata;
index d39e726..ecafbf8 100644 (file)
@@ -205,14 +205,15 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
                        elts[pos + 2]->hash.fdir.hi = flow_tag;
                        elts[pos + 3]->hash.fdir.hi = flow_tag;
                }
-               if (!!rxq->flow_meta_mask) {
+               if (rxq->dynf_meta) {
                        int32_t offs = rxq->flow_meta_offset;
                        const uint32_t meta =
                                *RTE_MBUF_DYNFIELD(t_pkt, offs, uint32_t *);
 
                        /* Check if title packet has valid metadata. */
                        if (meta) {
-                               MLX5_ASSERT(t_pkt->ol_flags & offs);
+                               MLX5_ASSERT(t_pkt->ol_flags &
+                                           rxq->flow_meta_mask);
                                *RTE_MBUF_DYNFIELD(elts[pos], offs,
                                                        uint32_t *) = meta;
                                *RTE_MBUF_DYNFIELD(elts[pos + 1], offs,
index f110f73..6847ae7 100644 (file)
@@ -199,7 +199,8 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 
                        /* Check if title packet has valid metadata. */
                        if (meta) {
-                               MLX5_ASSERT(t_pkt->ol_flags & offs);
+                               MLX5_ASSERT(t_pkt->ol_flags &
+                                           rxq->flow_meta_mask);
                                *RTE_MBUF_DYNFIELD(elts[pos], offs,
                                                        uint32_t *) = meta;
                                *RTE_MBUF_DYNFIELD(elts[pos + 1], offs,