MCPcopy Index your code
hub / github.com/F-Stack/f-stack / eth_dev_rx_queue_config

Function eth_dev_rx_queue_config

dpdk/lib/ethdev/ethdev_private.c:413–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413int
414eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)
415{
416 uint16_t old_nb_queues = dev->data->nb_rx_queues;
417 unsigned int i;
418
419 if (dev->data->rx_queues == NULL && nb_queues != 0) { /* first time configuration */
420 dev->data->rx_queues = rte_zmalloc("ethdev->rx_queues",
421 sizeof(dev->data->rx_queues[0]) *
422 RTE_MAX_QUEUES_PER_PORT,
423 RTE_CACHE_LINE_SIZE);
424 if (dev->data->rx_queues == NULL) {
425 dev->data->nb_rx_queues = 0;
426 return -(ENOMEM);
427 }
428 } else if (dev->data->rx_queues != NULL && nb_queues != 0) { /* re-configure */
429 for (i = nb_queues; i < old_nb_queues; i++)
430 eth_dev_rxq_release(dev, i);
431
432 } else if (dev->data->rx_queues != NULL && nb_queues == 0) {
433 for (i = nb_queues; i < old_nb_queues; i++)
434 eth_dev_rxq_release(dev, i);
435
436 rte_free(dev->data->rx_queues);
437 dev->data->rx_queues = NULL;
438 }
439 dev->data->nb_rx_queues = nb_queues;
440 return 0;
441}
442
443int
444eth_dev_tx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)

Callers 2

rte_eth_dev_configureFunction · 0.85

Calls 3

rte_zmallocFunction · 0.85
eth_dev_rxq_releaseFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected