@@ -116,11 +116,6 @@ static struct mlx4_cqe *next_cqe_sw(struct mlx4_cq *cq)
return get_sw_cqe(cq, cq->cons_index);
}
-static void update_cons_index(struct mlx4_cq *cq)
-{
- *cq->set_ci_db = htonl(cq->cons_index & 0xffffff);
-}
-
static void mlx4_handle_error_cqe(struct mlx4_err_cqe *cqe, struct ibv_wc *wc)
{
if (cqe->syndrome == MLX4_CQE_SYNDROME_LOCAL_QP_OP_ERR)
@@ -356,7 +351,7 @@ int mlx4_poll_cq(struct ibv_cq *ibcq, int ne, struct ibv_wc *wc)
}
if (npolled || err == CQ_POLL_ERR)
- update_cons_index(cq);
+ mlx4_update_cons_index(cq);
pthread_spin_unlock(&cq->lock);
@@ -448,7 +443,7 @@ void __mlx4_cq_clean(struct mlx4_cq *cq, uint32_t qpn, struct mlx4_srq *srq)
* updating consumer index.
*/
wmb();
- update_cons_index(cq);
+ mlx4_update_cons_index(cq);
}
}
@@ -35,6 +35,7 @@
#define MLX4_H
#include <stddef.h>
+#include <netinet/in.h>
#include <infiniband/driver.h>
#include <infiniband/arch.h>
@@ -378,6 +379,11 @@ static inline struct mlx4_ah *to_mah(struct ibv_ah *ibah)
return to_mxxx(ah, ah);
}
+static inline void mlx4_update_cons_index(struct mlx4_cq *cq)
+{
+ *cq->set_ci_db = htonl(cq->cons_index & 0xffffff);
+}
+
int mlx4_alloc_buf(struct mlx4_buf *buf, size_t size, int page_size);
void mlx4_free_buf(struct mlx4_buf *buf);
@@ -332,6 +332,7 @@ int mlx4_resize_cq(struct ibv_cq *ibcq, int cqe)
mlx4_free_buf(&cq->buf);
cq->buf = buf;
+ mlx4_update_cons_index(cq);
out:
pthread_spin_unlock(&cq->lock);