Skip to content

Commit 1953fc7

Browse files
pmstillwanguy11
authored andcommitted
ice: remove FW logging code
The FW logging code doesn't work because there is no way to set cq_ena or uart_ena so remove the code. This code is the original (v1) way of FW logging so it should be replaced with the v2 way. Signed-off-by: Paul M Stillwell Jr <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 1b66601 commit 1953fc7

File tree

5 files changed

+0
-319
lines changed

5 files changed

+0
-319
lines changed

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,78 +2094,6 @@ struct ice_aqc_add_rdma_qset_data {
20942094
struct ice_aqc_add_tx_rdma_qset_entry rdma_qsets[];
20952095
};
20962096

2097-
/* Configure Firmware Logging Command (indirect 0xFF09)
2098-
* Logging Information Read Response (indirect 0xFF10)
2099-
* Note: The 0xFF10 command has no input parameters.
2100-
*/
2101-
struct ice_aqc_fw_logging {
2102-
u8 log_ctrl;
2103-
#define ICE_AQC_FW_LOG_AQ_EN BIT(0)
2104-
#define ICE_AQC_FW_LOG_UART_EN BIT(1)
2105-
u8 rsvd0;
2106-
u8 log_ctrl_valid; /* Not used by 0xFF10 Response */
2107-
#define ICE_AQC_FW_LOG_AQ_VALID BIT(0)
2108-
#define ICE_AQC_FW_LOG_UART_VALID BIT(1)
2109-
u8 rsvd1[5];
2110-
__le32 addr_high;
2111-
__le32 addr_low;
2112-
};
2113-
2114-
enum ice_aqc_fw_logging_mod {
2115-
ICE_AQC_FW_LOG_ID_GENERAL = 0,
2116-
ICE_AQC_FW_LOG_ID_CTRL,
2117-
ICE_AQC_FW_LOG_ID_LINK,
2118-
ICE_AQC_FW_LOG_ID_LINK_TOPO,
2119-
ICE_AQC_FW_LOG_ID_DNL,
2120-
ICE_AQC_FW_LOG_ID_I2C,
2121-
ICE_AQC_FW_LOG_ID_SDP,
2122-
ICE_AQC_FW_LOG_ID_MDIO,
2123-
ICE_AQC_FW_LOG_ID_ADMINQ,
2124-
ICE_AQC_FW_LOG_ID_HDMA,
2125-
ICE_AQC_FW_LOG_ID_LLDP,
2126-
ICE_AQC_FW_LOG_ID_DCBX,
2127-
ICE_AQC_FW_LOG_ID_DCB,
2128-
ICE_AQC_FW_LOG_ID_NETPROXY,
2129-
ICE_AQC_FW_LOG_ID_NVM,
2130-
ICE_AQC_FW_LOG_ID_AUTH,
2131-
ICE_AQC_FW_LOG_ID_VPD,
2132-
ICE_AQC_FW_LOG_ID_IOSF,
2133-
ICE_AQC_FW_LOG_ID_PARSER,
2134-
ICE_AQC_FW_LOG_ID_SW,
2135-
ICE_AQC_FW_LOG_ID_SCHEDULER,
2136-
ICE_AQC_FW_LOG_ID_TXQ,
2137-
ICE_AQC_FW_LOG_ID_RSVD,
2138-
ICE_AQC_FW_LOG_ID_POST,
2139-
ICE_AQC_FW_LOG_ID_WATCHDOG,
2140-
ICE_AQC_FW_LOG_ID_TASK_DISPATCH,
2141-
ICE_AQC_FW_LOG_ID_MNG,
2142-
ICE_AQC_FW_LOG_ID_MAX,
2143-
};
2144-
2145-
/* Defines for both above FW logging command/response buffers */
2146-
#define ICE_AQC_FW_LOG_ID_S 0
2147-
#define ICE_AQC_FW_LOG_ID_M (0xFFF << ICE_AQC_FW_LOG_ID_S)
2148-
2149-
#define ICE_AQC_FW_LOG_CONF_SUCCESS 0 /* Used by response */
2150-
#define ICE_AQC_FW_LOG_CONF_BAD_INDX BIT(12) /* Used by response */
2151-
2152-
#define ICE_AQC_FW_LOG_EN_S 12
2153-
#define ICE_AQC_FW_LOG_EN_M (0xF << ICE_AQC_FW_LOG_EN_S)
2154-
#define ICE_AQC_FW_LOG_INFO_EN BIT(12) /* Used by command */
2155-
#define ICE_AQC_FW_LOG_INIT_EN BIT(13) /* Used by command */
2156-
#define ICE_AQC_FW_LOG_FLOW_EN BIT(14) /* Used by command */
2157-
#define ICE_AQC_FW_LOG_ERR_EN BIT(15) /* Used by command */
2158-
2159-
/* Get/Clear FW Log (indirect 0xFF11) */
2160-
struct ice_aqc_get_clear_fw_log {
2161-
u8 flags;
2162-
#define ICE_AQC_FW_LOG_CLEAR BIT(0)
2163-
#define ICE_AQC_FW_LOG_MORE_DATA_AVAIL BIT(1)
2164-
u8 rsvd1[7];
2165-
__le32 addr_high;
2166-
__le32 addr_low;
2167-
};
2168-
21692097
/* Download Package (indirect 0x0C40) */
21702098
/* Also used for Update Package (indirect 0x0C41 and 0x0C42) */
21712099
struct ice_aqc_download_pkg {
@@ -2507,8 +2435,6 @@ struct ice_aq_desc {
25072435
struct ice_aqc_add_rdma_qset add_rdma_qset;
25082436
struct ice_aqc_add_get_update_free_vsi vsi_cmd;
25092437
struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res;
2510-
struct ice_aqc_fw_logging fw_logging;
2511-
struct ice_aqc_get_clear_fw_log get_clear_fw_log;
25122438
struct ice_aqc_download_pkg download_pkg;
25132439
struct ice_aqc_set_cgu_input_config set_cgu_input_config;
25142440
struct ice_aqc_get_cgu_input_config get_cgu_input_config;
@@ -2717,10 +2643,6 @@ enum ice_adminq_opc {
27172643

27182644
/* Standalone Commands/Events */
27192645
ice_aqc_opc_event_lan_overflow = 0x1001,
2720-
2721-
/* debug commands */
2722-
ice_aqc_opc_fw_logging = 0xFF09,
2723-
ice_aqc_opc_fw_logging_info = 0xFF10,
27242646
};
27252647

27262648
#endif /* _ICE_ADMINQ_CMD_H_ */

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 0 additions & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -933,216 +933,6 @@ static void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw)
933933
devm_kfree(ice_hw_to_dev(hw), sw);
934934
}
935935

