MCPcopy Create free account
hub / github.com/F-Stack/f-stack / txgbe_set_rx_function

Function txgbe_set_rx_function

dpdk/drivers/net/txgbe/txgbe_rxtx.c:4227–4300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4225}
4226
4227void __rte_cold
4228txgbe_set_rx_function(struct rte_eth_dev *dev)
4229{
4230 uint16_t i;
4231 struct txgbe_adapter *adapter = TXGBE_DEV_ADAPTER(dev);
4232
4233 /*
4234 * Initialize the appropriate LRO callback.
4235 *
4236 * If all queues satisfy the bulk allocation preconditions
4237 * (adapter->rx_bulk_alloc_allowed is TRUE) then we may use
4238 * bulk allocation. Otherwise use a single allocation version.
4239 */
4240 if (dev->data->lro) {
4241 if (adapter->rx_bulk_alloc_allowed) {
4242 PMD_INIT_LOG(DEBUG, "LRO is requested. Using a bulk "
4243 "allocation version");
4244 dev->rx_pkt_burst = txgbe_recv_pkts_lro_bulk_alloc;
4245 } else {
4246 PMD_INIT_LOG(DEBUG, "LRO is requested. Using a single "
4247 "allocation version");
4248 dev->rx_pkt_burst = txgbe_recv_pkts_lro_single_alloc;
4249 }
4250 } else if (dev->data->scattered_rx) {
4251 /*
4252 * Set the non-LRO scattered callback: there are bulk and
4253 * single allocation versions.
4254 */
4255 if (adapter->rx_bulk_alloc_allowed) {
4256 PMD_INIT_LOG(DEBUG, "Using a Scattered with bulk "
4257 "allocation callback (port=%d).",
4258 dev->data->port_id);
4259 dev->rx_pkt_burst = txgbe_recv_pkts_lro_bulk_alloc;
4260 } else {
4261 PMD_INIT_LOG(DEBUG, "Using Regular (non-vector, "
4262 "single allocation) "
4263 "Scattered Rx callback "
4264 "(port=%d).",
4265 dev->data->port_id);
4266
4267 dev->rx_pkt_burst = txgbe_recv_pkts_lro_single_alloc;
4268 }
4269 /*
4270 * Below we set "simple" callbacks according to port/queues parameters.
4271 * If parameters allow we are going to choose between the following
4272 * callbacks:
4273 * - Bulk Allocation
4274 * - Single buffer allocation (the simplest one)
4275 */
4276 } else if (adapter->rx_bulk_alloc_allowed) {
4277 PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are "
4278 "satisfied. Rx Burst Bulk Alloc function "
4279 "will be used on port=%d.",
4280 dev->data->port_id);
4281
4282 dev->rx_pkt_burst = txgbe_recv_pkts_bulk_alloc;
4283 } else {
4284 PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are not "

Callers 4

eth_txgbevf_dev_initFunction · 0.85
txgbe_dev_rx_initFunction · 0.85
txgbevf_dev_rx_initFunction · 0.85
eth_txgbe_dev_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected