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

Function ice_load_pkg

dpdk/drivers/net/ice/ice_ethdev.c:1840–1893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1838}
1839
1840int ice_load_pkg(struct ice_adapter *adapter, bool use_dsn, uint64_t dsn)
1841{
1842 struct ice_hw *hw = &adapter->hw;
1843 char pkg_file[ICE_MAX_PKG_FILENAME_SIZE];
1844 char opt_ddp_filename[ICE_MAX_PKG_FILENAME_SIZE];
1845 void *buf;
1846 size_t bufsz;
1847 int err;
1848
1849 if (!use_dsn)
1850 goto no_dsn;
1851
1852 memset(opt_ddp_filename, 0, ICE_MAX_PKG_FILENAME_SIZE);
1853 snprintf(opt_ddp_filename, ICE_MAX_PKG_FILENAME_SIZE,
1854 "ice-%016" PRIx64 ".pkg", dsn);
1855 strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_UPDATES,
1856 ICE_MAX_PKG_FILENAME_SIZE);
1857 strcat(pkg_file, opt_ddp_filename);
1858 if (rte_firmware_read(pkg_file, &buf, &bufsz) == 0)
1859 goto load_fw;
1860
1861 strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_DEFAULT,
1862 ICE_MAX_PKG_FILENAME_SIZE);
1863 strcat(pkg_file, opt_ddp_filename);
1864 if (rte_firmware_read(pkg_file, &buf, &bufsz) == 0)
1865 goto load_fw;
1866
1867no_dsn:
1868 strncpy(pkg_file, ICE_PKG_FILE_UPDATES, ICE_MAX_PKG_FILENAME_SIZE);
1869 if (rte_firmware_read(pkg_file, &buf, &bufsz) == 0)
1870 goto load_fw;
1871
1872 strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
1873 if (rte_firmware_read(pkg_file, &buf, &bufsz) < 0) {
1874 PMD_INIT_LOG(ERR, "failed to search file path");
1875 return -1;
1876 }
1877
1878load_fw:
1879 PMD_INIT_LOG(DEBUG, "DDP package name: %s", pkg_file);
1880
1881 err = ice_copy_and_init_pkg(hw, buf, bufsz);
1882 if (!ice_is_init_pkg_successful(err)) {
1883 PMD_INIT_LOG(ERR, "ice_copy_and_init_hw failed: %d", err);
1884 free(buf);
1885 return -1;
1886 }
1887
1888 /* store the loaded pkg type info */
1889 adapter->active_pkg_type = ice_load_pkg_type(hw);
1890
1891 free(buf);
1892 return 0;
1893}
1894
1895static void
1896ice_base_queue_get(struct ice_pf *pf)

Callers 2

ice_dcf_load_pkgFunction · 0.85
ice_dev_initFunction · 0.85

Calls 9

memsetFunction · 0.85
snprintfFunction · 0.85
strncpyFunction · 0.85
strcatFunction · 0.85
ice_copy_and_init_pkgFunction · 0.85
ice_load_pkg_typeFunction · 0.85
rte_firmware_readFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected