- err = stat(pkg_file, &fstat);
- if (err) {
- PMD_INIT_LOG(ERR, "failed to get file stats\n");
- goto out;
- }
-
- buf_len = fstat.st_size;
- buf = rte_malloc(NULL, buf_len, 0);
-
- if (!buf) {
- PMD_INIT_LOG(ERR, "failed to allocate buf of size %d for package\n",
- buf_len);
- err = -1;
- goto out;
- }
-
- err = fread(buf, buf_len, 1, file);
- if (err != 1) {
- PMD_INIT_LOG(ERR, "failed to read package data\n");
- err = -1;
- goto out;
- }
-
- err = ice_copy_and_init_pkg(hw, buf, buf_len);