| 316 | } |
| 317 | |
| 318 | int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, |
| 319 | uint16_t queue_idx, |
| 320 | uint16_t nb_desc, |
| 321 | unsigned int socket_id, |
| 322 | const struct rte_eth_rxconf *rx_conf, |
| 323 | struct rte_mempool *mp) |
| 324 | { |
| 325 | struct bnxt *bp = eth_dev->data->dev_private; |
| 326 | uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads; |
| 327 | struct bnxt_rx_queue *rxq; |
| 328 | int rc = 0; |
| 329 | |
| 330 | rc = is_bnxt_in_error(bp); |
| 331 | if (rc) |
| 332 | return rc; |
| 333 | |
| 334 | if (queue_idx >= bnxt_max_rings(bp)) { |
| 335 | PMD_DRV_LOG(ERR, |
| 336 | "Cannot create Rx ring %d. Only %d rings available\n", |
| 337 | queue_idx, bp->max_rx_rings); |
| 338 | return -EINVAL; |
| 339 | } |
| 340 | |
| 341 | if (nb_desc < BNXT_MIN_RING_DESC || nb_desc > MAX_RX_DESC_CNT) { |
| 342 | PMD_DRV_LOG(ERR, "nb_desc %d is invalid\n", nb_desc); |
| 343 | return -EINVAL; |
| 344 | } |
| 345 | |
| 346 | if (eth_dev->data->rx_queues) { |
| 347 | rxq = eth_dev->data->rx_queues[queue_idx]; |
| 348 | if (rxq) |
| 349 | bnxt_rx_queue_release_op(eth_dev, queue_idx); |
| 350 | } |
| 351 | rxq = rte_zmalloc_socket("bnxt_rx_queue", sizeof(struct bnxt_rx_queue), |
| 352 | RTE_CACHE_LINE_SIZE, socket_id); |
| 353 | if (!rxq) { |
| 354 | PMD_DRV_LOG(ERR, "bnxt_rx_queue allocation failed!\n"); |
| 355 | return -ENOMEM; |
| 356 | } |
| 357 | rxq->bp = bp; |
| 358 | rxq->mb_pool = mp; |
| 359 | rxq->nb_rx_desc = nb_desc; |
| 360 | rxq->rx_free_thresh = |
| 361 | RTE_MIN(rte_align32pow2(nb_desc) / 4, RTE_BNXT_MAX_RX_BURST); |
| 362 | |
| 363 | PMD_DRV_LOG(DEBUG, |
| 364 | "App supplied RXQ drop_en status : %d\n", rx_conf->rx_drop_en); |
| 365 | rxq->drop_en = BNXT_DEFAULT_RX_DROP_EN; |
| 366 | |
| 367 | PMD_DRV_LOG(DEBUG, "RX Buf MTU %d\n", eth_dev->data->mtu); |
| 368 | |
| 369 | eth_dev->data->rx_queues[queue_idx] = rxq; |
| 370 | |
| 371 | rc = bnxt_init_rx_ring_struct(rxq, socket_id); |
| 372 | if (rc) { |
| 373 | PMD_DRV_LOG(ERR, |
| 374 | "init_rx_ring_struct failed!\n"); |
| 375 | goto err; |
nothing calls this directly
no test coverage detected