| 406 | } |
| 407 | |
| 408 | static int bnxt_alloc_cmpl_ring(struct bnxt *bp, int queue_index, |
| 409 | struct bnxt_cp_ring_info *cpr) |
| 410 | { |
| 411 | struct bnxt_ring *cp_ring = cpr->cp_ring_struct; |
| 412 | uint32_t nq_ring_id = HWRM_NA_SIGNATURE; |
| 413 | int cp_ring_index = queue_index + BNXT_RX_VEC_START; |
| 414 | struct bnxt_cp_ring_info *nqr = bp->rxtx_nq_ring; |
| 415 | uint8_t ring_type; |
| 416 | int rc = 0; |
| 417 | |
| 418 | ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL; |
| 419 | |
| 420 | if (BNXT_HAS_NQ(bp)) { |
| 421 | if (nqr) { |
| 422 | nq_ring_id = nqr->cp_ring_struct->fw_ring_id; |
| 423 | } else { |
| 424 | PMD_DRV_LOG(ERR, "NQ ring is NULL\n"); |
| 425 | return -EINVAL; |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | rc = bnxt_hwrm_ring_alloc(bp, cp_ring, ring_type, cp_ring_index, |
| 430 | HWRM_NA_SIGNATURE, nq_ring_id, 0); |
| 431 | if (rc) |
| 432 | return rc; |
| 433 | |
| 434 | cpr->cp_raw_cons = 0; |
| 435 | bnxt_set_db(bp, &cpr->cp_db, ring_type, cp_ring_index, |
| 436 | cp_ring->fw_ring_id, cp_ring->ring_mask); |
| 437 | bnxt_db_cq(cpr); |
| 438 | |
| 439 | return 0; |
| 440 | } |
| 441 | |
| 442 | int bnxt_alloc_rxtx_nq_ring(struct bnxt *bp) |
| 443 | { |
no test coverage detected