net/virtio: fix memory leak when reinitializing device
[dpdk.git] / drivers / net / mlx5 / mlx5_rxtx_vec_sse.h
index 2b0e628..df66c2f 100644 (file)
@@ -223,7 +223,7 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
  * Send burst of packets with Enhanced MPW. If it encounters a multi-seg packet,
  * it returns to make it processed by txq_scatter_v(). All the packets in
  * the pkts list should be single segment packets having same offload flags.
- * This must be checked by txq_check_multiseg() and txq_calc_offload().
+ * This must be checked by txq_count_contig_single_seg() and txq_calc_offload().
  *
  * @param txq
  *   Pointer to TX queue structure.
@@ -584,7 +584,7 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq, __m128i cqes[4],
                        _mm_set_epi32(0xffffff00, 0xffffff00,
                                      0xffffff00, 0xffffff00);
                const __m128i fdir_flags = _mm_set1_epi32(PKT_RX_FDIR);
-               const __m128i fdir_id_flags = _mm_set1_epi32(PKT_RX_FDIR_ID);
+               __m128i fdir_id_flags = _mm_set1_epi32(PKT_RX_FDIR_ID);
                __m128i flow_tag, invalid_mask;
 
                flow_tag = _mm_and_si128(pinfo, pinfo_ft_mask);
@@ -594,7 +594,7 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq, __m128i cqes[4],
                                        _mm_andnot_si128(invalid_mask,
                                                         fdir_flags));
                /* Mask out invalid entries. */
-               flow_tag = _mm_andnot_si128(invalid_mask, flow_tag);
+               fdir_id_flags = _mm_andnot_si128(invalid_mask, fdir_id_flags);
                /* Check if flow tag MLX5_FLOW_MARK_DEFAULT. */
                ol_flags = _mm_or_si128(ol_flags,
                                        _mm_andnot_si128(
@@ -662,12 +662,16 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq, __m128i cqes[4],
  *   Array to store received packets.
  * @param pkts_n
  *   Maximum number of packets in array.
+ * @param[out] err
+ *   Pointer to a flag. Set non-zero value if pkts array has at least one error
+ *   packet to handle.
  *
  * @return
  *   Number of packets received including errors (<= pkts_n).
  */
 static inline uint16_t
-rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
+           uint64_t *err)
 {
        const uint16_t q_n = 1 << rxq->cqe_n;
        const uint16_t q_mask = q_n - 1;
@@ -829,7 +833,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
                /* B.2 copy mbuf pointers. */
                _mm_storeu_si128((__m128i *)&pkts[pos], mbp1);
                _mm_storeu_si128((__m128i *)&pkts[pos + 2], mbp2);
-               rte_compiler_barrier();
+               rte_cio_rmb();
                /* C.1 load remained CQE data and extract necessary fields. */
                cqe_tmp2 = _mm_load_si128((__m128i *)&cq[pos + p3]);
                cqe_tmp1 = _mm_load_si128((__m128i *)&cq[pos + p2]);
@@ -929,7 +933,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
                opcode = _mm_packs_epi32(opcode, zero);
                opcode = _mm_andnot_si128(invalid_mask, opcode);
                /* D.4 mark if any error is set */
-               rxq->pending_err |= !!_mm_cvtsi128_si64(opcode);
+               *err |= _mm_cvtsi128_si64(opcode);
                /* D.5 fill in mbuf - rearm_data and packet_type. */
                rxq_cq_to_ptype_oflags_v(rxq, cqes, opcode, &pkts[pos]);
                if (rxq->hw_timestamp) {