Reset dynamic txgbe_rx_queue fields back to defaults */
| 2523 | |
| 2524 | /* Reset dynamic txgbe_rx_queue fields back to defaults */ |
| 2525 | static void __rte_cold |
| 2526 | txgbe_reset_rx_queue(struct txgbe_adapter *adapter, struct txgbe_rx_queue *rxq) |
| 2527 | { |
| 2528 | static const struct txgbe_rx_desc zeroed_desc = { |
| 2529 | {{0}, {0} }, {{0}, {0} } }; |
| 2530 | unsigned int i; |
| 2531 | uint16_t len = rxq->nb_rx_desc; |
| 2532 | |
| 2533 | /* |
| 2534 | * By default, the Rx queue setup function allocates enough memory for |
| 2535 | * TXGBE_RING_DESC_MAX. The Rx Burst bulk allocation function requires |
| 2536 | * extra memory at the end of the descriptor ring to be zero'd out. |
| 2537 | */ |
| 2538 | if (adapter->rx_bulk_alloc_allowed) |
| 2539 | /* zero out extra memory */ |
| 2540 | len += RTE_PMD_TXGBE_RX_MAX_BURST; |
| 2541 | |
| 2542 | /* |
| 2543 | * Zero out HW ring memory. Zero out extra memory at the end of |
| 2544 | * the H/W ring so look-ahead logic in Rx Burst bulk alloc function |
| 2545 | * reads extra memory as zeros. |
| 2546 | */ |
| 2547 | for (i = 0; i < len; i++) |
| 2548 | rxq->rx_ring[i] = zeroed_desc; |
| 2549 | |
| 2550 | /* |
| 2551 | * initialize extra software ring entries. Space for these extra |
| 2552 | * entries is always allocated |
| 2553 | */ |
| 2554 | memset(&rxq->fake_mbuf, 0x0, sizeof(rxq->fake_mbuf)); |
| 2555 | for (i = rxq->nb_rx_desc; i < len; ++i) |
| 2556 | rxq->sw_ring[i].mbuf = &rxq->fake_mbuf; |
| 2557 | |
| 2558 | rxq->rx_nb_avail = 0; |
| 2559 | rxq->rx_next_avail = 0; |
| 2560 | rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1); |
| 2561 | rxq->rx_tail = 0; |
| 2562 | rxq->nb_rx_hold = 0; |
| 2563 | rte_pktmbuf_free(rxq->pkt_first_seg); |
| 2564 | rxq->pkt_first_seg = NULL; |
| 2565 | rxq->pkt_last_seg = NULL; |
| 2566 | } |
| 2567 | |
| 2568 | int __rte_cold |
| 2569 | txgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, |
no test coverage detected