936-
/**
937-
* ice_get_fw_log_cfg - get FW logging configuration
938-
* @hw: pointer to the HW struct
939-
*/
940-
static int ice_get_fw_log_cfg(struct ice_hw *hw)
941-
{
942-
struct ice_aq_desc desc;
943-
__le16 *config;
944-
int status;
945-
u16 size;
946-
947-
size = sizeof(*config) * ICE_AQC_FW_LOG_ID_MAX;
948-
config = kzalloc(size, GFP_KERNEL);
949-
if (!config)
950-
return -ENOMEM;
951-
952-
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logging_info);
953-
954-
status = ice_aq_send_cmd(hw, &desc, config, size, NULL);
955-
if (!status) {
956-
u16 i;
957-
958-
/* Save FW logging information into the HW structure */
959-
for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) {
960-
u16 v, m, flgs;
961-
962-
v = le16_to_cpu(config[i]);
963-
m = (v & ICE_AQC_FW_LOG_ID_M) >> ICE_AQC_FW_LOG_ID_S;
964-
flgs = (v & ICE_AQC_FW_LOG_EN_M) >> ICE_AQC_FW_LOG_EN_S;
965-
966-
if (m < ICE_AQC_FW_LOG_ID_MAX)
967-
hw->fw_log.evnts[m].cur = flgs;
968-
}
969-
}
970-
971-
kfree(config);
972-
973-
return status;
974-
}
975-
976-
/**
977-
* ice_cfg_fw_log - configure FW logging
978-
* @hw: pointer to the HW struct
979-
* @enable: enable certain FW logging events if true, disable all if false
980-
*
981-
* This function enables/disables the FW logging via Rx CQ events and a UART
982-
* port based on predetermined configurations. FW logging via the Rx CQ can be
983-
* enabled/disabled for individual PF's. However, FW logging via the UART can
984-
* only be enabled/disabled for all PFs on the same device.
985-
*
986-
* To enable overall FW logging, the "cq_en" and "uart_en" enable bits in
987-
* hw->fw_log need to be set accordingly, e.g. based on user-provided input,
988-
* before initializing the device.
989-
*
990-
* When re/configuring FW logging, callers need to update the "cfg" elements of
991-
* the hw->fw_log.evnts array with the desired logging event configurations for
992-
* modules of interest. When disabling FW logging completely, the callers can
993-
* just pass false in the "enable" parameter. On completion, the function will
994-
* update the "cur" element of the hw->fw_log.evnts array with the resulting
995-
* logging event configurations of the modules that are being re/configured. FW
996-
* logging modules that are not part of a reconfiguration operation retain their
997-
* previous states.
998-
*
999-
* Before resetting the device, it is recommended that the driver disables FW
1000-
* logging before shutting down the control queue. When disabling FW logging
1001-
* ("enable" = false), the latest configurations of FW logging events stored in
1002-
* hw->fw_log.evnts[] are not overridden to allow them to be reconfigured after
1003-
* a device reset.
1004-
*
1005-
* When enabling FW logging to emit log messages via the Rx CQ during the
1006-
* device's initialization phase, a mechanism alternative to interrupt handlers
1007-
* needs to be used to extract FW log messages from the Rx CQ periodically and
1008-
* to prevent the Rx CQ from being full and stalling other types of control
1009-
* messages from FW to SW. Interrupts are typically disabled during the device's
1010-
* initialization phase.
1011-
*/
1012-
static int ice_cfg_fw_log(struct ice_hw *hw, bool enable)
1013-
{
1014-
struct ice_aqc_fw_logging *cmd;
1015-
u16 i, chgs = 0, len = 0;
1016-
struct ice_aq_desc desc;
1017-
__le16 *data = NULL;
1018-
u8 actv_evnts = 0;
1019-
void *buf = NULL;
1020-
int status = 0;
1021-
1022-
if (!hw->fw_log.cq_en && !hw->fw_log.uart_en)
1023-
return 0;
1024-
1025-
/* Disable FW logging only when the control queue is still responsive */
1026-
if (!enable &&
1027-
(!hw->fw_log.actv_evnts || !ice_check_sq_alive(hw, &hw->adminq)))
1028-
return 0;
1029-
1030-
/* Get current FW log settings */
1031-
status = ice_get_fw_log_cfg(hw);
1032-
if (status)
1033-
return status;
1034-
1035-
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logging);
1036-
cmd = &desc.params.fw_logging;
1037-
1038-
/* Indicate which controls are valid */
1039-
if (hw->fw_log.cq_en)
1040-
cmd->log_ctrl_valid |= ICE_AQC_FW_LOG_AQ_VALID;
1041-
1042-
if (hw->fw_log.uart_en)
1043-
cmd->log_ctrl_valid |= ICE_AQC_FW_LOG_UART_VALID;
1044-
1045-
if (enable) {
1046-
/* Fill in an array of entries with FW logging modules and
1047-
* logging events being reconfigured.
1048-
*/
1049-
for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) {
1050-
u16 val;
1051-
1052-
/* Keep track of enabled event types */
1053-
actv_evnts |= hw->fw_log.evnts[i].cfg;
1054-
1055-
if (hw->fw_log.evnts[i].cfg == hw->fw_log.evnts[i].cur)
1056-
continue;
1057-
1058-
if (!data) {
1059-
data = devm_kcalloc(ice_hw_to_dev(hw),
1060-
ICE_AQC_FW_LOG_ID_MAX,
1061-
sizeof(*data),
1062-
GFP_KERNEL);
1063-
if (!data)
1064-
return -ENOMEM;
1065-
}
1066-
1067-
val = i << ICE_AQC_FW_LOG_ID_S;
1068-
val |= hw->fw_log.evnts[i].cfg << ICE_AQC_FW_LOG_EN_S;
1069-
data[chgs++] = cpu_to_le16(val);
1070-
}
1071-
1072-
/* Only enable FW logging if at least one module is specified.
1073-
* If FW logging is currently enabled but all modules are not
1074-
* enabled to emit log messages, disable FW logging altogether.
1075-
*/
1076-
if (actv_evnts) {
1077-
/* Leave if there is effectively no change */
1078-
if (!chgs)
1079-
goto out;
1080-
1081-
if (hw->fw_log.cq_en)
1082-
cmd->log_ctrl |= ICE_AQC_FW_LOG_AQ_EN;
1083-
1084-
if (hw->fw_log.uart_en)
1085-
cmd->log_ctrl |= ICE_AQC_FW_LOG_UART_EN;
1086-
1087-
buf = data;
1088-
len = sizeof(*data) * chgs;
1089-
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
1090-
}
1091-
}
1092-
1093-
status = ice_aq_send_cmd(hw, &desc, buf, len, NULL);
1094-
if (!status) {
1095-
/* Update the current configuration to reflect events enabled.
1096-
* hw->fw_log.cq_en and hw->fw_log.uart_en indicate if the FW
1097-
* logging mode is enabled for the device. They do not reflect
1098-
* actual modules being enabled to emit log messages. So, their
1099-
* values remain unchanged even when all modules are disabled.
1100-
*/
1101-
u16 cnt = enable ? chgs : (u16)ICE_AQC_FW_LOG_ID_MAX;
1102-
1103-
hw->fw_log.actv_evnts = actv_evnts;
1104-
for (i = 0; i < cnt; i++) {
1105-
u16 v, m;
1106-
1107-
if (!enable) {
1108-
/* When disabling all FW logging events as part
1109-
* of device's de-initialization, the original
1110-
* configurations are retained, and can be used
1111-
* to reconfigure FW logging later if the device
1112-
* is re-initialized.
1113-
*/
1114-
hw->fw_log.evnts[i].cur = 0;
1115-
continue;
1116-
}
1117-
1118-
v = le16_to_cpu(data[i]);
1119-
m = (v & ICE_AQC_FW_LOG_ID_M) >> ICE_AQC_FW_LOG_ID_S;
1120-
hw->fw_log.evnts[m].cur = hw->fw_log.evnts[m].cfg;
1121-
}
1122-
}
1123-
1124-
out:
1125-
devm_kfree(ice_hw_to_dev(hw), data);
1126-
1127-
return status;
1128-
}
1129-
1130-
/**
1131-
* ice_output_fw_log
1132-
* @hw: pointer to the HW struct
1133-
* @desc: pointer to the AQ message descriptor
1134-
* @buf: pointer to the buffer accompanying the AQ message
1135-
*
1136-
* Formats a FW Log message and outputs it via the standard driver logs.
1137-
*/
1138-
void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf)
1139-
{
1140-
ice_debug(hw, ICE_DBG_FW_LOG, "[ FW Log Msg Start ]\n");
1141-
ice_debug_array(hw, ICE_DBG_FW_LOG, 16, 1, (u8 *)buf,
1142-
le16_to_cpu(desc->datalen));
1143-
ice_debug(hw, ICE_DBG_FW_LOG, "[ FW Log Msg End ]\n");
1144-
}
1145-
1146936
/**
1147937
* ice_get_itr_intrl_gran
1148938
* @hw: pointer to the HW struct
@@ -1200,11 +990,6 @@ int ice_init_hw(struct ice_hw *hw)
1200990
if (status)
1201991
goto err_unroll_cqinit;
1202992

1203-
/* Enable FW logging. Not fatal if this fails. */
1204-
status = ice_cfg_fw_log(hw, true);
1205-
if (status)
1206-
ice_debug(hw, ICE_DBG_INIT, "Failed to enable FW logging.\n");
1207-
1208993
status = ice_clear_pf_cfg(hw);
1209994
if (status)
1210995
goto err_unroll_cqinit;
@@ -1354,8 +1139,6 @@ void ice_deinit_hw(struct ice_hw *hw)
13541139
ice_free_hw_tbls(hw);
13551140
mutex_destroy(&hw->tnl_lock);
13561141

