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

Function ena_config_host_info

dpdk/drivers/net/ena/ena_ethdev.c:761–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759}
760
761static void ena_config_host_info(struct ena_com_dev *ena_dev)
762{
763 struct ena_admin_host_info *host_info;
764 int rc;
765
766 /* Allocate only the host info */
767 rc = ena_com_allocate_host_info(ena_dev);
768 if (rc) {
769 PMD_DRV_LOG(ERR, "Cannot allocate host info\n");
770 return;
771 }
772
773 host_info = ena_dev->host_attr.host_info;
774
775 host_info->os_type = ENA_ADMIN_OS_DPDK;
776 host_info->kernel_ver = RTE_VERSION;
777 strlcpy((char *)host_info->kernel_ver_str, rte_version(),
778 sizeof(host_info->kernel_ver_str));
779 host_info->os_dist = RTE_VERSION;
780 strlcpy((char *)host_info->os_dist_str, rte_version(),
781 sizeof(host_info->os_dist_str));
782 host_info->driver_version =
783 (DRV_MODULE_VER_MAJOR) |
784 (DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |
785 (DRV_MODULE_VER_SUBMINOR <<
786 ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT);
787 host_info->num_cpus = rte_lcore_count();
788
789 host_info->driver_supported_features =
790 ENA_ADMIN_HOST_INFO_RX_OFFSET_MASK |
791 ENA_ADMIN_HOST_INFO_RSS_CONFIGURABLE_FUNCTION_KEY_MASK;
792
793 rc = ena_com_set_host_attributes(ena_dev);
794 if (rc) {
795 if (rc == ENA_COM_UNSUPPORTED)
796 PMD_DRV_LOG(WARNING, "Cannot set host attributes\n");
797 else
798 PMD_DRV_LOG(ERR, "Cannot set host attributes\n");
799
800 goto err;
801 }
802
803 return;
804
805err:
806 ena_com_delete_host_info(ena_dev);
807}
808
809/* This function calculates the number of xstats based on the current config */
810static unsigned int ena_xstats_calc_num(struct rte_eth_dev_data *data)

Callers 1

ena_device_initFunction · 0.85

Calls 6

rte_versionFunction · 0.85
rte_lcore_countFunction · 0.85
strlcpyFunction · 0.50
ena_com_delete_host_infoFunction · 0.50

Tested by

no test coverage detected