- rxq->qp = ibv_create_qp
- (priv->pd,
- &(struct ibv_qp_init_attr){
- .send_cq = rxq->cq,
- .recv_cq = rxq->cq,
- .cap = {
- .max_recv_wr =
- RTE_MIN(priv->device_attr.max_qp_wr,
- desc),
- .max_recv_sge = 1,
+ rxq->wq = ibv_create_wq
+ (priv->ctx,
+ &(struct ibv_wq_init_attr){
+ .wq_type = IBV_WQT_RQ,
+ .max_wr = RTE_MIN(priv->device_attr.max_qp_wr, desc),
+ .max_sge = 1,
+ .pd = priv->pd,
+ .cq = rxq->cq,
+ });
+ if (!rxq->wq) {
+ rte_errno = errno ? errno : EINVAL;
+ ERROR("%p: WQ creation failure: %s",
+ (void *)dev, strerror(rte_errno));
+ goto error;
+ }
+ ret = ibv_modify_wq
+ (rxq->wq,
+ &(struct ibv_wq_attr){
+ .attr_mask = IBV_WQ_ATTR_STATE,
+ .wq_state = IBV_WQS_RDY,
+ });
+ if (ret) {
+ rte_errno = ret;
+ ERROR("%p: WQ state to IBV_WPS_RDY failed: %s",
+ (void *)dev, strerror(rte_errno));
+ goto error;
+ }
+ rxq->ind = ibv_create_rwq_ind_table
+ (priv->ctx,
+ &(struct ibv_rwq_ind_table_init_attr){
+ .log_ind_tbl_size = 0,
+ .ind_tbl = (struct ibv_wq *[]){
+ rxq->wq,