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

Function rte_eth_dev_info_get

dpdk/lib/ethdev/rte_ethdev.c:3780–3842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3778}
3779
3780int
3781rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
3782{
3783 struct rte_eth_dev *dev;
3784 const struct rte_eth_desc_lim lim = {
3785 .nb_max = UINT16_MAX,
3786 .nb_min = 0,
3787 .nb_align = 1,
3788 .nb_seg_max = UINT16_MAX,
3789 .nb_mtu_seg_max = UINT16_MAX,
3790 };
3791 int diag;
3792
3793 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3794 dev = &rte_eth_devices[port_id];
3795
3796 if (dev_info == NULL) {
3797 RTE_ETHDEV_LOG(ERR, "Cannot get ethdev port %u info to NULL\n",
3798 port_id);
3799 return -EINVAL;
3800 }
3801
3802 /*
3803 * Init dev_info before port_id check since caller does not have
3804 * return status and does not know if get is successful or not.
3805 */
3806 memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
3807 dev_info->switch_info.domain_id = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID;
3808
3809 dev_info->rx_desc_lim = lim;
3810 dev_info->tx_desc_lim = lim;
3811 dev_info->device = dev->device;
3812 dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -
3813 RTE_ETHER_CRC_LEN;
3814 dev_info->max_mtu = UINT16_MAX;
3815 dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
3816 dev_info->max_rx_bufsize = UINT32_MAX;
3817
3818 if (*dev->dev_ops->dev_infos_get == NULL)
3819 return -ENOTSUP;
3820 diag = (*dev->dev_ops->dev_infos_get)(dev, dev_info);
3821 if (diag != 0) {
3822 /* Cleanup already filled in device information */
3823 memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
3824 return eth_err(port_id, diag);
3825 }
3826
3827 /* Maximum number of queues should be <= RTE_MAX_QUEUES_PER_PORT */
3828 dev_info->max_rx_queues = RTE_MIN(dev_info->max_rx_queues,
3829 RTE_MAX_QUEUES_PER_PORT);
3830 dev_info->max_tx_queues = RTE_MIN(dev_info->max_tx_queues,
3831 RTE_MAX_QUEUES_PER_PORT);
3832
3833 dev_info->driver_name = dev->device->driver->name;
3834 dev_info->nb_rx_queues = dev->data->nb_rx_queues;
3835 dev_info->nb_tx_queues = dev->data->nb_tx_queues;
3836
3837 dev_info->dev_flags = &dev->data->dev_flags;

Callers 15

init_port_startFunction · 0.85
create_tcp_flowFunction · 0.85
create_ipip_flowFunction · 0.85
set_pdump_rxtx_cbsFunction · 0.85
rte_pdump_statsFunction · 0.85
reader_createFunction · 0.85
writer_createFunction · 0.85
rte_pcapng_add_interfaceFunction · 0.85
rte_eth_dev_configureFunction · 0.85
rte_eth_dev_startFunction · 0.85
rte_eth_rx_queue_setupFunction · 0.85

Calls 2

memsetFunction · 0.85
eth_errFunction · 0.85

Tested by 15

port_init_commonFunction · 0.68
ethdev_api_queue_statusFunction · 0.68
tx_adapter_instance_getFunction · 0.68
test_propagateFunction · 0.68
test_rssFunction · 0.68
test_rss_config_lazyFunction · 0.68