1357-
/* Attempt to disable FW logging before shutting down control queues */
1358-
ice_cfg_fw_log(hw, false);
13591142
ice_destroy_all_ctrlq(hw);
13601143

13611144
/* Clear VSI contexts if not already cleared */

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ ice_aq_cfg_lan_txq(struct ice_hw *hw, struct ice_aqc_cfg_txqs_buf *buf,
200200
struct ice_sq_cd *cd);
201201
int ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);
202202
void ice_replay_post(struct ice_hw *hw);
203-
void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf);
204203
struct ice_q_ctx *
205204
ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle);
206205
int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in);

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,9 +1533,6 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)
15331533

15341534
ice_vc_process_vf_msg(pf, &event, &data);
15351535
break;
1536-
case ice_aqc_opc_fw_logging:
1537-
ice_output_fw_log(hw, &event.desc, event.msg_buf);
1538-
break;
15391536
case ice_aqc_opc_lldp_set_mib_change:
15401537
ice_dcb_process_lldp_set_mib_change(pf, &event);
15411538
break;

drivers/net/ethernet/intel/ice/ice_type.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -738,24 +738,6 @@ struct ice_switch_info {
738738
DECLARE_BITMAP(prof_res_bm[ICE_MAX_NUM_PROFILES], ICE_MAX_FV_WORDS);
739739
};
740740

