Reset dynamic ngbe_rx_queue fields back to defaults */
| 2153 | |
| 2154 | /* Reset dynamic ngbe_rx_queue fields back to defaults */ |
| 2155 | static void |
| 2156 | ngbe_reset_rx_queue(struct ngbe_adapter *adapter, struct ngbe_rx_queue *rxq) |
| 2157 | { |
| 2158 | static const struct ngbe_rx_desc zeroed_desc = { |
| 2159 | {{0}, {0} }, {{0}, {0} } }; |
| 2160 | unsigned int i; |
| 2161 | uint16_t len = rxq->nb_rx_desc; |
| 2162 | |
| 2163 | /* |
| 2164 | * By default, the Rx queue setup function allocates enough memory for |
| 2165 | * NGBE_RING_DESC_MAX. The Rx Burst bulk allocation function requires |
| 2166 | * extra memory at the end of the descriptor ring to be zero'd out. |
| 2167 | */ |
| 2168 | if (adapter->rx_bulk_alloc_allowed) |
| 2169 | /* zero out extra memory */ |
| 2170 | len += RTE_PMD_NGBE_RX_MAX_BURST; |
| 2171 | |
| 2172 | /* |
| 2173 | * Zero out HW ring memory. Zero out extra memory at the end of |
| 2174 | * the H/W ring so look-ahead logic in Rx Burst bulk alloc function |
| 2175 | * reads extra memory as zeros. |
| 2176 | */ |
| 2177 | for (i = 0; i < len; i++) |
| 2178 | rxq->rx_ring[i] = zeroed_desc; |
| 2179 | |
| 2180 | /* |
| 2181 | * initialize extra software ring entries. Space for these extra |
| 2182 | * entries is always allocated |
| 2183 | */ |
| 2184 | memset(&rxq->fake_mbuf, 0x0, sizeof(rxq->fake_mbuf)); |
| 2185 | for (i = rxq->nb_rx_desc; i < len; ++i) |
| 2186 | rxq->sw_ring[i].mbuf = &rxq->fake_mbuf; |
| 2187 | |
| 2188 | rxq->rx_nb_avail = 0; |
| 2189 | rxq->rx_next_avail = 0; |
| 2190 | rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1); |
| 2191 | rxq->rx_tail = 0; |
| 2192 | rxq->nb_rx_hold = 0; |
| 2193 | rte_pktmbuf_free(rxq->pkt_first_seg); |
| 2194 | rxq->pkt_first_seg = NULL; |
| 2195 | rxq->pkt_last_seg = NULL; |
| 2196 | } |
| 2197 | |
| 2198 | uint64_t |
| 2199 | ngbe_get_rx_queue_offloads(struct rte_eth_dev *dev __rte_unused) |
no test coverage detected