[Intel-wired-lan] [PATCH net-next v9 3/5] ice: add ability to set FW log configuration
Paul M Stillwell Jr
paul.m.stillwell.jr at intel.com
Mon Mar 6 22:11:08 UTC 2023
On 3/3/2023 3:21 PM, Tony Nguyen wrote:
> On 3/2/2023 1:51 PM, Paul M Stillwell Jr wrote:
>
> [...]
>
>> +/**
>> + * ice_pf_fwlog_update_modules - update 1 or more modules via debugfs
>> + * @pf: pointer to the PF struct
>> + * @log_level: log_level to use for the @events
>> + * @events: events to update
>> + */
>> +int ice_pf_fwlog_update_modules(struct ice_pf *pf, u8 log_level,
>> + unsigned long events)
>> +{
>> + struct ice_fwlog_module_entry *entries;
>> + u16 module_id, max_bits;
>> + struct ice_hw *hw = &pf->hw;
>
> In addition to what lkp reported. RCT
>
Done
>> +
>> + if (log_level >= ICE_FWLOG_LEVEL_INVALID) {
>> + dev_err(ice_pf_to_dev(pf), "Invalid FW log level %u, all
>> level(s) >= %u are invalid\n",
>> + log_level, ICE_FWLOG_LEVEL_INVALID);
>> + return -EINVAL;
>> + }
>> +
>> + if (events >= BIT(ICE_AQC_FW_LOG_ID_MAX)) {
>> + dev_err(ice_pf_to_dev(pf), "Invalid FW log events 0x%lx, all
>> FW log event bits >= 0x%lx are invalid\n",
>> + events, BIT(ICE_AQC_FW_LOG_ID_MAX));
>> + return -EINVAL;
>> + }
>> +
>> + entries = (struct ice_fwlog_module_entry
>> *)hw->fwlog_cfg.module_entries;
>> +
>> + max_bits = min_t(u16, BITS_PER_TYPE(unsigned long),
>> + ICE_AQC_FW_LOG_ID_MAX);
>> +
>> + for_each_set_bit(module_id, &events, max_bits) {
>> + entries[module_id].log_level = log_level;
>> + }
>> +
>> + return 0;
>> +}
>> +
>> /**
>> * ice_register_netdev - register netdev
>> * @vsi: pointer to the VSI struct
More information about the Intel-wired-lan
mailing list