741-
/* FW logging configuration */
742-
struct ice_fw_log_evnt {
743-
u8 cfg : 4; /* New event enables to configure */
744-
u8 cur : 4; /* Current/active event enables */
745-
};
746-
747-
struct ice_fw_log_cfg {
748-
u8 cq_en : 1; /* FW logging is enabled via the control queue */
749-
u8 uart_en : 1; /* FW logging is enabled via UART for all PFs */
750-
u8 actv_evnts; /* Cumulation of currently enabled log events */
751-
752-
#define ICE_FW_LOG_EVNT_INFO (ICE_AQC_FW_LOG_INFO_EN >> ICE_AQC_FW_LOG_EN_S)
753-
#define ICE_FW_LOG_EVNT_INIT (ICE_AQC_FW_LOG_INIT_EN >> ICE_AQC_FW_LOG_EN_S)
754-
#define ICE_FW_LOG_EVNT_FLOW (ICE_AQC_FW_LOG_FLOW_EN >> ICE_AQC_FW_LOG_EN_S)
755-
#define ICE_FW_LOG_EVNT_ERR (ICE_AQC_FW_LOG_ERR_EN >> ICE_AQC_FW_LOG_EN_S)
756-
struct ice_fw_log_evnt evnts[ICE_AQC_FW_LOG_ID_MAX];
757-
};
758-
759741
/* Enum defining the different states of the mailbox snapshot in the
760742
* PF-VF mailbox overflow detection algorithm. The snapshot can be in
761743
* states:
@@ -897,8 +879,6 @@ struct ice_hw {
897879
u8 fw_patch; /* firmware patch version */
898880
u32 fw_build; /* firmware build number */
899881

900-
struct ice_fw_log_cfg fw_log;
901-
902882
/* Device max aggregate bandwidths corresponding to the GL_PWR_MODE_CTL
903883
* register. Used for determining the ITR/INTRL granularity during
904884
* initialization.

0 commit comments

Comments
 (0)