* Data plane functions for mlx4 driver.
*/
-#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
uint32_t stamp = sq->stamp;
int32_t size = (intptr_t)end - (intptr_t)start;
- assert(start != end);
+ MLX4_ASSERT(start != end);
/* Hold SQ ring wrap around. */
if (size < 0) {
size = (int32_t)sq->size + size;
if (unlikely(!!(cqe->owner_sr_opcode & MLX4_CQE_OWNER_MASK) ^
!!(cons_index & cq->cqe_cnt)))
break;
-#ifndef NDEBUG
+#ifdef RTE_LIBRTE_MLX4_DEBUG
/*
* Make sure we read the CQE after we read the ownership bit.
*/
cqe_err->syndrome);
break;
}
-#endif /* NDEBUG */
+#endif /* RTE_LIBRTE_MLX4_DEBUG */
cons_index++;
} while (1);
completed = (cons_index - cq->cons_index) * txq->elts_comp_cd_init;
{
struct mlx4_sq *sq = &txq->msq;
const uint8_t tunneled = txq->priv->hw_csum_l2tun &&
- (buf->ol_flags & PKT_TX_TUNNEL_MASK);
+ (buf->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK);
tinfo->tso_header_size = buf->l2_len + buf->l3_len + buf->l4_len;
if (tunneled)
((uintptr_t)dseg & (MLX4_TXBB_SIZE - 1))) >>
MLX4_SEG_SHIFT;
switch (nb_segs_txbb) {
-#ifndef NDEBUG
+#ifdef RTE_LIBRTE_MLX4_DEBUG
default:
/* Should never happen. */
rte_panic("%p: Invalid number of SGEs(%d) for a TXBB",
(void *)txq, nb_segs_txbb);
/* rte_panic never returns. */
break;
-#endif /* NDEBUG */
+#endif /* RTE_LIBRTE_MLX4_DEBUG */
case 4:
/* Memory region key for this memory pool. */
lkey = mlx4_tx_mb2mr(txq, sbuf);
volatile struct mlx4_wqe_ctrl_seg *ctrl;
struct txq_elt *elt;
- assert(txq->elts_comp_cd != 0);
+ MLX4_ASSERT(txq->elts_comp_cd != 0);
if (likely(max >= txq->elts_comp_cd_init))
mlx4_txq_complete(txq, elts_m, sq);
max = elts_n - max;
- assert(max >= 1);
- assert(max <= elts_n);
+ MLX4_ASSERT(max >= 1);
+ MLX4_ASSERT(max <= elts_n);
/* Always leave one free entry in the ring. */
--max;
if (max > pkts_n)
uint16_t flags16[2];
} srcrb;
uint32_t lkey;
- bool tso = txq->priv->tso && (buf->ol_flags & PKT_TX_TCP_SEG);
+ bool tso = txq->priv->tso && (buf->ol_flags & RTE_MBUF_F_TX_TCP_SEG);
/* Clean up old buffer. */
if (likely(elt->buf != NULL)) {
struct rte_mbuf *tmp = elt->buf;
-#ifndef NDEBUG
- /* Poisoning. */
- memset(&elt->buf, 0x66, sizeof(struct rte_mbuf *));
-#endif
/* Faster than rte_pktmbuf_free(). */
do {
struct rte_mbuf *next = tmp->next;
/* Enable HW checksum offload if requested */
if (txq->csum &&
(buf->ol_flags &
- (PKT_TX_IP_CKSUM | PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM))) {
+ (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_TCP_CKSUM | RTE_MBUF_F_TX_UDP_CKSUM))) {
const uint64_t is_tunneled = (buf->ol_flags &
- (PKT_TX_TUNNEL_GRE |
- PKT_TX_TUNNEL_VXLAN));
+ (RTE_MBUF_F_TX_TUNNEL_GRE |
+ RTE_MBUF_F_TX_TUNNEL_VXLAN));
if (is_tunneled && txq->csum_l2tun) {
owner_opcode |= MLX4_WQE_CTRL_IIP_HDR_CSUM |
MLX4_WQE_CTRL_IL4_HDR_CSUM;
- if (buf->ol_flags & PKT_TX_OUTER_IP_CKSUM)
+ if (buf->ol_flags & RTE_MBUF_F_TX_OUTER_IP_CKSUM)
srcrb.flags |=
RTE_BE32(MLX4_WQE_CTRL_IP_HDR_CSUM);
} else {
ol_flags |=
mlx4_transpose(flags,
MLX4_CQE_STATUS_IP_HDR_CSUM_OK,
- PKT_RX_IP_CKSUM_GOOD) |
+ RTE_MBUF_F_RX_IP_CKSUM_GOOD) |
mlx4_transpose(flags,
MLX4_CQE_STATUS_TCP_UDP_CSUM_OK,
- PKT_RX_L4_CKSUM_GOOD);
+ RTE_MBUF_F_RX_L4_CKSUM_GOOD);
if ((flags & MLX4_CQE_L2_TUNNEL) && csum_l2tun)
ol_flags |=
mlx4_transpose(flags,
MLX4_CQE_L2_TUNNEL_IPOK,
- PKT_RX_IP_CKSUM_GOOD) |
+ RTE_MBUF_F_RX_IP_CKSUM_GOOD) |
mlx4_transpose(flags,
MLX4_CQE_L2_TUNNEL_L4_CSUM,
- PKT_RX_L4_CKSUM_GOOD);
+ RTE_MBUF_F_RX_L4_CKSUM_GOOD);
return ol_flags;
}
* ownership bit.
*/
rte_rmb();
- assert(!(cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK));
- assert((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) !=
- MLX4_CQE_OPCODE_ERROR);
+ MLX4_ASSERT(!(cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK));
+ MLX4_ASSERT((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) !=
+ MLX4_CQE_OPCODE_ERROR);
ret = rte_be_to_cpu_32(cqe->byte_cnt);
++cq->cons_index;
out:
break;
}
while (pkt != seg) {
- assert(pkt != (*rxq->elts)[idx]);
+ MLX4_ASSERT(pkt != (*rxq->elts)[idx]);
rep = pkt->next;
pkt->next = NULL;
pkt->nb_segs = 1;
goto skip;
}
pkt = seg;
- assert(len >= (rxq->crc_present << 2));
+ MLX4_ASSERT(len >= (rxq->crc_present << 2));
/* Update packet information. */
pkt->packet_type =
rxq_cq_to_pkt_type(cqe, rxq->l2tun_offload);
- pkt->ol_flags = PKT_RX_RSS_HASH;
+ pkt->ol_flags = RTE_MBUF_F_RX_RSS_HASH;
pkt->hash.rss = cqe->immed_rss_invalid;
if (rxq->crc_present)
len -= RTE_ETHER_CRC_LEN;