For components that make a copy of an external pipeline package file
(i.e. the Linux and FreeBSD drivers), save the size of the package
file along with the copy so that both can be used when calling
ice_init_pkg() after a CORER/GLOBR reset.
Also, do not free the copy of the package file in ice_init_pkg()
since it is needed afterward for subsequent resets.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
if (hw->pkg_copy) {
ice_free(hw, hw->pkg_copy);
hw->pkg_copy = NULL;
+ hw->pkg_size = 0;
}
hw->seg = NULL;
}
status = ICE_SUCCESS;
}
- /* Free a previous segment, if necessary */
- ice_free_seg(hw);
if (!status) {
hw->seg = seg;
/* on successful package download, update other required
buf_copy = (u8 *)ice_memdup(hw, buf, len, ICE_NONDMA_TO_NONDMA);
status = ice_init_pkg(hw, buf_copy, len);
- if (status)
+ if (status) {
/* Free the copy, since we failed to initialize the package */
ice_free(hw, buf_copy);
- else
+ } else {
/* Track the copied pkg so we can free it later */
hw->pkg_copy = buf_copy;
+ hw->pkg_size = len;
+ }
return status;
}
/* Pointer to allocated copy of pkg memory */
u8 *pkg_copy;
+ u32 pkg_size;
/* tunneling info */
struct ice_tunnel_table tnl;