drivers/net/ethernet/intel/ice/ice_ddp.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_ddp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ice/ice_ddp.c- Extension
.c- Size
- 71400 bytes
- Lines
- 2548
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ice_common.hice.hice_ddp.hice_sched.h
Detected Declarations
struct ice_ddp_send_ctxfunction ice_verify_pkgfunction ice_free_segfunction ice_chk_pkg_versionfunction detectedfunction ice_pkg_advance_sectfunction ice_get_prof_index_maxfunction ice_get_ddp_pkg_statefunction ice_init_pkg_regsfunction ice_add_dvm_hintfunction ice_add_tunnel_hintfunction characterfunction ice_enum_labelsfunction ice_find_boost_entryfunction ice_is_init_pkg_successfulfunction ice_is_gtp_u_profilefunction ice_is_gtp_c_profilefunction ice_is_pfcp_profilefunction ice_get_sw_prof_typefunction ice_get_sw_fv_bitmapfunction ice_get_sw_fv_listfunction ice_init_prof_result_bmfunction ice_pkg_buf_freefunction ice_pkg_buf_reserve_sectionfunction ice_pkg_buf_get_active_sectionsfunction ice_map_aq_err_to_ddp_statefunction ice_acquire_global_cfg_lockfunction ice_release_global_cfg_lockfunction Packagefunction ice_is_buffer_metadatafunction ice_ddp_send_ctx_set_errfunction ice_ddp_send_hunkfunction ice_dwnld_cfg_bufs_no_lockfunction ice_get_pkg_seg_by_idxfunction ice_is_signing_seg_at_idxfunction ice_is_signing_seg_type_at_idxfunction ice_download_pkg_sig_segfunction ice_download_pkg_config_segfunction ice_is_last_sign_segfunction ice_dwnld_sign_and_cfg_segsfunction ice_match_signing_segfunction ice_post_dwnld_pkg_actionsfunction ice_download_pkg_with_sig_segfunction ice_dwnld_cfg_bufsfunction ice_download_pkg_without_sig_segfunction ice_download_pkgfunction Listfunction Package
Annotated Snippet
struct ice_ddp_send_ctx {
struct ice_hw *hw;
/* private: only for ice_ddp_send_hunk() */
struct ice_buf_hdr *hdr;
int err;
};
static void ice_ddp_send_ctx_set_err(struct ice_ddp_send_ctx *ctx, int err)
{
ctx->err = err;
}
/**
* ice_ddp_send_hunk - send one hunk of data to FW
* @ctx: current segment sending context
* @hunk: next hunk to send, size is always ICE_PKG_BUF_SIZE
*
* Send the next hunk of data to FW, retrying if needed.
*
* Notice: must be called once more with a NULL @hunk to finish up; such call
* will set up the "last" bit of an AQ request. After such call @ctx.hdr is
* cleared, @hw is still valid.
*
* Return: %ICE_DDP_PKG_SUCCESS if there were no problems; a sticky @err
* otherwise.
*/
static enum ice_ddp_state ice_ddp_send_hunk(struct ice_ddp_send_ctx *ctx,
struct ice_buf_hdr *hunk)
{
struct ice_buf_hdr *prev_hunk = ctx->hdr;
struct ice_hw *hw = ctx->hw;
bool prev_was_last = !hunk;
enum libie_aq_err aq_err;
u32 offset, info;
int attempt, err;
if (ctx->err)
return ctx->err;
ctx->hdr = hunk;
if (!prev_hunk)
return ICE_DDP_PKG_SUCCESS; /* no problem so far */
for (attempt = 0; attempt < 5; attempt++) {
if (attempt)
msleep(20);
err = ice_aq_download_pkg(hw, prev_hunk, ICE_PKG_BUF_SIZE,
prev_was_last, &offset, &info, NULL);
aq_err = hw->adminq.sq_last_status;
if (aq_err != LIBIE_AQ_RC_ENOSEC &&
aq_err != LIBIE_AQ_RC_EBADSIG)
break;
}
if (err) {
ice_debug(hw, ICE_DBG_PKG, "Pkg download failed: err %d off %d inf %d\n",
err, offset, info);
ctx->err = ice_map_aq_err_to_ddp_state(aq_err);
} else if (attempt) {
dev_dbg(ice_hw_to_dev(hw),
"ice_aq_download_pkg number of retries: %d\n", attempt);
}
return ctx->err;
}
/**
* ice_dwnld_cfg_bufs_no_lock
* @ctx: context of the current buffers section to send
* @bufs: pointer to an array of buffers
* @start: buffer index of first buffer to download
* @count: the number of buffers to download
*
* Downloads package configuration buffers to the firmware. Metadata buffers
* are skipped, and the first metadata buffer found indicates that the rest
* of the buffers are all metadata buffers.
*/
static enum ice_ddp_state
ice_dwnld_cfg_bufs_no_lock(struct ice_ddp_send_ctx *ctx, struct ice_buf *bufs,
u32 start, u32 count)
{
struct ice_buf_hdr *bh;
enum ice_ddp_state err;
if (!bufs || !count) {
ice_ddp_send_ctx_set_err(ctx, ICE_DDP_PKG_ERR);
return ICE_DDP_PKG_ERR;
}
Annotation
- Immediate include surface: `ice_common.h`, `ice.h`, `ice_ddp.h`, `ice_sched.h`.
- Detected declarations: `struct ice_ddp_send_ctx`, `function ice_verify_pkg`, `function ice_free_seg`, `function ice_chk_pkg_version`, `function detected`, `function ice_pkg_advance_sect`, `function ice_get_prof_index_max`, `function ice_get_ddp_pkg_state`, `function ice_init_pkg_regs`, `function ice_add_dvm_hint`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.