/* convert the number of bytes into a number of 4K buffers. externally *thedriverpresentstheinterfacetotheFWlogdataasanumberof *bytesbecausethat'seasyforuserstounderstand.internallythe *driverusesaringofbuffersbecausethedriverdoesn'tknowwhere *thebeginningandendofanylineoflogdataissothedriverhas *tooverwritedataascompleteblocks.whenthedataisreturnedto *theuserthedriverknowsthatthedataiscorrectandtheFWlog *canbecorrectlyparsedbythetools
*/
ring_size = ICE_FWLOG_INDEX_TO_BYTES(index) / ICE_AQ_MAX_BUF_LEN; if (ring_size == hw->fwlog_ring.size) return;
/* allocate space for the new rings and buffers then release the *oldringsandbuffers.thatwayifwedon'thaveenough *memorythenweatleasthavewhatwehadbefore
*/
ring.rings = kcalloc(ring_size, sizeof(*ring.rings), GFP_KERNEL); if (!ring.rings) return;
ring.size = ring_size;
status = ice_fwlog_alloc_ring_buffs(&ring); if (status) {
dev_warn(ice_hw_to_dev(hw), "Unable to allocate memory for FW log ring data buffers\n");
ice_fwlog_free_ring_buffs(&ring);
kfree(ring.rings); return;
}
status = ice_fwlog_alloc_ring_buffs(&hw->fwlog_ring); if (status) {
dev_warn(ice_hw_to_dev(hw), "Unable to allocate memory for FW log ring data buffers\n");
ice_fwlog_free_ring_buffs(&hw->fwlog_ring);
kfree(hw->fwlog_ring.rings); return status;
}
ice_debugfs_fwlog_init(hw->back);
} else {
dev_warn(ice_hw_to_dev(hw), "FW logging is not supported in this NVM image. Please update the NVM to get FW log support\n");
}
/* only support fw log commands on PF 0 */ if (hw->bus.func) return;
ice_debugfs_pf_deinit(hw->back);
/* make sure FW logging is disabled to not put the FW in a weird state *forthenextdriverload
*/
hw->fwlog_cfg.options &= ~ICE_FWLOG_OPTION_ARQ_ENA;
status = ice_fwlog_set(hw, &hw->fwlog_cfg); if (status)
dev_warn(ice_hw_to_dev(hw), "Unable to turn off FW logging, status: %d\n",
status);
kfree(pf->ice_debugfs_pf_fwlog_modules);
pf->ice_debugfs_pf_fwlog_modules = NULL;
status = ice_fwlog_unregister(hw); if (status)
dev_warn(ice_hw_to_dev(hw), "Unable to unregister FW logging, status: %d\n",
status);
if (hw->fwlog_ring.rings) {
ice_fwlog_free_ring_buffs(&hw->fwlog_ring);
kfree(hw->fwlog_ring.rings);
}
}
status = ice_aq_send_cmd(hw, &desc, buf, ICE_AQ_MAX_BUF_LEN, NULL); if (status) {
ice_debug(hw, ICE_DBG_FW_LOG, "Failed to get FW log configuration\n"); goto status_out;
}
module_id_cnt = le16_to_cpu(cmd->ops.cfg.mdl_cnt); if (module_id_cnt < ICE_AQC_FW_LOG_ID_MAX) {
ice_debug(hw, ICE_DBG_FW_LOG, "FW returned less than the expected number of FW log module IDs\n");
} elseif (module_id_cnt > ICE_AQC_FW_LOG_ID_MAX) {
ice_debug(hw, ICE_DBG_FW_LOG, "FW returned more than expected number of FW log module IDs, setting module_id_cnt to software expected max %u\n",
ICE_AQC_FW_LOG_ID_MAX);
module_id_cnt = ICE_AQC_FW_LOG_ID_MAX;
}
cfg->log_resolution = le16_to_cpu(cmd->ops.cfg.log_resolution); if (cmd->cmd_flags & ICE_AQC_FW_LOG_CONF_AQ_EN)
cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA; if (cmd->cmd_flags & ICE_AQC_FW_LOG_CONF_UART_EN)
cfg->options |= ICE_FWLOG_OPTION_UART_ENA; if (cmd->cmd_flags & ICE_AQC_FW_LOG_QUERY_REGISTERED)
cfg->options |= ICE_FWLOG_OPTION_IS_REGISTERED;
/** *ice_fwlog_register-RegisterthePFforfirmwarelogging *@hw:pointertotheHWstructure * *AfterthiscallthePFwillstarttoreceivefirmwareloggingbasedonthe *configurationsetinice_fwlog_set.
*/ int ice_fwlog_register(struct ice_hw *hw)
{ int status;
if (!ice_fwlog_supported(hw)) return -EOPNOTSUPP;
status = ice_aq_fwlog_register(hw, true); if (status)
ice_debug(hw, ICE_DBG_FW_LOG, "Failed to register for firmware logging events over ARQ\n"); else
hw->fwlog_cfg.options |= ICE_FWLOG_OPTION_IS_REGISTERED;
return status;
}
/** *ice_fwlog_unregister-UnregisterthePFfromfirmwarelogging *@hw:pointertotheHWstructure
*/ int ice_fwlog_unregister(struct ice_hw *hw)
{ int status;
if (!ice_fwlog_supported(hw)) return -EOPNOTSUPP;
status = ice_aq_fwlog_register(hw, false); if (status)
ice_debug(hw, ICE_DBG_FW_LOG, "Failed to unregister from firmware logging events over ARQ\n"); else
hw->fwlog_cfg.options &= ~ICE_FWLOG_OPTION_IS_REGISTERED;
cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); if (!cfg) return;
/* don't call ice_fwlog_get() because that would check to see if FW *loggingissupportedwhichiswhatthedriverisdeterminingnow
*/
status = ice_aq_fwlog_get(hw, cfg); if (status)
ice_debug(hw, ICE_DBG_FW_LOG, "ice_aq_fwlog_get failed, FW logging is not supported on this version of FW, status %d\n",
status); else
hw->fwlog_supported = true;
kfree(cfg);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-10-03)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.