/* SPDX-License-Identifier: BSD-3-Clause */
-/* Copyright(c) 2019-2020 Broadcom All rights reserved. */
+/* Copyright(c) 2019-2021 Broadcom All rights reserved. */
#include <inttypes.h>
#include <stdbool.h>
const __m128i rss_mask =
_mm_set1_epi32(RX_PKT_CMPL_FLAGS_RSS_VALID);
__m128i t0, t1, flags_type, flags2, index, errors, rss_flags;
- __m128i ptype_idx;
+ __m128i ptype_idx, is_tunnel;
uint32_t ol_flags;
/* Compute packet type table indexes for four packets */
t1 = _mm_unpackhi_epi32(mm_rxcmp1[2], mm_rxcmp1[3]);
/* Compute ol_flags and checksum error indexes for four packets. */
+ is_tunnel = _mm_and_si128(flags2, _mm_set1_epi32(4));
+ is_tunnel = _mm_slli_epi32(is_tunnel, 3);
flags2 = _mm_and_si128(flags2, _mm_set1_epi32(0x1F));
errors = _mm_srli_epi32(_mm_unpacklo_epi64(t0, t1), 4);
errors = _mm_and_si128(errors, flags2);
index = _mm_andnot_si128(errors, flags2);
+ errors = _mm_or_si128(errors, _mm_srli_epi32(is_tunnel, 1));
+ index = _mm_or_si128(index, is_tunnel);
/* Update mbuf rearm_data for four packets. */
GET_OL_FLAGS(rss_flags, index, errors, 0, ol_flags);
valid = _mm_cvtsi128_si64(_mm_packs_epi32(info3_v, info3_v));
num_valid = __builtin_popcountll(valid & desc_valid_mask);
- switch (num_valid) {
- case 4:
- rxr->rx_buf_ring[mbcons + 3] = NULL;
- /* FALLTHROUGH */
- case 3:
- rxr->rx_buf_ring[mbcons + 2] = NULL;
- /* FALLTHROUGH */
- case 2:
- rxr->rx_buf_ring[mbcons + 1] = NULL;
- /* FALLTHROUGH */
- case 1:
- rxr->rx_buf_ring[mbcons + 0] = NULL;
+ if (num_valid == 0)
break;
- case 0:
- goto out;
- }
descs_to_mbufs(rxcmp, rxcmp1, mbuf_init, &rx_pkts[nb_rx_pkts],
rxr);
break;
}
-out:
if (nb_rx_pkts) {
rxr->rx_raw_prod = RING_ADV(rxr->rx_raw_prod, nb_rx_pkts);
static inline void
bnxt_xmit_one(struct rte_mbuf *mbuf, struct tx_bd_long *txbd,
- struct bnxt_sw_tx_bd *tx_buf)
+ struct rte_mbuf **tx_buf)
{
__m128i desc;
- tx_buf->mbuf = mbuf;
- tx_buf->nr_bds = 1;
+ *tx_buf = mbuf;
desc = _mm_set_epi64x(mbuf->buf_iova + mbuf->data_off,
bnxt_xmit_flags_len(mbuf->data_len,
struct bnxt_tx_ring_info *txr = txq->tx_ring;
uint16_t tx_prod, tx_raw_prod = txr->tx_raw_prod;
struct tx_bd_long *txbd;
- struct bnxt_sw_tx_bd *tx_buf;
+ struct rte_mbuf **tx_buf;
uint16_t to_send;
tx_prod = RING_IDX(txr->tx_ring_struct, tx_raw_prod);