#include <rte_kvargs.h>
#include <rte_interrupts.h>
#include <rte_branch_prediction.h>
+#include <rte_common.h>
/* Generated configuration header. */
#include "mlx4_autoconf.h"
claim_zero(ibv_destroy_qp(txq->qp));
if (txq->cq != NULL)
claim_zero(ibv_destroy_cq(txq->cq));
- for (i = 0; (i != elemof(txq->mp2mr)); ++i) {
+ for (i = 0; (i != RTE_DIM(txq->mp2mr)); ++i) {
if (txq->mp2mr[i].mp == NULL)
break;
assert(txq->mp2mr[i].mr != NULL);
unsigned int i;
struct ibv_mr *mr;
- for (i = 0; (i != elemof(txq->mp2mr)); ++i) {
+ for (i = 0; (i != RTE_DIM(txq->mp2mr)); ++i) {
if (unlikely(txq->mp2mr[i].mp == NULL)) {
/* Unknown MP, add a new MR for it. */
break;
(void *)txq);
return (uint32_t)-1;
}
- if (unlikely(i == elemof(txq->mp2mr))) {
+ if (unlikely(i == RTE_DIM(txq->mp2mr))) {
/* Table is full, remove oldest entry. */
DEBUG("%p: MR <-> MP table full, dropping oldest entry.",
(void *)txq);
return 0;
error:
if (elts != NULL) {
- for (i = 0; (i != elemof(*elts)); ++i)
+ for (i = 0; (i != RTE_DIM(*elts)); ++i)
rte_pktmbuf_free_seg((*elts)[i].buf);
rte_free(elts);
}
rxq->elts = NULL;
if (elts == NULL)
return;
- for (i = 0; (i != elemof(*elts)); ++i)
+ for (i = 0; (i != RTE_DIM(*elts)); ++i)
rte_pktmbuf_free_seg((*elts)[i].buf);
rte_free(elts);
}