net/ice: Update base code with latest snapshot.
PATCH v2 72/148 net/ice/base: update strict status when assigning BW limits
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
In the BW configuration performed by DCF functions, the strict/WFQ and priority field (referred to as Generic in the EAS) is not updated in the FW. This needs to be updated so as to not incorrectly allocate BW credits in the traffic shaping Tx scheduler.
Call the function "ice_sched_replay_node_prio" in the configuration flow once the node has been determined and the value of strict verified.
--- drivers/net/ice/base/ice_sched.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/net/ice/base/ice_sched.c +15 -0
@@ -4659,6 +4659,10 @@ ice_sched_save_tc_node_bw(struct ice_port_info *pi, u8 tc,return 0 ; } +#define ICE_SCHED_GENERIC_STRICT_MODE BIT(4) +#define ICE_SCHED_GENERIC_PRIO_M 0xE +#define ICE_SCHED_GENERIC_PRIO_S 1 +/** * ice_sched_set_tc_node_bw_lmt - sets TC node BW limit * @pi: port information structure
@@ -4683,6 +4687,17 @@ ice_sched_set_tc_node_bw_lmt(struct ice_port_info *pi, u8 tc, tc_node =ice_sched_get_tc_node (pi, tc);if (!tc_node) goto exit_set_tc_node_bw; + +/* update node's generic field */ + buf = tc_node->info; + data = &buf.data; + data->valid_sections =ICE_AQC_ELEM_VALID_GENERIC ; + data->generic = (tc <<ICE_SCHED_GENERIC_PRIO_S ) | +ICE_SCHED_GENERIC_STRICT_MODE ; + status =ice_sched_update_elem (pi->hw, tc_node, &buf); +if (status) + goto exit_set_tc_node_bw; +if (bw ==ICE_SCHED_DFLT_BW ) status =ice_sched_set_node_bw_dflt_lmt (pi, tc_node, rl_type);else
Signature · 1 line
2.43.0
Re: [PATCH v2 072/148] net/ice/base: update strict status when assigning BW limits
Quoted 10 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
In the BW configuration performed by DCF functions, the strict/WFQ and priority field (referred to as Generic in the EAS) is not updated in the FW. This needs to be updated so as to not incorrectly allocate BW credits in the traffic shaping Tx scheduler.
Call the function "
ice_sched_replay_node_prio" in the configuration flow once the node has been determined and the value of strict verified.
That change isn't in this patch.
PATCH v2 73/148 net/ice/base: remove unused define
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
In a previous patch a define was added that is not used. This is causing issues with CI builds.
--- drivers/net/ice/base/ice_sched.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ice/base/ice_sched.c +0 -1
@@ -4660,7 +4660,6 @@ ice_sched_save_tc_node_bw(struct ice_port_info *pi, u8 tc, }#define ICE_SCHED_GENERIC_STRICT_MODE BIT(4) -#define ICE_SCHED_GENERIC_PRIO_M 0xE#define ICE_SCHED_GENERIC_PRIO_S 1/**
Signature · 1 line
2.43.0
Re: [PATCH v2 073/148] net/ice/base: remove unused define
Quoted 16 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
In a previous patch a define was added that is not used. This is causing issues with CI builds.
Signed-off-by Dave Ertman <[email protected]>Signed-off-by Ian Stokes <[email protected]>--- drivers/net/ice/base/ice_sched.c | 1 - 1 file changed, 1 deletion(-)drivers/net/ice/base/ice_sched.c +0
-0
drivers/net/ice/base/ice_sched.c ice_sched_save_tc_node_bw(struct ice_port_info *pi, u8 tc, · line 4664
Quoted 6 lines
drivers/net/ice/base/ice_sched.c +0
-1@@ -4660,7 +4660,6 @@ ice_sched_save_tc_node_bw(struct ice_port_info *pi, u8 tc, }#define ICE_SCHED_GENERIC_STRICT_MODE BIT(4) -#define ICE_SCHED_GENERIC_PRIO_M 0xE#define ICE_SCHED_GENERIC_PRIO_S 1
This was just added in previous patch, p72, so quash 72 & 73 together for v3.
PATCH v2 74/148 net/ice/base: improve read retry value calculation
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Previous implementation of PHY timestamp retry value was set to a static value that had no meaning. Change it to calculate it based on a set of meaningfully named macros, as well as adjust data type to avoid overflows.
--- drivers/net/ice/base/ice_ptp_hw.c | 2 +- drivers/net/ice/base/ice_ptp_hw.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +1 -1
@@ -4583,7 +4583,7 @@ static int ice_write_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 val)static int ice_read_phy_tstamp_ll_e810 (struct ice_hw *hw,u8 idx,u8 *hi,u32 *lo) { -u8 i; +unsigned int i;/* Write TS index to read to the PF register so the FW can read it */ wr32 (hw,PF_SB_ATQBAL ,TS_LL_READ_TS_IDX (idx));
drivers/net/ice/base/ice_ptp_hw.h +5 -1
@@ -521,7 +521,11 @@ int ice_ptp_init_phy_cfg(struct ice_hw *hw);#define BYTES_PER_IDX_ADDR_L 4/* Tx timestamp low latency read definitions */ -#define TS_LL_READ_RETRIES 200 +#define TS_LL_MAX_TIME_READ_PER_PORT 80 +#define TS_LL_MAX_PORT 8 +#define TS_LL_DELTA_TIME 360 +#define TS_LL_READ_RETRIES (TS_LL_MAX_TIME_READ_PER_PORT * \ + TS_LL_MAX_PORT) + TS_LL_DELTA_TIME#define TS_LL_READ_TS_INTR BIT(30)#define TS_LL_READ_TS BIT(31)#define TS_LL_READ_TS_IDX_S 24
Signature · 1 line
2.43.0
PATCH v2 75/148 net/ice/base: check if recipe buffer was already allocated
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Check if recipe buffer was already allocated before allocating new one. Without such check it is possible to get memory leak when overwriting pointer address.
--- drivers/net/ice/base/ice_switch.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ice/base/ice_switch.c +3 -0
@@ -2577,6 +2577,9 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid, recps[rid].big_recp = (num_recps >1 ); recps[rid].n_grp_count = (u8 )num_recps; recps[rid].tun_type =ice_get_tun_type_for_recipe (rid, vlan); +if (recps[rid].root_buf) +ice_free (hw, recps[rid].root_buf); + recps[rid].root_buf = (struct ice_aqc_recipe_data_elem *)ice_memdup (hw, tmp, recps[rid].n_grp_count *sizeof (*recps[rid].root_buf),ICE_NONDMA_TO_NONDMA );
Signature · 1 line
2.43.0
PATCH v2 76/148 net/ice/base: fix handling recipes when reusing is not supported
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Switch recipe reuse feature caused issues on older FW which does not support this feature. Finding matching recipes was working incorrectly, what lead to resource starvation after multiple adding and removing recipes.
--- drivers/net/ice/base/ice_switch.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ice/base/ice_switch.c +6 -0
@@ -7340,6 +7340,12 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts, hw->switch_info->recp_list, i, &refresh_required, is_add)) continue; + }else { +if (!recp[i].recp_created) +if (ice_get_recp_frm_fw (hw, + hw->switch_info->recp_list, i, + &refresh_required, is_add)) +continue ; }/* Skip inverse action recipes */
Signature · 1 line
2.43.0
PATCH v2 77/148 net/ice/base: use correct type
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
num_rules was defined u16 but it should be u8 as it is passed to function ice_aq_sw_rules which expects u8.
--- drivers/net/ice/base/ice_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_switch.c +1 -1
@@ -9658,7 +9658,7 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,struct ice_switch_info *sw;u16 nb_lg_acts_mark =1 ;const u8 *pkt =NULL ; -u16 num_rules =1 ; +u8 num_rules =1 ;bool prof_rule;u16 word_cnt;u32 act =0 ;
Signature · 1 line
2.43.0
PATCH v2 78/148 net/ice/base: read OROM in a loop
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Previously NVM was once acquired and OROM was read to RAM in 4KB chunks. Changed this to a loop in which with each iteration NVM is acquired and only 4 bytes are read.
--- drivers/net/ice/base/ice_nvm.c | 43 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 22 deletions(-)
drivers/net/ice/base/ice_nvm.c +21 -22
@@ -723,9 +723,10 @@ static int ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, struct ice_orom_civd_info *civd) { - u8 *orom_data; + struct ice_orom_civd_info civd_data_section;int status;u32 offset; +u32 tmp;/* The CIVD section is located in the Option ROM aligned to 512 bytes. * The first 4 bytes must contain the ASCII characters "$CIV".
@@ -736,38 +737,37 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank,* usually somewhere in the middle of the bank. We need to scan the * Option ROM bank to locate it. * -* It's significantly faster to read the entire Option ROM up front -* using the maximum page size, than to read each possible location -* with a separate firmware command. */ - orom_data = (u8 *)ice_calloc (hw, hw->flash.banks.orom_size,sizeof (u8)); -if (!orom_data) -return ICE_ERR_NO_MEMORY ; - - status =ice_read_flash_module (hw, bank,ICE_SR_1ST_OROM_BANK_PTR ,0 , - orom_data, hw->flash.banks.orom_size); -if (status) { -ice_debug (hw,ICE_DBG_NVM ,"Unable to read Option ROM data\n" ); - goto exit_error;; - }/* Scan the memory buffer to locate the CIVD data section */ for (offset =0 ; (offset +512 ) <= hw->flash.banks.orom_size; offset +=512 ) { -struct ice_orom_civd_info *tmp;u8 sum =0 , i; - tmp = (struct ice_orom_civd_info *)&orom_data[offset]; + status =ice_read_flash_module (hw, bank,ICE_SR_1ST_OROM_BANK_PTR , + offset, (u8 *)&tmp,sizeof (tmp)); +if (status) { +ice_debug (hw,ICE_DBG_NVM ,"Unable to read Option ROM data\n" ); +return status; + }/* Skip forward until we find a matching signature */ -if (memcmp ("$CIV" , tmp->signature,sizeof (tmp->signature)) !=0 ) +if (memcmp ("$CIV" , &tmp,sizeof (tmp)) !=0 )continue ;ice_debug (hw,ICE_DBG_NVM ,"Found CIVD section at offset %u\n" , offset); + status =ice_read_flash_module (hw, bank,ICE_SR_1ST_OROM_BANK_PTR , + offset, (u8 *)&civd_data_section, +sizeof (civd_data_section)); +if (status) { +ice_debug (hw,ICE_DBG_NVM ,"Unable to read CIVD data\n" ); + goto exit_error; + } +/* Verify that the simple checksum is zero */ -for (i =0 ; i <sizeof (*tmp); i++) - sum += ((u8 *)tmp)[i]; +for (i =0 ; i <sizeof (civd_data_section); i++) + sum += ((u8 *)&civd_data_section)[i];if (sum) { ice_debug(hw, ICE_DBG_NVM, "Found CIVD data with invalid checksum of %u\n",
@@ -776,8 +776,8 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, goto exit_error; } - *civd = *tmp; -ice_free (hw, orom_data); + *civd = civd_data_section; +return 0 ; }
@@ -785,7 +785,6 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank,ice_debug (hw,ICE_DBG_NVM ,"Unable to locate CIVD data within the Option ROM\n" ); exit_error: -ice_free (hw, orom_data);return status; }
Signature · 1 line
2.43.0
PATCH v2 79/148 net/ice/base: ignore snprintf return value
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Certain compilation targets were generating compile errors due to snprintf return value not being checked. Fix it by ignoring the return value explicitly.
--- drivers/net/ice/base/ice_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_common.c +1 -1
@@ -876,7 +876,7 @@ void ice_print_rollback_msg(struct ice_hw *hw) orom = &hw->flash.orom; nvm = &hw->flash.nvm; -SNPRINTF (nvm_str,sizeof (nvm_str),"%x.%02x 0x%x %d.%d.%d" , + (void )SNPRINTF (nvm_str,sizeof (nvm_str),"%x.%02x 0x%x %d.%d.%d" , nvm->major, nvm->minor, nvm->eetrack, orom->major, orom->build, orom->patch); ice_warn(hw,
Signature · 1 line
2.43.0
PATCH v2 80/148 net/ice/base: check array bounds
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Some compilation targets were generating errors due to unchecked array bounds when accessing recipe groups. Add a check to avoid that.
--- drivers/net/ice/base/ice_switch.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/ice/base/ice_switch.c +8 -6
@@ -7533,12 +7533,14 @@ ice_create_first_fit_recp_def(struct ice_hw *hw, (*recp_cnt)++; } - grp->pairs[grp->n_val_pairs].prot_id = - lkup_exts->fv_words[j].prot_id; - grp->pairs[grp->n_val_pairs].off = - lkup_exts->fv_words[j].off; - grp->mask[grp->n_val_pairs] = lkup_exts->field_mask[j]; - grp->n_val_pairs++; +if (grp->n_val_pairs <ICE_NUM_WORDS_RECIPE ) { + grp->pairs[grp->n_val_pairs].prot_id = + lkup_exts->fv_words[j].prot_id; + grp->pairs[grp->n_val_pairs].off = + lkup_exts->fv_words[j].off; + grp->mask[grp->n_val_pairs] = lkup_exts->field_mask[j]; + grp->n_val_pairs++; + } }return 0 ;
Signature · 1 line
2.43.0
PATCH v2 81/148 net/ice/base: copy output IO params from command descriptor
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Coppied output IO params returned from get netlist node pin command descriptor so SW could use it. Fixed defines related to output IO params.
--- drivers/net/ice/base/ice_adminq_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +2 -2
@@ -1768,11 +1768,11 @@ struct ice_aqc_get_link_topo_pin {u8 output_io_params;#define ICE_AQC_LINK_TOPO_OUTPUT_IO_FUNC_S 0#define ICE_AQC_LINK_TOPO_OUTPUT_IO_FUNC_M \ - (0x1F << \ ICE_AQC_LINK_TOPO_INPUT_IO_FUNC_NUM_S) + (0x1F << ICE_AQC_LINK_TOPO_OUTPUT_IO_FUNC_S)/* Use ICE_AQC_LINK_TOPO_IO_FUNC_* for the non-numerical options */ #define ICE_AQC_LINK_TOPO_OUTPUT_IO_TYPE_S 5#define ICE_AQC_LINK_TOPO_OUTPUT_IO_TYPE_M \ - (0x7 << ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S) + (0x7 << ICE_AQC_LINK_TOPO_OUTPUT_IO_TYPE_S)/* Use ICE_AQC_LINK_TOPO_NODE_TYPE_* for the type values */ u8 output_io_flags;#define ICE_AQC_LINK_TOPO_OUTPUT_SPEED_S 0
Signature · 1 line
2.43.0
PATCH v2 82/148 net/ice/base: enable Next Cluster ID capability
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Updated data sheet added a new capability 'Next Cluster ID' defined as 0x0096, so add a define for it.
--- drivers/net/ice/base/ice_adminq_cmd.h | 2 +- drivers/net/ice/base/ice_common.c | 5 +++++ drivers/net/ice/base/ice_type.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_adminq_cmd.h +1 -1
@@ -132,7 +132,7 @@ struct ice_aqc_list_caps_elem {#define ICE_AQC_CAPS_ROCEV2_LAG 0x0092#define ICE_AQC_BIT_ROCEV2_LAG 0x01#define ICE_AQC_BIT_SRIOV_LAG 0x02 - +#define ICE_AQC_CAPS_NEXT_CLUSTER_ID 0x0096u8 major_ver;u8 minor_ver;/* Number of resources described by this capability */
drivers/net/ice/base/ice_common.c +5 -0
@@ -2453,6 +2453,11 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps,ice_debug (hw,ICE_DBG_INIT ,"%s: orom_recovery_update = %d\n" , prefix, caps->orom_recovery_update);break ; +case ICE_AQC_CAPS_NEXT_CLUSTER_ID : + caps->next_cluster_id_support = (number ==1 ); +ice_debug (hw,ICE_DBG_INIT ,"%s: next_cluster_id_support = %d\n" , + prefix, caps->next_cluster_id_support); +break ;default :/* Not one of the recognized common capabilities */ found = false;
drivers/net/ice/base/ice_type.h +1 -0
@@ -723,6 +723,7 @@ struct ice_hw_common_caps {bool tx_sched_topo_comp_mode_en;/* Support for OROM update in Recovery Mode */ bool orom_recovery_update; +bool next_cluster_id_support; };/* IEEE 1588 TIME_SYNC specific info */
Signature · 1 line
2.43.0
PATCH v2 83/148 net/ice/base: fix potential TLV length overflow
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
It's possible that an NVM with an invalid tlv_len could cause an integer overflow of next_tlv which can result an infinite loop.
Fix this issue by changing next_tlv from u16 to u32 to prevent overflow. Also check that tlv_len is valid and less than pfa_len.
Fix an issue with conversion from 'u32' to 'u16', possible loss of data compile errors by making appropriate casts.
--- drivers/net/ice/base/ice_nvm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/ice/base/ice_nvm.c +10 -5
@@ -472,7 +472,7 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, u16 module_type) {u16 pfa_len, pfa_ptr; -u16 next_tlv; +u32 next_tlv;int status; status =ice_read_sr_word (hw,ICE_SR_PFA_PTR , &pfa_ptr);
@@ -489,25 +489,30 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len,* of TLVs to find the requested one. */ next_tlv = pfa_ptr +1 ; -while (next_tlv < pfa_ptr + pfa_len) { +while (next_tlv < ((u32 )pfa_ptr + pfa_len)) {u16 tlv_sub_module_type;u16 tlv_len;/* Read TLV type */ - status =ice_read_sr_word (hw, next_tlv, &tlv_sub_module_type); + status =ice_read_sr_word (hw, (u16 )next_tlv, + &tlv_sub_module_type);if (status) {ice_debug (hw,ICE_DBG_INIT ,"Failed to read TLV type.\n" );break ; }/* Read TLV length */ - status =ice_read_sr_word (hw, next_tlv +1 , &tlv_len); + status =ice_read_sr_word (hw, (u16)(next_tlv +1 ), &tlv_len);if (status) {ice_debug (hw,ICE_DBG_INIT ,"Failed to read TLV length.\n" );break ; } +if (tlv_len > pfa_len) { +ice_debug (hw,ICE_DBG_INIT ,"Invalid TLV length.\n" ); +return ICE_ERR_INVAL_SIZE ; + }if (tlv_sub_module_type == module_type) {if (tlv_len) { - *module_tlv = next_tlv; + *module_tlv = (u16 )next_tlv; *module_tlv_len = tlv_len;return 0 ; }
Signature · 1 line
2.43.0
PATCH v2 84/148 net/ice/base: add function to read SDP section from NVM
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add API and definitions related to reading SDP section from NVM, related to PTP pins assignment.
--- drivers/net/ice/base/ice_adminq_cmd.h | 23 +++++++ drivers/net/ice/base/ice_ptp_hw.c | 87 +++++++++++++++++++++++++++ drivers/net/ice/base/ice_ptp_hw.h | 3 + 3 files changed, 113 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +23 -0
@@ -1949,6 +1949,29 @@ struct ice_aqc_nvm {#define ICE_AQC_NVM_LLDP_STATUS_M_LEN 4/* In Bits */ #define ICE_AQC_NVM_LLDP_STATUS_RD_LEN 4/* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_PTR_OFFSET 0xD8 +#define ICE_AQC_NVM_SDP_CFG_PTR_RD_LEN 2/* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_PTR_M MAKEMASK(0x7FFF, 0) +#define ICE_AQC_NVM_SDP_CFG_PTR_TYPE_M BIT(15) +#define ICE_AQC_NVM_SDP_CFG_HEADER_LEN 2/* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_SEC_LEN_LEN 2/* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_DATA_LEN 14/* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_MAX_SECTION_SIZE 7 +#define ICE_AQC_NVM_SDP_CFG_PIN_SIZE 10 +#define ICE_AQC_NVM_SDP_CFG_PIN_OFFSET 6 +#define ICE_AQC_NVM_SDP_CFG_PIN_MASK MAKEMASK(0x3FF, \ + ICE_AQC_NVM_SDP_CFG_PIN_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_CHAN_OFFSET 4 +#define ICE_AQC_NVM_SDP_CFG_CHAN_MASK MAKEMASK(0x3, \ + ICE_AQC_NVM_SDP_CFG_CHAN_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_DIR_OFFSET 3 +#define ICE_AQC_NVM_SDP_CFG_DIR_MASK MAKEMASK(0x1, \ + ICE_AQC_NVM_SDP_CFG_DIR_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_SDP_NUM_OFFSET 0 +#define ICE_AQC_NVM_SDP_CFG_SDP_NUM_MASK MAKEMASK(0x7, \ + ICE_AQC_NVM_SDP_CFG_SDP_NUM_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_NA_PIN_MASK MAKEMASK(0x1, 15) +#define ICE_AQC_NVM_TX_TOPO_MOD_ID 0x14B#define ICE_AQC_NVM_CMPO_MOD_ID 0x153
drivers/net/ice/base/ice_ptp_hw.c +87 -0
93 lines not on this page · raw message
drivers/net/ice/base/ice_ptp_hw.h +3 -0
@@ -263,6 +263,9 @@ ice_write_pca9575_reg_e810t(struct ice_hw *hw, u8 offset, u8 data);int ice_read_sma_ctrl_e810t (struct ice_hw *hw,u8 *data);int ice_write_sma_ctrl_e810t (struct ice_hw *hw,u8 data);bool ice_is_pca9575_present (struct ice_hw *hw); +int ice_ptp_read_sdp_section_from_nvm (struct ice_hw *hw,bool *section_exist, +u8 *pin_desc_num,u8 *pin_config_num, +u16 *sdp_entries,u8 *nvm_entries);void ice_ptp_process_cgu_err (struct ice_hw *hw,struct ice_rq_event_info *event);
Signature · 1 line
2.43.0
Re: [PATCH v2 084/148] net/ice/base: add function to read SDP section from NVM
Quoted 5 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
Add API and definitions related to reading SDP section from NVM, related to PTP pins assignment.
Not familiar with the acronym here, so checked datasheet:
SDP == Software Definable Pin???
/Bruce
PATCH v2 85/148 net/ice/base: add Floating VEB support
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Added sw_id variables to ice_fltr_info struct and disable lan_en flag for Floating VEB VSIs.
--- drivers/net/ice/base/ice_switch.c | 6 ++++-- drivers/net/ice/base/ice_switch.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_switch.c +4 -2
@@ -4153,8 +4153,10 @@ static void ice_fill_sw_info(struct ice_hw *hw, struct ice_fltr_info *fi) (fi->lkup_type ==ICE_SW_LKUP_MAC && !IS_UNICAST_ETHER_ADDR (fi->l_data.mac.mac_addr)) || (fi->lkup_type ==ICE_SW_LKUP_MAC_VLAN && - !IS_UNICAST_ETHER_ADDR(fi->l_data.mac.mac_addr))) - fi->lan_en = true; + !IS_UNICAST_ETHER_ADDR(fi->l_data.mac.mac_addr))) { + if (!fi->fltVeb_en) + fi->lan_en = true; + } } else { fi->lan_en = true; }
drivers/net/ice/base/ice_switch.h +3 -0
@@ -146,6 +146,7 @@ struct ice_fltr_info {union {struct {u8 mac_addr[ETH_ALEN ]; +u16 sw_id; } mac;struct {u8 mac_addr[ETH_ALEN ];
@@ -155,6 +156,7 @@ struct ice_fltr_info {u16 vlan_id;u16 tpid;u8 tpid_valid; +u16 sw_id; } vlan;/* Set lkup_type as ICE_SW_LKUP_ETHERTYPE * if just using ethertype as filter. Set lkup_type as
@@ -192,6 +194,7 @@ struct ice_fltr_info {/* Rule creations populate these indicators basing on the switch type */ u8 lb_en;/* Indicate if packet can be looped back */ u8 lan_en;/* Indicate if packet can be forwarded to the uplink */ +u8 fltVeb_en;/* Indicate if VSI is connected to floating VEB */ };struct ice_update_recipe_lkup_idx_params {
Signature · 1 line
2.43.0
PATCH v2 86/148 net/ice/base: add defines for loopback mode
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
To reflect updates in the data sheet, add:
- loopback mode value into ice_aqc_set_port_params
- required defines to support loopback mode
- added loopback mode handling in ice_port_info
--- drivers/net/ice/base/ice_adminq_cmd.h | 7 ++++++- drivers/net/ice/base/ice_common.c | 4 ++++ drivers/net/ice/base/ice_common.h | 3 +++ drivers/net/ice/base/ice_type.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_adminq_cmd.h +6 -1
@@ -265,7 +265,12 @@ struct ice_aqc_set_port_params { (0x3F << ICE_AQC_SET_P_PARAMS_LOGI_PORT_ID_S)#define ICE_AQC_SET_P_PARAMS_IS_LOGI_PORT BIT(14)#define ICE_AQC_SET_P_PARAMS_SWID_VALID BIT(15) -u8 reserved[10 ]; +u8 lb_mode; +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_VALID BIT(2) +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NORMAL 0x00 +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NO 0x01 +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_HIGH 0x02 +u8 reserved[9 ]; };/* These resource type defines are used for all switch resource
drivers/net/ice/base/ice_common.c +4 -0
@@ -956,6 +956,8 @@ int ice_init_hw(struct ice_hw *hw) goto err_unroll_cqinit; } + hw->port_info->loopback_mode =ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NORMAL ; +/* set the back pointer to HW */ hw->port_info->hw = hw;
@@ -3252,6 +3254,8 @@ ice_aq_set_port_params(struct ice_port_info *pi, u16 bad_frame_vsi, cmd = &desc.params.set_port_params;ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_set_port_params); + cmd->lb_mode = pi->loopback_mode | +ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_VALID ; cmd->bad_frame_vsi =CPU_TO_LE16 (bad_frame_vsi);if (save_bad_pac) cmd_flags |=ICE_AQC_SET_P_PARAMS_SAVE_BAD_PACKETS ;
drivers/net/ice/base/ice_common.h +3 -0
@@ -15,6 +15,9 @@#define ICE_SQ_SEND_DELAY_TIME_MS 10#define ICE_SQ_SEND_MAX_EXECUTE 3 +#define LOOPBACK_MODE_NO 0 +#define LOOPBACK_MODE_HIGH 2 +enum ice_fw_modes {ICE_FW_MODE_NORMAL ,ICE_FW_MODE_DBG ,
drivers/net/ice/base/ice_type.h +1 -0
@@ -1208,6 +1208,7 @@ struct ice_port_info {u16 sw_id;/* Initial switch ID belongs to port */ u16 pf_vf_num;u8 port_state; +u8 loopback_mode;#define ICE_SCHED_PORT_STATE_INIT 0x0#define ICE_SCHED_PORT_STATE_READY 0x1u8 lport;
Signature · 1 line
2.43.0
PATCH v2 87/148 net/ice/base: allow skipping PF clear
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
As per updated data sheet, add 'skip_clear_pf' field to ice_hw structure, which can be used to skip call to ice_clear_pf_cfg() in ice_init_hw().
Also, make 'fw_vsi_num' field of ice_hw structure visible to every component using shared code, as well as make ice_init_fltr_mgmt_struct() and ice_cleanup_fltr_mgmt_struct() non-static.
--- drivers/net/ice/base/ice_common.c | 10 +++++++--- drivers/net/ice/base/ice_switch.c | 4 ++++ drivers/net/ice/base/ice_type.h | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_common.c +7 -3
@@ -923,6 +923,8 @@ int ice_init_hw(struct ice_hw *hw)ice_get_itr_intrl_gran (hw); + hw->fw_vsi_num =ICE_DFLT_VSI_INVAL ; + status =ice_create_all_ctrlq (hw);if (status) goto err_unroll_cqinit;
@@ -934,9 +936,11 @@ int ice_init_hw(struct ice_hw *hw)if (ice_get_fw_mode (hw) ==ICE_FW_MODE_ROLLBACK )ice_print_rollback_msg (hw); - status =ice_clear_pf_cfg (hw); -if (status) - goto err_unroll_cqinit; +if (!hw->skip_clear_pf) { + status =ice_clear_pf_cfg (hw); +if (status) + goto err_unroll_cqinit; + }/* Set bit to enable Flow Director filters */ wr32 (hw,PFQF_FD_ENA ,PFQF_FD_ENA_FD_ENA_M );
drivers/net/ice/base/ice_switch.c +4 -0
@@ -4072,6 +4072,10 @@ int ice_get_initial_sw_cfg(struct ice_hw *hw)switch (res_type) {case ICE_AQC_GET_SW_CONF_RESP_VSI : +if (hw->fw_vsi_num !=ICE_DFLT_VSI_INVAL ) +ice_debug (hw,ICE_DBG_SW ,"fw_vsi_num %d -> %d\n" , + hw->fw_vsi_num, vsi_port_num); + hw->fw_vsi_num = vsi_port_num;if (hw->dcf_enabled && !is_vf) hw->pf_id = pf_vf_num;break ;
drivers/net/ice/base/ice_type.h +2 -0
@@ -1258,6 +1258,7 @@ struct ice_hw {enum ice_mac_type mac_type;u16 fd_ctr_base;/* FD counter base index */ +u16 fw_vsi_num;/* pci info */ u16 device_id;u16 vendor_id;
@@ -1407,6 +1408,7 @@ struct ice_hw {u16 io_expander_handle;bool subscribable_recipes_supported; +bool skip_clear_pf; };/* Statistics collected by each port, VSI, VEB, and S-channel */
Signature · 1 line
2.43.0
Re: [PATCH v2 087/148] net/ice/base: allow skipping PF clear
Quoted 8 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
As per updated data sheet, add '
skip_clear_pf' field toice_hwstructure, which can be used to skip call toice_clear_pf_cfg()inice_init_hw().Also, make '
fw_vsi_num' field ofice_hwstructure visible to every component using shared code, as well as makeice_init_fltr_mgmt_struct()andice_cleanup_fltr_mgmt_struct()non-static.
Change to make functions non-static not in this patch.
PATCH v2 88/148 net/ice/base: fix in the definition of the Board Type
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
The new version is compliant with implementation and documentation
--- drivers/net/ice/base/ice_adminq_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +2 -2
@@ -1719,8 +1719,8 @@ struct ice_aqc_link_topo_addr {#define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S)/* Used to decode the handle field */ #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_M BIT(9) -#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM BIT(9) -#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ 0 +#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM 0 +#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ BIT(9)#define ICE_AQC_LINK_TOPO_HANDLE_NODE_S 0/* In case of a Mezzanine type */ #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_NODE_M \
Signature · 1 line
2.43.0
PATCH v2 89/148 net/ice/base : make ice_clear_vsi_q_ctx() non-static
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
QV needs to call ice_clear_vsi_q_ctx() from outside of ice_switch.c so the function had to become non-static.
--- drivers/net/ice/base/ice_switch.c | 2 +- drivers/net/ice/base/ice_switch.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_switch.c +1 -1
@@ -3125,7 +3125,7 @@ ice_save_vsi_ctx(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi)* @hw: pointer to the HW struct * @vsi_handle: VSI handle */ -static void ice_clear_vsi_q_ctx (struct ice_hw *hw,u16 vsi_handle) +void ice_clear_vsi_q_ctx (struct ice_hw *hw,u16 vsi_handle) {struct ice_vsi_ctx *vsi;u8 i;
drivers/net/ice/base/ice_switch.h +1 -0
@@ -456,6 +456,7 @@ int ice_update_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx, struct ice_sq_cd *cd);struct ice_vsi_ctx *ice_get_vsi_ctx (struct ice_hw *hw,u16 vsi_handle); +void ice_clear_vsi_q_ctx (struct ice_hw *hw,u16 vsi_handle);void ice_clear_all_vsi_ctx (struct ice_hw *hw); int ice_aq_get_vsi_params(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
Signature · 1 line
2.43.0
PATCH v2 90/148 net/ice/base: fix package download algorithm
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Previously, the code would assume that only "Modular Signature Segment" existed. Given a package with both a "Reference Signature Segment" and a "Modular Signature Segment" the download would not have been successful because an incorrect sequence of buffers would be sent to the firmware.
Update download flow to detect a "Reference Signature Segment" and to only download the buffers in the signature segment in this case, and to skip downloading any buffers from the configuration segment.
--- drivers/net/ice/base/ice_ddp.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/ice/base/ice_ddp.c +8 -0
@@ -568,6 +568,14 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr,if (state) goto exit; +if (count ==0 ) { +/* this is a "Reference Signature Segment" and download should +* be only for the buffers in the signature segment (and not +* the hardware configuration segment) +*/ + goto exit; + } + state =ice_download_pkg_config_seg (hw, pkg_hdr, conf_idx, start, count);
Signature · 1 line
2.43.0
PATCH v2 91/148 net/ice/base: allows packages with mixed signature presence
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
As a temporary workaround to allow unsigned packages, there needs to be support for configuration segments that are unsigned.
Allow packages that have some configuration segments that are signed and some configuration segments that are not signed. The code has been changed to detect for each configuration segment whether there is a matching signature segment or not.
--- drivers/net/ice/base/ice_ddp.c | 24 +----------------------- drivers/net/ice/base/ice_type.h | 1 - 2 files changed, 1 insertion(+), 24 deletions(-)
drivers/net/ice/base/ice_ddp.c +1 -23
@@ -415,21 +415,6 @@ ice_aq_get_pkg_info_list(struct ice_hw *hw,return ice_aq_send_cmd (hw, &desc, pkg_info, buf_size, cd); } -/** -* ice_has_signing_seg - determine if package has a signing segment -* @hw: pointer to the hardware structure -* @pkg_hdr: pointer to the driver's package hdr -*/ -static bool ice_has_signing_seg (struct ice_hw *hw,struct ice_pkg_hdr *pkg_hdr) -{ -struct ice_generic_seg_hdr *seg_hdr; - - seg_hdr = (struct ice_generic_seg_hdr *) -ice_find_seg_in_pkg (hw,SEGMENT_TYPE_SIGNING , pkg_hdr); - -return seg_hdr ? true : false; -} -/** * ice_get_pkg_segment_id - get correct package segment id, based on device * @mac_type: MAC type of the device
@@ -760,7 +745,7 @@ ice_download_pkg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, {enum ice_ddp_state state; -if (hw->pkg_has_signing_seg) +if (ice_match_signing_seg (pkg_hdr, hw->pkg_seg_id, hw->pkg_sign_type)) state =ice_download_pkg_with_sig_seg (hw, pkg_hdr);else state =ice_download_pkg_without_sig_seg (hw, ice_seg);
@@ -785,7 +770,6 @@ ice_init_pkg_info(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr)if (!pkg_hdr)return ICE_DDP_PKG_ERR ; - hw->pkg_has_signing_seg =ice_has_signing_seg (hw, pkg_hdr);ice_get_signing_req (hw); ice_debug(hw, ICE_DBG_INIT, "Pkg using segment id: 0x%08X\n",
@@ -1360,12 +1344,6 @@ enum ice_ddp_state ice_init_pkg(struct ice_hw *hw, u8 *buf, u32 len)if (state)return state; -/* For packages with signing segments, must be a matching segment */ -if (hw->pkg_has_signing_seg) -if (!ice_match_signing_seg (pkg, hw->pkg_seg_id, - hw->pkg_sign_type)) -return ICE_DDP_PKG_ERR ; -/* before downloading the package, check package version for * compatibility with driver */
drivers/net/ice/base/ice_type.h +0 -1
@@ -1352,7 +1352,6 @@ struct ice_hw {u32 pkg_seg_id;u32 pkg_sign_type;u32 active_track_id; - u8 pkg_has_signing_seg:1;u8 active_pkg_name[ICE_PKG_NAME_SIZE ];u8 active_pkg_in_nvm;
Signature · 1 line
2.43.0
PATCH v2 92/148 net/ice/base: fix ice_memcpy type specifiers
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Wrong type specifiers were used in ice_write_*(), ice_read_*() and ice_sched_add_root_node() functions. In QV tools those functions are operating on user space buffers and therefore the ice_memcpy type has to be set to ICE_NONDMA_TO_NONDMA.
--- drivers/net/ice/base/ice_common.c | 32 +++++++++++++++---------------- drivers/net/ice/base/ice_sched.c | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-)
drivers/net/ice/base/ice_common.c +16 -16
@@ -4692,13 +4692,13 @@ ice_write_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* get the current bits from the target bit string */ dest = dest_ctx + (ce_info->lsb /8 ); -ice_memcpy (&dest_byte, dest,sizeof (dest_byte),ICE_DMA_TO_NONDMA ); +ice_memcpy (&dest_byte, dest,sizeof (dest_byte),ICE_NONDMA_TO_NONDMA ); dest_byte &= ~mask;/* get the bits not changing */ dest_byte |= src_byte;/* add in the new bits */ /* put it all back */ -ice_memcpy (dest, &dest_byte,sizeof (dest_byte),ICE_NONDMA_TO_DMA ); +ice_memcpy (dest, &dest_byte,sizeof (dest_byte),ICE_NONDMA_TO_NONDMA ); }/**
@@ -4735,13 +4735,13 @@ ice_write_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* get the current bits from the target bit string */ dest = dest_ctx + (ce_info->lsb /8 ); -ice_memcpy (&dest_word, dest,sizeof (dest_word),ICE_DMA_TO_NONDMA ); +ice_memcpy (&dest_word, dest,sizeof (dest_word),ICE_NONDMA_TO_NONDMA ); dest_word &= ~(CPU_TO_LE16 (mask));/* get the bits not changing */ dest_word |=CPU_TO_LE16 (src_word);/* add in the new bits */ /* put it all back */ -ice_memcpy (dest, &dest_word,sizeof (dest_word),ICE_NONDMA_TO_DMA ); +ice_memcpy (dest, &dest_word,sizeof (dest_word),ICE_NONDMA_TO_NONDMA ); }/**
@@ -4786,13 +4786,13 @@ ice_write_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* get the current bits from the target bit string */ dest = dest_ctx + (ce_info->lsb /8 ); -ice_memcpy (&dest_dword, dest,sizeof (dest_dword),ICE_DMA_TO_NONDMA ); +ice_memcpy (&dest_dword, dest,sizeof (dest_dword),ICE_NONDMA_TO_NONDMA ); dest_dword &= ~(CPU_TO_LE32 (mask));/* get the bits not changing */ dest_dword |=CPU_TO_LE32 (src_dword);/* add in the new bits */ /* put it all back */ -ice_memcpy (dest, &dest_dword,sizeof (dest_dword),ICE_NONDMA_TO_DMA ); +ice_memcpy (dest, &dest_dword,sizeof (dest_dword),ICE_NONDMA_TO_NONDMA ); }/**
@@ -4837,13 +4837,13 @@ ice_write_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* get the current bits from the target bit string */ dest = dest_ctx + (ce_info->lsb /8 ); -ice_memcpy (&dest_qword, dest,sizeof (dest_qword),ICE_DMA_TO_NONDMA ); +ice_memcpy (&dest_qword, dest,sizeof (dest_qword),ICE_NONDMA_TO_NONDMA ); dest_qword &= ~(CPU_TO_LE64 (mask));/* get the bits not changing */ dest_qword |=CPU_TO_LE64 (src_qword);/* add in the new bits */ /* put it all back */ -ice_memcpy (dest, &dest_qword,sizeof (dest_qword),ICE_NONDMA_TO_DMA ); +ice_memcpy (dest, &dest_qword,sizeof (dest_qword),ICE_NONDMA_TO_NONDMA ); }/**
@@ -4966,7 +4966,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* get the current bits from the src bit string */ src = src_ctx + (ce_info->lsb /8 ); -ice_memcpy (&dest_byte, src,sizeof (dest_byte),ICE_DMA_TO_NONDMA ); +ice_memcpy (&dest_byte, src,sizeof (dest_byte),ICE_NONDMA_TO_NONDMA ); dest_byte &= ~(mask);
@@ -4976,7 +4976,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) target = dest_ctx + ce_info->offset;/* put it back in the struct */ -ice_memcpy (target, &dest_byte,sizeof (dest_byte),ICE_NONDMA_TO_DMA ); +ice_memcpy (target, &dest_byte,sizeof (dest_byte),ICE_NONDMA_TO_NONDMA ); }/**
@@ -5003,7 +5003,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* get the current bits from the src bit string */ src = src_ctx + (ce_info->lsb /8 ); -ice_memcpy (&src_word, src,sizeof (src_word),ICE_DMA_TO_NONDMA ); +ice_memcpy (&src_word, src,sizeof (src_word),ICE_NONDMA_TO_NONDMA );/* the data in the memory is stored as little endian so mask it * correctly
@@ -5019,7 +5019,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) target = dest_ctx + ce_info->offset;/* put it back in the struct */ -ice_memcpy (target, &dest_word,sizeof (dest_word),ICE_NONDMA_TO_DMA ); +ice_memcpy (target, &dest_word,sizeof (dest_word),ICE_NONDMA_TO_NONDMA ); }/**
@@ -5054,7 +5054,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* get the current bits from the src bit string */ src = src_ctx + (ce_info->lsb /8 ); -ice_memcpy (&src_dword, src,sizeof (src_dword),ICE_DMA_TO_NONDMA ); +ice_memcpy (&src_dword, src,sizeof (src_dword),ICE_NONDMA_TO_NONDMA );/* the data in the memory is stored as little endian so mask it * correctly
@@ -5070,7 +5070,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) target = dest_ctx + ce_info->offset;/* put it back in the struct */ -ice_memcpy (target, &dest_dword,sizeof (dest_dword),ICE_NONDMA_TO_DMA ); +ice_memcpy (target, &dest_dword,sizeof (dest_dword),ICE_NONDMA_TO_NONDMA ); }/**
@@ -5105,7 +5105,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* get the current bits from the src bit string */ src = src_ctx + (ce_info->lsb /8 ); -ice_memcpy (&src_qword, src,sizeof (src_qword),ICE_DMA_TO_NONDMA ); +ice_memcpy (&src_qword, src,sizeof (src_qword),ICE_NONDMA_TO_NONDMA );/* the data in the memory is stored as little endian so mask it * correctly
@@ -5121,7 +5121,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) target = dest_ctx + ce_info->offset;/* put it back in the struct */ -ice_memcpy (target, &dest_qword,sizeof (dest_qword),ICE_NONDMA_TO_DMA ); +ice_memcpy (target, &dest_qword,sizeof (dest_qword),ICE_NONDMA_TO_NONDMA ); }/**
drivers/net/ice/base/ice_sched.c +1 -1
@@ -35,7 +35,7 @@ ice_sched_add_root_node(struct ice_port_info *pi,return ICE_ERR_NO_MEMORY ; } -ice_memcpy (&root->info, info,sizeof (*info),ICE_DMA_TO_NONDMA ); +ice_memcpy (&root->info, info,sizeof (*info),ICE_NONDMA_TO_NONDMA ); pi->root = root;return 0 ; }
Signature · 1 line
2.43.0
PATCH v2 93/148 net/ice/base: allow different FW API versions based on MAC type
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Allow the driver to be compatible with different FW API versions based on the device's MAC type. Currently, E810 is only compatible with one FW API version. Now the driver can be compatible with different FW API versions for both E810 and E830.
--- drivers/net/ice/base/ice_controlq.c | 17 ++++++++++------- drivers/net/ice/base/ice_controlq.h | 22 +++++++++++++++++++--- 2 files changed, 29 insertions(+), 10 deletions(-)
drivers/net/ice/base/ice_controlq.c +10 -7
@@ -479,24 +479,27 @@ ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)*/ static bool ice_aq_ver_check (struct ice_hw *hw) { -if (hw->api_maj_ver >EXP_FW_API_VER_MAJOR ) { +u8 exp_fw_api_ver_major =EXP_FW_API_VER_MAJOR_BY_MAC (hw); +u8 exp_fw_api_ver_minor =EXP_FW_API_VER_MINOR_BY_MAC (hw); + +if (hw->api_maj_ver > exp_fw_api_ver_major) {/* Major API version is newer than expected, don't load */ ice_warn (hw,"The driver for the device stopped because the NVM image is newer than expected. You must install the most recent version of the network driver.\n" );return false; - }else if (hw->api_maj_ver ==EXP_FW_API_VER_MAJOR ) { -if (hw->api_min_ver > (EXP_FW_API_VER_MINOR +2 )) + }else if (hw->api_maj_ver == exp_fw_api_ver_major) { +if (hw->api_min_ver > (exp_fw_api_ver_minor +2 ))ice_info (hw,"The driver for the device detected a newer version (%u.%u) of the NVM image than expected (%u.%u). Please install the most recent version of the network driver.\n" , hw->api_maj_ver, hw->api_min_ver, -EXP_FW_API_VER_MAJOR ,EXP_FW_API_VER_MINOR ); -else if ((hw->api_min_ver +2 ) <EXP_FW_API_VER_MINOR ) + exp_fw_api_ver_major, exp_fw_api_ver_minor); +else if ((hw->api_min_ver +2 ) < exp_fw_api_ver_minor)ice_info (hw,"The driver for the device detected an older version (%u.%u) of the NVM image than expected (%u.%u). Please update the NVM image.\n" , hw->api_maj_ver, hw->api_min_ver, -EXP_FW_API_VER_MAJOR ,EXP_FW_API_VER_MINOR ); + exp_fw_api_ver_major, exp_fw_api_ver_minor); }else {/* Major API version is older than expected, log a warning */ ice_info (hw,"The driver for the device detected an older version (%u.%u) of the NVM image than expected (%u.%u). Please update the NVM image.\n" , hw->api_maj_ver, hw->api_min_ver, -EXP_FW_API_VER_MAJOR ,EXP_FW_API_VER_MINOR ); + exp_fw_api_ver_major, exp_fw_api_ver_minor); }return true; }
drivers/net/ice/base/ice_controlq.h +19 -3
@@ -22,9 +22,25 @@/* Defines that help manage the driver vs FW API checks. * Take a look at ice_aq_ver_check in ice_controlq.c for actual usage. */ -#define EXP_FW_API_VER_BRANCH 0x00 -#define EXP_FW_API_VER_MAJOR 0x01 -#define EXP_FW_API_VER_MINOR 0x05 +#define EXP_FW_API_VER_BRANCH_E830 0x00 +#define EXP_FW_API_VER_MAJOR_E830 0x01 +#define EXP_FW_API_VER_MINOR_E830 0x07 + +#define EXP_FW_API_VER_BRANCH_E810 0x00 +#define EXP_FW_API_VER_MAJOR_E810 0x01 +#define EXP_FW_API_VER_MINOR_E810 0x05 + +#define EXP_FW_API_VER_BRANCH_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_BRANCH_E830 : \ + EXP_FW_API_VER_BRANCH_E810) + +#define EXP_FW_API_VER_MAJOR_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_MAJOR_E830 : \ + EXP_FW_API_VER_MAJOR_E810) + +#define EXP_FW_API_VER_MINOR_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_MINOR_E830 : \ + EXP_FW_API_VER_MINOR_E810)/* Different control queue types: These are mainly for SW consumption. */ enum ice_ctl_q {
Signature · 1 line
2.43.0
Re: [PATCH v2 093/148] net/ice/base: allow different FW API versions based on MAC type
Quoted 19 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
Allow the driver to be compatible with different FW API versions based on the device's MAC type. Currently, E810 is only compatible with one FW API version. Now the driver can be compatible with different FW API versions for both E810 and E830.
Signed-off-by Dan Nowlin <[email protected]>Signed-off-by Ian Stokes <[email protected]>--- drivers/net/ice/base/ice_controlq.c | 17 ++++++++++------- drivers/net/ice/base/ice_controlq.h | 22 +++++++++++++++++++--- 2 files changed, 29 insertions(+), 10 deletions(-)drivers/net/ice/base/ice_controlq.c +0
-0
drivers/net/ice/base/ice_controlq.c ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) · line 485
Quoted 8 lines
drivers/net/ice/base/ice_controlq.c +4
-1@@ -479,24 +479,27 @@ ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)*/ static bool ice_aq_ver_check (struct ice_hw *hw) { -if (hw->api_maj_ver >EXP_FW_API_VER_MAJOR ) { +u8 exp_fw_api_ver_major =EXP_FW_API_VER_MAJOR_BY_MAC (hw); +u8 exp_fw_api_ver_minor =EXP_FW_API_VER_MINOR_BY_MAC (hw); + +if (hw->api_maj_ver > exp_fw_api_ver_major) {
Let's fix the indentation on this line.
PATCH v2 94/148 net/ice/base: add 32 GT bus speed enumerated value
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add ice_pcie_speed_32_0GT bus speed enum to support E830 device's higher bus speed.
--- drivers/net/ice/base/ice_type.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_type.h +2 -1
@@ -849,7 +849,8 @@ enum ice_pcie_bus_speed { ice_pcie_speed_2_5GT =0x14 , ice_pcie_speed_5_0GT =0x15 , ice_pcie_speed_8_0GT =0x16 , - ice_pcie_speed_16_0GT = 0x17 + ice_pcie_speed_16_0GT =0x17 , + ice_pcie_speed_32_0GT = 0x18, };/* PCI bus widths */
Signature · 1 line
2.43.0
PATCH v2 95/148 net/ice/base: add E830 debug dump cluster ID values
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add E830 debug dump cluster ID values, which are different than the values for E810. Rename E810 cluster IDs to make it easier to distinguish which values are which.Add E830 debug dump cluster ID values, which are different than the values for E810. Rename E810 cluster IDs to make it easier to
distinguish which values are which.
--- drivers/net/ice/base/ice_adminq_cmd.h | 37 ++++++++++++++++++--------- drivers/net/ice/ice_diagnose.c | 2 +- 2 files changed, 26 insertions(+), 13 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +25 -12
@@ -2908,20 +2908,33 @@ struct ice_aqc_event_lan_overflow {/* Debug Dump Internal Data (indirect 0xFF08) */ struct ice_aqc_debug_dump_internals {__le16 cluster_id;/* Expresses next cluster ID in response */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW 0 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_ACL 1 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED 2 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES 3 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW_E810 0 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_ACL_E810 1 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED_E810 2 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES_E810 3/* EMP_DRAM only dumpable in device debug mode */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_EMP_DRAM 4 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK 5 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_EMP_DRAM_E810 4 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK_E810 5/* AUX_REGS only dumpable in device debug mode */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_AUX_REGS 6 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB 7 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P 8 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG 9 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE 21 -#define ICE_ACQ_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTION 22 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_AUX_REGS_E810 6 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB_E810 7 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P_E810 8 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG_E810 9 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE_E810 21 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTIONS_E810 22 + +/* Start cluster to discover first available cluster */ +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_START_ALL 0 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW_E830 100 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_ACL_E830 101 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED_E830 102 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES_E830 103 +/* EMP_DRAM only dumpable in device debug mode */ +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK_E830 105 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB_E830 107 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P_E830 108 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG_E830 109 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE_E830 121__le16 table_id;/* Used only for non-memory clusters */ __le32 idx;/* In table entries for tables, in bytes for memory */ __le32 addr_high;
drivers/net/ice/ice_diagnose.c +1 -1
@@ -467,7 +467,7 @@ ice_dump_switch(struct rte_eth_dev *dev, uint8_t **buff2, uint32_t *size) } res =ice_aq_get_internal_data (hw, -ICE_AQC_DBG_DUMP_CLUSTER_ID_SW , +ICE_AQC_DBG_DUMP_CLUSTER_ID_SW_E810 , tbl_id, tbl_idx, buff,ICE_PKG_BUF_SIZE , &buff_size, &tbl_id, &tbl_idx,NULL , cd);
Signature · 1 line
2.43.0
Re: [PATCH v2 095/148] net/ice/base: add E830 debug dump cluster ID values
Quoted 9 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
Add E830 debug dump cluster ID values, which are different than the values for E810. Rename E810 cluster IDs to make it easier to distinguish which values are which.Add E830 debug dump cluster ID values, which are different than the values for E810. Rename E810 cluster IDs to make it easier to
distinguish which values are which.
A commit log so good it's worth repeating? :-)
/Bruce
PATCH v2 96/148 net/ice/base: fix for preparing PHY for timesync command
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Preparing a port for timesync command procedure shall provide Rx type which indicates the type for the Rx metadata in the ONPI interface. According to the documentation, Rx type should always equal 0x18.
--- drivers/net/ice/base/ice_ptp_hw.c | 4 ++-- drivers/net/ice/base/ice_ptp_hw.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +2 -2
@@ -3255,8 +3255,8 @@ ice_ptp_write_port_cmd_e822(struct ice_hw *hw, u8 port, }/* Rx case */ - err =ice_write_phy_reg_e822_lp (hw, port,P_REG_RX_TMR_CMD , val, - lock_sbq); + err =ice_write_phy_reg_e822_lp (hw, port,P_REG_RX_TMR_CMD , + val |TS_CMD_RX_TYPE , lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to write back RX_TMR_CMD, err %d\n" , err);
drivers/net/ice/base/ice_ptp_hw.h +3 -0
@@ -329,6 +329,9 @@ int ice_ptp_init_phy_cfg(struct ice_hw *hw);#define TS_CMD_MASK_E810 0xFF#define TS_CMD_MASK 0xF#define SYNC_EXEC_CMD 0x3 +#define TS_CMD_RX_TYPE_S 0x4 +#define TS_CMD_RX_TYPE MAKEMASK(0x18, TS_CMD_RX_TYPE_S) +/* Macros to derive port low and high addresses on both quads */ #define P_Q0_L (a, p) ((((a) + (0x2000 * (p)))) & 0xFFFF)
Signature · 1 line
2.43.0
PATCH v2 97/148 net/ice/base: support for firmware sanitization
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add support for AQ 0x070C. Includes ice_nvm_sanitize and a helper function ice_nvm_sanitize_operate to facilitate the operate request.
--- drivers/net/ice/base/ice_adminq_cmd.h | 25 ++++++++++++ drivers/net/ice/base/ice_nvm.c | 57 +++++++++++++++++++++++++++ drivers/net/ice/base/ice_nvm.h | 2 + 3 files changed, 84 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +25 -0
@@ -2025,6 +2025,29 @@ struct ice_aqc_nvm_checksum {u8 rsvd2[12 ]; }; +/* Used for NVM Sanitization command - 0x070C */ +struct ice_aqc_nvm_sanitization { +u8 cmd_flags; +#define ICE_AQ_NVM_SANITIZE_REQ_READ 0 +#define ICE_AQ_NVM_SANITIZE_REQ_OPERATE BIT(0) + +#define ICE_AQ_NVM_SANITIZE_READ_SUBJECT_NVM_BITS 0 +#define ICE_AQ_NVM_SANITIZE_READ_SUBJECT_NVM_STATE BIT(1) +#define ICE_AQ_NVM_SANITIZE_OPERATE_SUBJECT_CLEAR 0 +u8 values; +#define ICE_AQ_NVM_SANITIZE_NVM_BITS_HOST_CLEAN_SUPPORT BIT(0) +#define ICE_AQ_NVM_SANITIZE_NVM_BITS_BMC_CLEAN_SUPPORT BIT(2) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_HOST_CLEAN_DONE BIT(0) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_HOST_CLEAN_SUCCESS BIT(1) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_BMC_CLEAN_DONE BIT(2) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_BMC_CLEAN_SUCCESS BIT(3) +#define ICE_AQ_NVM_SANITIZE_OPERATE_HOST_CLEAN_DONE BIT(0) +#define ICE_AQ_NVM_SANITIZE_OPERATE_HOST_CLEAN_SUCCESS BIT(1) +#define ICE_AQ_NVM_SANITIZE_OPERATE_BMC_CLEAN_DONE BIT(2) +#define ICE_AQ_NVM_SANITIZE_OPERATE_BMC_CLEAN_SUCCESS BIT(3) +u8 reserved[14 ]; +}; +/* Get LLDP MIB (indirect 0x0A00) * Note: This is also used by the LLDP MIB Change Event (0x0A01) * as the format is the same.
@@ -3092,6 +3115,7 @@ struct ice_aq_desc {struct ice_aqc_nvm nvm;struct ice_aqc_nvm_cfg nvm_cfg;struct ice_aqc_nvm_checksum nvm_checksum; +struct ice_aqc_nvm_sanitization sanitization;struct ice_aqc_set_query_pfc_mode set_query_pfc_mode;struct ice_aqc_lldp_get_mib lldp_get_mib;struct ice_aqc_lldp_set_mib_change lldp_set_event;
@@ -3343,6 +3367,7 @@ enum ice_adminq_opc { ice_aqc_opc_nvm_sr_dump =0x0707 , ice_aqc_opc_nvm_save_factory_settings =0x0708 , ice_aqc_opc_nvm_update_empr =0x0709 , + ice_aqc_opc_nvm_sanitization =0x070C ,/* LLDP commands */ ice_aqc_opc_lldp_get_mib = 0x0A00,
drivers/net/ice/base/ice_nvm.c +57 -0
60 lines not on this page · raw message
drivers/net/ice/base/ice_nvm.h +2 -0
@@ -108,4 +108,6 @@ int ice_read_sr_buf(struct ice_hw *hw, u16 offset, u16 *words, u16 *data);int ice_nvm_validate_checksum (struct ice_hw *hw);int ice_nvm_recalculate_checksum (struct ice_hw *hw); +s32 ice_nvm_sanitize_operate (struct ice_hw *hw); +s32 ice_nvm_sanitize (struct ice_hw *hw,u8 cmd_flags,u8 *values);#endif /* _ICE_NVM_H_ */
Signature · 1 line
2.43.0
PATCH v2 98/148 net/ice/base: add 200G speeds to PHY types decoding
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add the 200G speeds to the ice_get_link_speed_based_on_phy_type function. This allows detection of 200G speed instead of UKNOWN.
--- drivers/net/ice/base/ice_adminq_cmd.h | 1 + drivers/net/ice/base/ice_common.c | 12 ++++++++++++ 2 files changed, 13 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +1 -0
@@ -1624,6 +1624,7 @@ struct ice_aqc_get_link_status_data {#define ICE_AQ_LINK_SPEED_40GB BIT(8)#define ICE_AQ_LINK_SPEED_50GB BIT(9)#define ICE_AQ_LINK_SPEED_100GB BIT(10) +#define ICE_AQ_LINK_SPEED_200GB BIT(11)#define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15)__le32 reserved3;/* Aligns next field to 8-byte boundary */ __le64 phy_type_low;/* Use values from ICE_PHY_TYPE_LOW_* */
drivers/net/ice/base/ice_common.c +12 -0
@@ -3407,6 +3407,18 @@ ice_get_link_speed_based_on_phy_type(u64 phy_type_low, u64 phy_type_high)case ICE_PHY_TYPE_HIGH_100G_AUI2 : speed_phy_type_high =ICE_AQ_LINK_SPEED_100GB ;break ; +case ICE_PHY_TYPE_HIGH_200G_CR4_PAM4 : +case ICE_PHY_TYPE_HIGH_200G_SR4 : +case ICE_PHY_TYPE_HIGH_200G_FR4 : +case ICE_PHY_TYPE_HIGH_200G_LR4 : +case ICE_PHY_TYPE_HIGH_200G_DR4 : +case ICE_PHY_TYPE_HIGH_200G_KR4_PAM4 : +case ICE_PHY_TYPE_HIGH_200G_AUI4_AOC_ACC : +case ICE_PHY_TYPE_HIGH_200G_AUI4 : +case ICE_PHY_TYPE_HIGH_200G_AUI8_AOC_ACC : +case ICE_PHY_TYPE_HIGH_200G_AUI8 : + speed_phy_type_high =ICE_AQ_LINK_SPEED_200GB ; +break ;default : speed_phy_type_high =ICE_AQ_LINK_SPEED_UNKNOWN ;break ;
Signature · 1 line
2.43.0
PATCH v2 99/148 net/ice/base: temporary workaround for E830 signed package support
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add a workaround to deal with a signed package issue where the following sections are in the DDP OS package, but the FW does not support.
To allow the package and FW to work togther properly, skip downloading the unsupported sections by forcing the number of buffers in the E830 reference signature segment to be 1 instead of 3. That will bypass the download of the two buffers that contain the unsupported sections.
--- drivers/net/ice/base/ice_ddp.c | 3 +++ drivers/net/ice/base/ice_ddp.h | 1 + 2 files changed, 4 insertions(+)
drivers/net/ice/base/ice_ddp.c +3 -0
@@ -549,6 +549,9 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, start =LE32_TO_CPU (seg->signed_buf_start); count =LE32_TO_CPU (seg->signed_buf_count); +if (count ==0 && seg->seg_id ==SEGMENT_TYPE_ICE_E830 ) + seg->buf_tbl.buf_count =1 ; + state =ice_download_pkg_sig_seg (hw, seg);if (state) goto exit;
drivers/net/ice/base/ice_ddp.h +1 -0
@@ -107,6 +107,7 @@ struct ice_generic_seg_hdr {#define SEGMENT_TYPE_METADATA 0x00000001#define SEGMENT_TYPE_ICE_E810 0x00000010#define SEGMENT_TYPE_SIGNING 0x00001001 +#define SEGMENT_TYPE_ICE_E830 0x00000017#define SEGMENT_TYPE_ICE_RUN_TIME_CFG 0x00000020__le32 seg_type;struct ice_pkg_ver seg_format_ver;
Signature · 1 line
2.43.0
PATCH v2 100/148 net/ice/base: add PHY OFFSET_READY register clearing
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add a possibility to mark all transmitted/received timestamps as invalid by clearing PHY OFFSET_READY registers.
--- drivers/net/ice/base/ice_ptp_hw.c | 84 +++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_ptp_hw.h | 1 + 2 files changed, 85 insertions(+)
drivers/net/ice/base/ice_ptp_hw.c +84 -0
@@ -1981,6 +1981,38 @@ int ice_phy_cfg_rx_offset_eth56g(struct ice_hw *hw, u8 port)return ice_write_phy_reg_eth56g (hw, port,PHY_REG_RX_OFFSET_READY ,1 ); } +/** +* ice_ptp_clear_phy_offset_ready_eth56g - Clear PHY OFFSET_READY registers +* @hw: pointer to the HW struct +* +* Clear PHY TX_/RX_OFFSET_READY registers, effectively marking all transmitted +* and received timestamps as invalid. +*/ +static int ice_ptp_clear_phy_offset_ready_eth56g (struct ice_hw *hw) +{ +u8 port; + +for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +int err; + + err =ice_write_phy_reg_eth56g (hw, port, +PHY_REG_TX_OFFSET_READY ,0 ); +if (err) { +ice_warn (hw,"Failed to clear PHY TX_OFFSET_READY register\n" ); +return err; + } + + err =ice_write_phy_reg_eth56g (hw, port, +PHY_REG_RX_OFFSET_READY ,0 ); +if (err) { +ice_warn (hw,"Failed to clear PHY RX_OFFSET_READY register\n" ); +return err; + } + } + +return 0 ; +} +/** * ice_read_phy_and_phc_time_eth56g - Simultaneously capture PHC and PHY time * @hw: pointer to the HW struct
@@ -4068,6 +4100,36 @@ int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port)return 0 ; } +/** +* ice_ptp_clear_phy_offset_ready_e822 - Clear PHY TX_/RX_OFFSET_READY registers +* @hw: pointer to the HW struct +* +* Clear PHY TX_/RX_OFFSET_READY registers, effectively marking all transmitted +* and received timestamps as invalid. +*/ +static int ice_ptp_clear_phy_offset_ready_e822 (struct ice_hw *hw) +{ +u8 port; + +for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +int err; + + err =ice_write_phy_reg_e822 (hw, port,P_REG_TX_OR ,0 ); +if (err) { +ice_warn (hw,"Failed to clear PHY TX_OFFSET_READY register\n" ); +return err; + } + + err =ice_write_phy_reg_e822 (hw, port,P_REG_RX_OR ,0 ); +if (err) { +ice_warn (hw,"Failed to clear PHY RX_OFFSET_READY register\n" ); +return err; + } + } + +return 0 ; +} +/** * ice_phy_cfg_fixed_rx_offset_e822 - Configure fixed Rx offset for bypass mode * @hw: pointer to the HW struct
@@ -5801,6 +5863,28 @@ ice_ptp_adj_clock_at_time(struct ice_hw *hw, u64 at_time, s32 adj)return ice_ptp_tmr_cmd (hw,ICE_PTP_ADJ_TIME_AT_TIME , true); } +/** +* ice_ptp_clear_phy_offset_ready - Clear PHY TX_/RX_OFFSET_READY registers +* @hw: pointer to the HW struct +* +* Clear PHY TX_/RX_OFFSET_READY registers, effectively marking all transmitted +* and received timestamps as invalid. +*/ +int ice_ptp_clear_phy_offset_ready (struct ice_hw *hw) +{ +switch (hw->phy_cfg) { +case ICE_PHY_ETH56G : +return ice_ptp_clear_phy_offset_ready_eth56g (hw); +case ICE_PHY_E830 : +case ICE_PHY_E810 : +return 0 ; +case ICE_PHY_E822 : +return ice_ptp_clear_phy_offset_ready_e822 (hw); +default : +return ICE_ERR_NOT_SUPPORTED ; + } +} +/** * ice_read_phy_tstamp - Read a PHY timestamp from the timestamp block * @hw: pointer to the HW struct
drivers/net/ice/base/ice_ptp_hw.h +1 -0
@@ -137,6 +137,7 @@ int ice_ptp_write_incval_locked(struct ice_hw *hw, u64 incval);int ice_ptp_adj_clock (struct ice_hw *hw,s32 adj,bool lock_sbq);int ice_ptp_adj_clock_at_time (struct ice_hw *hw,u64 at_time,s32 adj); +int ice_ptp_clear_phy_offset_ready (struct ice_hw *hw);int ice_read_phy_tstamp (struct ice_hw *hw,u8 block,u8 idx,u64 *tstamp);int
Signature · 1 line
2.43.0
PATCH v2 101/148 net/ice/base: rename PHY model designator fields and functions
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Rename the PHY model designating fields, functions, etc to make the code more readable and distinguish it from the "PHY type" as described in the documentation.
--- drivers/net/ice/base/ice_ptp_hw.c | 44 ++++++++++++++++--------------- drivers/net/ice/base/ice_ptp_hw.h | 2 +- drivers/net/ice/base/ice_type.h | 6 ++--- drivers/net/ice/ice_ethdev.c | 6 ++--- 4 files changed, 30 insertions(+), 28 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +23 -21
@@ -846,7 +846,7 @@ static u32 ice_ptp_tmr_cmd_to_port_reg(struct ice_hw *hw,/* Certain hardware families share the same register values for the * port register and source timer register. */ -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_E810 :case ICE_PHY_E830 :return ice_ptp_tmr_cmd_to_src_reg (hw, cmd) &TS_CMD_MASK_E810 ;
@@ -2274,11 +2274,13 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_err) }/** -* ice_ptp_init_phy_cfg - Get the current TX timestamp err -* mask. Returns the mask of ports where TX timestamps are available -* @hw: pointer to the HW struct +* ice_ptp_init_phy_model - Initialize hw->phy_model based on device type +* @hw: pointer to the HW struct +* +* Determine the PHY configuration for the device, and initialize hw->phy_model +* for use by other functions. */ -int ice_ptp_init_phy_cfg (struct ice_hw *hw) +int ice_ptp_init_phy_model (struct ice_hw *hw) {int err;u32 phy_rev;
@@ -2289,14 +2291,14 @@ int ice_ptp_init_phy_cfg(struct ice_hw *hw)return err;if (phy_rev ==PHY_REVISION_ETH56G ) { - hw->phy_cfg =ICE_PHY_ETH56G ; + hw->phy_model =ICE_PHY_ETH56G ;return 0 ; }if (ice_is_e810 (hw)) - hw->phy_cfg =ICE_PHY_E810 ; + hw->phy_model =ICE_PHY_E810 ;else - hw->phy_cfg =ICE_PHY_E822 ; + hw->phy_model =ICE_PHY_E822 ; hw->phy_ports =ICE_NUM_EXTERNAL_PORTS ; hw->max_phy_port =ICE_NUM_EXTERNAL_PORTS ;
@@ -5497,7 +5499,7 @@ void ice_ptp_unlock(struct ice_hw *hw)int ice_ptp_write_port_cmd (struct ice_hw *hw,u8 port,enum ice_ptp_tmr_cmd cmd,bool lock_sbq) { -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_E822 :return ice_ptp_write_port_cmd_e822 (hw, port, cmd, lock_sbq);default :
@@ -5554,7 +5556,7 @@ static int ice_ptp_port_cmd(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,u8 port;/* PHY models which can program all ports simultaneously */ -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_E830 :return ice_ptp_port_cmd_e830 (hw, cmd, lock_sbq);case ICE_PHY_E810 :
@@ -5632,7 +5634,7 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time)/* Source timers */ /* For E830 we don't need to use shadow registers, its automatic */ -if (hw->phy_cfg ==ICE_PHY_E830 ) +if (hw->phy_model ==ICE_PHY_E830 )return ice_ptp_write_direct_phc_time_e830 (hw, time);wr32 (hw,GLTSYN_SHTIME_L (tmr_idx),ICE_LO_DWORD (time));
@@ -5641,7 +5643,7 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time)/* PHY Clks */ /* Fill Rx and Tx ports and send msg to PHY */ -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G : err =ice_ptp_prep_phy_time_eth56g (hw, time &0xFFFFFFFF );break ;
@@ -5683,14 +5685,14 @@ int ice_ptp_write_incval(struct ice_hw *hw, u64 incval) tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned;/* For E830 we don't need to use shadow registers, its automatic */ -if (hw->phy_cfg ==ICE_PHY_E830 ) +if (hw->phy_model ==ICE_PHY_E830 )return ice_ptp_write_direct_incval_e830 (hw, incval);/* Shadow Adjust */ wr32 (hw,GLTSYN_SHADJ_L (tmr_idx),ICE_LO_DWORD (incval));wr32 (hw,GLTSYN_SHADJ_H (tmr_idx),ICE_HI_DWORD (incval)); -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G : err =ice_ptp_prep_phy_incval_eth56g (hw, incval);break ;
@@ -5761,7 +5763,7 @@ int ice_ptp_adj_clock(struct ice_hw *hw, s32 adj, bool lock_sbq)wr32 (hw,GLTSYN_SHADJ_L (tmr_idx),0 );wr32 (hw,GLTSYN_SHADJ_H (tmr_idx), adj); -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G : err =ice_ptp_prep_phy_adj_eth56g (hw, adj, lock_sbq);break ;
@@ -5825,7 +5827,7 @@ ice_ptp_adj_clock_at_time(struct ice_hw *hw, u64 at_time, s32 adj)wr32 (hw,GLTSYN_SHTIME_H (tmr_idx), time_hi);/* Prepare PHY port adjustments */ -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G : err =ice_ptp_prep_phy_adj_eth56g (hw, adj, true);break ;
@@ -5843,7 +5845,7 @@ ice_ptp_adj_clock_at_time(struct ice_hw *hw, u64 at_time, s32 adj)return err;/* Set target time for each PHY port */ -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G : err =ice_ptp_prep_phy_adj_target_eth56g (hw, time_lo);break ;
@@ -5872,7 +5874,7 @@ ice_ptp_adj_clock_at_time(struct ice_hw *hw, u64 at_time, s32 adj)*/ int ice_ptp_clear_phy_offset_ready (struct ice_hw *hw) { -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G :return ice_ptp_clear_phy_offset_ready_eth56g (hw);case ICE_PHY_E830 :
@@ -5901,7 +5903,7 @@ ice_read_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx, u64 *tstamp) {int err; -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G : err =ice_read_phy_tstamp_eth56g (hw, block, idx, tstamp);break ;
@@ -5935,7 +5937,7 @@ ice_clear_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx) {int err; -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G : err =ice_clear_phy_tstamp_eth56g (hw, block, idx);break ;
@@ -5969,7 +5971,7 @@ int ice_ptp_init_phc(struct ice_hw *hw)/* Clear event status indications for auxiliary pins */ (void )rd32 (hw,GLTSYN_STAT (src_idx)); -switch (hw->phy_cfg) { +switch (hw->phy_model) {case ICE_PHY_ETH56G : err =ice_ptp_init_phc_eth56g (hw);break ;
drivers/net/ice/base/ice_ptp_hw.h +1 -1
@@ -301,7 +301,7 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass);int ice_phy_cfg_tx_offset_eth56g (struct ice_hw *hw,u8 port);int ice_phy_cfg_rx_offset_eth56g (struct ice_hw *hw,u8 port); -int ice_ptp_init_phy_cfg (struct ice_hw *hw); +int ice_ptp_init_phy_model (struct ice_hw *hw);#define PFTSYN_SEM_BYTES 4
drivers/net/ice/base/ice_type.h +3 -3
@@ -1235,8 +1235,8 @@ struct ice_switch_info {ice_declare_bitmap (prof_res_bm[ICE_MAX_NUM_PROFILES ],ICE_MAX_FV_WORDS ); }; -/* PHY configuration */ -enum ice_phy_cfg { +/* PHY model */ +enum ice_phy_model {ICE_PHY_E810 =1 ,ICE_PHY_E822 ,ICE_PHY_ETH56G ,
@@ -1268,7 +1268,7 @@ struct ice_hw {u8 revision_id;u8 pf_id;/* device profile info */ -enum ice_phy_cfg phy_cfg; +enum ice_phy_model phy_model;u8 phy_ports;u8 max_phy_port;u8 logical_pf_id;
drivers/net/ice/ice_ethdev.c +3 -3
@@ -2499,11 +2499,11 @@ ice_dev_init(struct rte_eth_dev *dev)ice_tm_conf_init (dev);if (ice_is_e810 (hw)) - hw->phy_cfg =ICE_PHY_E810 ; + hw->phy_model =ICE_PHY_E810 ;else - hw->phy_cfg =ICE_PHY_E822 ; + hw->phy_model =ICE_PHY_E822 ; -if (hw->phy_cfg ==ICE_PHY_E822 ) { +if (hw->phy_model ==ICE_PHY_E822 ) { ret =ice_start_phy_timer_e822 (hw, hw->pf_id, true);if (ret)PMD_INIT_LOG (ERR ,"Failed to start phy timer\n" );
Signature · 1 line
2.43.0
PATCH v2 102/148 net/ice/base: enable SB access explicitly before 1st PHY access
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Explicitly enable sideband device access before the first PHY access to avoid possible errors for ETH56G.
--- drivers/net/ice/base/ice_ptp_hw.c | 38 +++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 9 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +29 -9
@@ -2227,6 +2227,33 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass)return 0 ; } +/** +* ice_sb_access_ena_eth56g - Enable SB devices (PHY and others) access +* @hw: pointer to HW struct +* @enable: Enable or disable access +* +* Enable sideband devices (PHY and others) access. +*/ +static void ice_sb_access_ena_eth56g (struct ice_hw *hw,bool enable) +{ +u32 regval; + +/* Enable reading and writing switch and PHY registers over the +* sideband queue. +*/ +#define PF_SB_REM_DEV_CTL_SWITCH_READ BIT(1) +#define PF_SB_REM_DEV_CTL_PHY0 BIT(2) + regval =rd32 (hw,PF_SB_REM_DEV_CTL ); +if (enable) + regval |= (PF_SB_REM_DEV_CTL_SWITCH_READ | +PF_SB_REM_DEV_CTL_PHY0 ); +else + regval &= ~(PF_SB_REM_DEV_CTL_SWITCH_READ | +PF_SB_REM_DEV_CTL_PHY0 ); + +wr32 (hw,PF_SB_REM_DEV_CTL , regval); +} +/** * ice_ptp_init_phc_eth56g - Perform E822 specific PHC initialization * @hw: pointer to HW struct
@@ -2236,15 +2263,6 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass)static int ice_ptp_init_phc_eth56g (struct ice_hw *hw) {int err =0 ; -u32 regval; - -/* Enable reading switch and PHY registers over the sideband queue */ -#define PF_SB_REM_DEV_CTL_SWITCH_READ BIT(1) -#define PF_SB_REM_DEV_CTL_PHY0 BIT(2) - regval =rd32 (hw,PF_SB_REM_DEV_CTL ); - regval |= (PF_SB_REM_DEV_CTL_SWITCH_READ | -PF_SB_REM_DEV_CTL_PHY0 ); -wr32 (hw,PF_SB_REM_DEV_CTL , regval);/* Initialize the Clock Generation Unit */ err =ice_init_cgu_e82x (hw);
@@ -2285,6 +2303,8 @@ int ice_ptp_init_phy_model(struct ice_hw *hw)int err;u32 phy_rev; +ice_sb_access_ena_eth56g (hw, true); + err =ice_read_phy_eth56g_raw_lp (hw,PHY_REG_REVISION , &phy_rev, true);if (err)
Signature · 1 line
2.43.0
PATCH v2 103/148 net/ice/base: refactor ETH56G PHY initialization
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Assign the ETH56G PHY address according to the PCI IDs in preparation for further changes.
--- drivers/net/ice/base/ice_ptp_hw.c | 39 +++++++++++++++++++----------- drivers/net/ice/base/ice_ptp_hw.h | 2 +- drivers/net/ice/base/ice_sbq_cmd.h | 2 +- drivers/net/ice/base/ice_type.h | 1 + 4 files changed, 28 insertions(+), 16 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +25 -14
@@ -940,7 +940,7 @@ ice_write_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 val, phy_msg.msg_addr_high =ICE_HI_WORD (reg_addr); phy_msg.data = val; - phy_msg.dest_dev = phy_56g; + phy_msg.dest_dev = hw->phy_addr; err =ice_sbq_rw_reg_lp (hw, &phy_msg, lock_sbq);
@@ -970,7 +970,7 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 *val, phy_msg.msg_addr_low =ICE_LO_WORD (reg_addr); phy_msg.msg_addr_high =ICE_HI_WORD (reg_addr); - phy_msg.dest_dev = phy_56g; + phy_msg.dest_dev = hw->phy_addr; err =ice_sbq_rw_reg_lp (hw, &phy_msg, lock_sbq);
@@ -2291,6 +2291,8 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_err)return 0 ; } +#define ICE_DEVID_MASK 0xFFF8 +/** * ice_ptp_init_phy_model - Initialize hw->phy_model based on device type * @hw: pointer to the HW struct
@@ -2298,31 +2300,40 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_err)* Determine the PHY configuration for the device, and initialize hw->phy_model * for use by other functions. */ -int ice_ptp_init_phy_model (struct ice_hw *hw) +void ice_ptp_init_phy_model (struct ice_hw *hw) { -int err;u32 phy_rev; -ice_sb_access_ena_eth56g (hw, true); +switch (hw->device_id &ICE_DEVID_MASK ) { +case ICE_DEV_ID_E825C_BACKPLANE &ICE_DEVID_MASK : + hw->phy_addr = eth56g_dev_0; +break ; +default : + hw->phy_addr =0 ; + } - err =ice_read_phy_eth56g_raw_lp (hw,PHY_REG_REVISION , &phy_rev, - true); -if (err) -return err; +if (hw->phy_addr) { +int err; -if (phy_rev ==PHY_REVISION_ETH56G ) { - hw->phy_model =ICE_PHY_ETH56G ; -return 0 ; +ice_sb_access_ena_eth56g (hw, true); + err =ice_read_phy_eth56g_raw_lp (hw,PHY_REG_REVISION , + &phy_rev, true); +if (err) +return ; + +if (phy_rev ==PHY_REVISION_ETH56G ) { + hw->phy_model =ICE_PHY_ETH56G ; +return ; + } }if (ice_is_e810 (hw)) hw->phy_model =ICE_PHY_E810 ;else hw->phy_model =ICE_PHY_E822 ; + hw->phy_ports =ICE_NUM_EXTERNAL_PORTS ; hw->max_phy_port =ICE_NUM_EXTERNAL_PORTS ; - -return 0 ; }/* E822 family functions
drivers/net/ice/base/ice_ptp_hw.h +1 -1
@@ -301,7 +301,7 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass);int ice_phy_cfg_tx_offset_eth56g (struct ice_hw *hw,u8 port);int ice_phy_cfg_rx_offset_eth56g (struct ice_hw *hw,u8 port); -int ice_ptp_init_phy_model (struct ice_hw *hw); +void ice_ptp_init_phy_model (struct ice_hw *hw);#define PFTSYN_SEM_BYTES 4
drivers/net/ice/base/ice_sbq_cmd.h +1 -1
@@ -48,7 +48,7 @@ struct ice_sbq_evt_desc { };enum ice_sbq_msg_dev { - phy_56g =0x02 , + eth56g_dev_0 =0x02 , rmn_0 =0x02 , rmn_1 =0x03 , rmn_2 =0x04 ,
drivers/net/ice/base/ice_type.h +1 -0
@@ -1269,6 +1269,7 @@ struct ice_hw {u8 pf_id;/* device profile info */ enum ice_phy_model phy_model; +u8 phy_addr;/* PHY address */ u8 phy_ports;u8 max_phy_port;u8 logical_pf_id;
Signature · 1 line
2.43.0
PATCH v2 104/148 net/ice/base: refactor ETH56G support for miltiple PHYs per MAC
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Support configurations with multiple ETH56G PHYs per a MAC complex. These PHYs have their own addresses and are supposed to have their ports numbered contiguously. This commit mainly provides port number translation for these configurations
Also, handle dual NAC correctly for max PHY ports as they differ from everything else.
--- drivers/net/ice/base/ice_ptp_hw.c | 234 ++++++++++++++++++----------- drivers/net/ice/base/ice_sbq_cmd.h | 3 +- drivers/net/ice/base/ice_status.h | 2 + drivers/net/ice/base/ice_type.h | 18 ++- 4 files changed, 169 insertions(+), 88 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +149 -85
@@ -911,8 +911,13 @@ static void ice_ptp_exec_tmr_cmd(struct ice_hw *hw)ice_flush (hw); } +enum eth56g_res_type { +ETH56G_PHY_REG , +ETH56G_PHY_MEM , +}; +/* 56G PHY access functions */ -static const u32 eth56g_port_base[ICE_NUM_PHY_PORTS ] = { +static const u32 ice_eth56g_port_base[ICE_NUM_PHY_PORTS ] = {ICE_PHY0_BASE ,ICE_PHY1_BASE ,ICE_PHY2_BASE ,
@@ -923,13 +928,14 @@ static const u32 eth56g_port_base[ICE_NUM_PHY_PORTS] = {/** * ice_write_phy_eth56g_raw_lp - Write a PHY port register with lock parameter * @hw: pointer to the HW struct +* @phy_index: PHY index * @reg_addr: PHY register address * @val: Value to write * @lock_sbq: true to lock the sideband queue */ static int -ice_write_phy_eth56g_raw_lp (struct ice_hw *hw,u32 reg_addr,u32 val, -bool lock_sbq) +ice_write_phy_eth56g_raw_lp (struct ice_hw *hw,u8 phy_index,u32 reg_addr, +u32 val,bool lock_sbq) {struct ice_sbq_msg_input phy_msg;int err;
@@ -940,7 +946,7 @@ ice_write_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 val, phy_msg.msg_addr_high =ICE_HI_WORD (reg_addr); phy_msg.data = val; - phy_msg.dest_dev = hw->phy_addr; + phy_msg.dest_dev = hw->phy_addr[phy_index]; err =ice_sbq_rw_reg_lp (hw, &phy_msg, lock_sbq);
@@ -954,13 +960,14 @@ ice_write_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 val,/** * ice_read_phy_eth56g_raw_lp - Read a PHY port register with lock parameter * @hw: pointer to the HW struct -* @reg_addr: PHY port register address -* @val: Pointer to the value to read (out param) +* @phy_index: PHY index +* @reg_addr: PHY register address +* @val: Value to write * @lock_sbq: true to lock the sideband queue */ static int -ice_read_phy_eth56g_raw_lp (struct ice_hw *hw,u32 reg_addr,u32 *val, -bool lock_sbq) +ice_read_phy_eth56g_raw_lp (struct ice_hw *hw,u8 phy_index,u32 reg_addr, +u32 *val,bool lock_sbq) {struct ice_sbq_msg_input phy_msg;int err;
@@ -970,7 +977,8 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 *val, phy_msg.msg_addr_low =ICE_LO_WORD (reg_addr); phy_msg.msg_addr_high =ICE_HI_WORD (reg_addr); - phy_msg.dest_dev = hw->phy_addr; + phy_msg.data =0 ; + phy_msg.dest_dev = hw->phy_addr[phy_index]; err =ice_sbq_rw_reg_lp (hw, &phy_msg, lock_sbq);
@@ -986,47 +994,95 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 *val,/** * ice_phy_port_reg_address_eth56g - Calculate a PHY port register address * @port: Port number to be written +* @res_type: resource type (register/memory) * @offset: Offset from PHY port register base * @address: The result address */ static int -ice_phy_port_reg_address_eth56g (u8 port,u16 offset,u32 *address) +ice_phy_port_res_address_eth56g (u8 port,enum eth56g_res_type res_type, +u16 offset,u32 *address) {u8 phy, lane; -if (port >=ICE_NUM_EXTERNAL_PORTS ) -return ICE_ERR_OUT_OF_RANGE ; - phy = port /ICE_PORTS_PER_QUAD ; lane = port %ICE_PORTS_PER_QUAD ; - *address = offset + eth56g_port_base[phy] + -PHY_PTP_LANE_ADDR_STEP * lane; +switch (res_type) { +case ETH56G_PHY_REG : + *address = offset + ice_eth56g_port_base[phy] + +PHY_PTP_LANE_ADDR_STEP * lane; +break ; +case ETH56G_PHY_MEM : + *address = offset + ice_eth56g_port_base[phy] + +PHY_PTP_MEM_START +PHY_PTP_MEM_LANE_STEP * lane; +break ; +default : +return ICE_ERR_PARAM ; + }return 0 ; }/** -* ice_phy_port_mem_address_eth56g - Calculate a PHY port memory address -* @port: Port number to be written -* @offset: Offset from PHY port register base -* @address: The result address +* ice_write_phy_port_eth56g_lp - Write a PHY port register with lock parameter +* @hw: pointer to the HW struct +* @reg_offs: PHY register offset +* @port: Port number +* @val: Value to write +* @res_type: resource type (register/memory) +* @lock_sbq: true to lock the sideband queue */ static int -ice_phy_port_mem_address_eth56g (u8 port,u16 offset,u32 *address) +ice_write_phy_port_eth56g_lp (struct ice_hw *hw,u8 port,u32 reg_offs,u32 val, +enum eth56g_res_type res_type,bool lock_sbq) { -u8 phy, lane; +u8 phy_index = port / hw->phy_ports; +u8 phy_port = port % hw->phy_ports; +int err; +u32 reg_addr; -if (port >=ICE_NUM_EXTERNAL_PORTS ) +if (port >= hw->phy_ports)return ICE_ERR_OUT_OF_RANGE ; - phy = port /ICE_PORTS_PER_QUAD ; - lane = port %ICE_PORTS_PER_QUAD ; + err =ice_phy_port_res_address_eth56g (phy_port, res_type, reg_offs, + ®_addr); - *address = offset + eth56g_port_base[phy] + -PHY_PTP_MEM_START +PHY_PTP_MEM_LANE_STEP * lane; +if (err) +return err; -return 0 ; +return ice_write_phy_eth56g_raw_lp (hw, phy_index, reg_addr, val, + lock_sbq); +} + +/** +* ice_read_phy_port_eth56g_lp - Read a PHY port register with lock parameter +* @hw: pointer to the HW struct +* @reg_offs: PHY register offset +* @port: Port number +* @val: Value to write +* @res_type: resource type (register/memory) +* @lock_sbq: true to lock the sideband queue +*/ +static int +ice_read_phy_port_eth56g_lp (struct ice_hw *hw,u8 port,u32 reg_offs,u32 *val, +enum eth56g_res_type res_type,bool lock_sbq) +{ +u8 phy_index = port / hw->phy_ports; +u8 phy_port = port % hw->phy_ports; +int err; +u32 reg_addr; + +if (port >= hw->phy_ports) +return ICE_ERR_OUT_OF_RANGE ; + + err =ice_phy_port_res_address_eth56g (phy_port, res_type, reg_offs, + ®_addr); + +if (err) +return err; + +return ice_read_phy_eth56g_raw_lp (hw, phy_index, reg_addr, val, + lock_sbq); }/**
@@ -1041,14 +1097,8 @@ static int ice_write_phy_reg_eth56g_lp(struct ice_hw *hw, u8 port, u16 offset, u32 val, bool lock_sbq) { - int err; -u32 reg_addr; - - err =ice_phy_port_reg_address_eth56g (port, offset, ®_addr); -if (err) -return err; - -return ice_write_phy_eth56g_raw_lp (hw, reg_addr, val, lock_sbq); + return ice_write_phy_port_eth56g_lp(hw, port, offset, val, + ETH56G_PHY_REG, lock_sbq); }/**
@@ -1077,14 +1127,8 @@ static int ice_read_phy_reg_eth56g_lp(struct ice_hw *hw, u8 port, u16 offset, u32 *val, bool lock_sbq) { - int err; -u32 reg_addr; - - err =ice_phy_port_reg_address_eth56g (port, offset, ®_addr); -if (err) -return err; - -return ice_read_phy_eth56g_raw_lp (hw, reg_addr, val, lock_sbq); + return ice_read_phy_port_eth56g_lp(hw, port, offset, val, + ETH56G_PHY_REG, lock_sbq); }/**
@@ -1113,14 +1157,8 @@ static int ice_phy_port_mem_read_eth56g_lp(struct ice_hw *hw, u8 port, u16 offset, u32 *val, bool lock_sbq) { - int err; -u32 mem_addr; - - err =ice_phy_port_mem_address_eth56g (port, offset, &mem_addr); -if (err) -return err; - -return ice_read_phy_eth56g_raw_lp (hw, mem_addr, val, lock_sbq); + return ice_read_phy_port_eth56g_lp(hw, port, offset, val, + ETH56G_PHY_MEM, lock_sbq); }/**
@@ -1150,14 +1188,8 @@ static int ice_phy_port_mem_write_eth56g_lp(struct ice_hw *hw, u8 port, u16 offset, u32 val, bool lock_sbq) { - int err; -u32 mem_addr; - - err =ice_phy_port_mem_address_eth56g (port, offset, &mem_addr); -if (err) -return err; - -return ice_write_phy_eth56g_raw_lp (hw, mem_addr, val, lock_sbq); + return ice_write_phy_port_eth56g_lp(hw, port, offset, val, + ETH56G_PHY_MEM, lock_sbq); }/**
@@ -2271,22 +2303,35 @@ static int ice_ptp_init_phc_eth56g(struct ice_hw *hw) }/** -* ice_ptp_read_tx_hwtstamp_status_eth56g - Get the current TX timestamp -* err mask. Returns the mask of ports where TX timestamps are available +* ice_ptp_read_tx_hwtstamp_status_eth56g - Get TX timestamp status * @hw: pointer to the HW struct -* @ts_err: the timestamp mask pointer +* @ts_status: the timestamp mask pointer +* +* Read the PHY Tx timestamp status mask indicating which ports have Tx +* timestamps available. */ int -ice_ptp_read_tx_hwtstamp_status_eth56g (struct ice_hw *hw,u32 *ts_err) +ice_ptp_read_tx_hwtstamp_status_eth56g (struct ice_hw *hw,u32 *ts_status) { -int err; +u32 curr_status; +u8 phy, mask; - err =ice_read_phy_eth56g_raw_lp (hw,PHY_PTP_INT_STATUS , ts_err, - true); -if (err) -return err; + mask = (1 << hw->phy_ports) -1 ; + *ts_status =0 ; -ice_debug (hw,ICE_DBG_PTP ,"PHY interrupt err: %x\n" , *ts_err); +for (phy =0 ; phy < hw->num_phys; phy++) { +int err; + + err =ice_read_phy_eth56g_raw_lp (hw, phy,PHY_PTP_INT_STATUS , + &curr_status, true); + +if (err) +return err; + + *ts_status |= (curr_status & mask) << (phy * hw->phy_ports); + } + +ice_debug (hw,ICE_DBG_PTP ,"PHY interrupt err: %x\n" , *ts_status);return 0 ; }
@@ -2295,37 +2340,56 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_err)/** * ice_ptp_init_phy_model - Initialize hw->phy_model based on device type -* @hw: pointer to the HW struct +* @hw: pointer to the HW structure * -* Determine the PHY configuration for the device, and initialize hw->phy_model +* Determine the PHY model for the device, and initialize hw->phy_model * for use by other functions. */ void ice_ptp_init_phy_model (struct ice_hw *hw) { -u32 phy_rev; +unsigned int phy; + +for (phy =0 ; phy <MAX_PHYS_PER_ICE ; phy++) + hw->phy_addr[phy] =0 ;switch (hw->device_id &ICE_DEVID_MASK ) {case ICE_DEV_ID_E825C_BACKPLANE &ICE_DEVID_MASK : - hw->phy_addr = eth56g_dev_0; + hw->phy_addr[0 ] = eth56g_dev_0; + hw->phy_addr[1 ] = eth56g_dev_1; + hw->num_phys =ICE_PHYS_PER_CPLX_C825X ; + hw->phy_ports =ICE_PORTS_PER_PHY_C825X ; + hw->max_phy_port =ice_is_nac_dual (hw) ? +ICE_PORTS_PER_PHY_C825X : +ICE_PHYS_PER_CPLX_C825X *ICE_PORTS_PER_PHY_C825X ;break ;default : - hw->phy_addr =0 ; + goto e8xx; } -if (hw->phy_addr) { -int err; +ice_sb_access_ena_eth56g (hw, true); +for (phy =0 ; phy < hw->num_phys; phy++) +if (hw->phy_addr[phy]) { +int err; +u32 phy_rev; -ice_sb_access_ena_eth56g (hw, true); - err =ice_read_phy_eth56g_raw_lp (hw,PHY_REG_REVISION , - &phy_rev, true); -if (err) -return ; + err =ice_read_phy_eth56g_raw_lp (hw, phy, +PHY_REG_REVISION , + &phy_rev, true); +if (err) { + hw->phy_model =ICE_PHY_UNSUP ; +return ; + } -if (phy_rev ==PHY_REVISION_ETH56G ) { - hw->phy_model =ICE_PHY_ETH56G ; -return ; +if (phy_rev !=PHY_REVISION_ETH56G ) { + hw->phy_model =ICE_PHY_UNSUP ; +return ; + } } - } + + hw->phy_model =ICE_PHY_ETH56G ; + +return ; +e8xx:if (ice_is_e810 (hw)) hw->phy_model =ICE_PHY_E810 ;
drivers/net/ice/base/ice_sbq_cmd.h +2 -1
@@ -48,7 +48,8 @@ struct ice_sbq_evt_desc { };enum ice_sbq_msg_dev { - eth56g_dev_0 =0x02 , + eth56g_dev_0 =2 , + eth56g_dev_1 =13 , rmn_0 =0x02 , rmn_1 =0x03 , rmn_2 =0x04 ,
drivers/net/ice/base/ice_status.h +2 -0
@@ -36,6 +36,8 @@ enum ice_status {ICE_ERR_BUF_TOO_SHORT =-52 ,ICE_ERR_NVM_BLANK_MODE =-53 , +ICE_ERR_UNKNOWN_PHY =-60 , +/* ARQ/ASQ specific error codes. Range -100..-109 */ ICE_ERR_AQ_ERROR =-100 , ICE_ERR_AQ_TIMEOUT = -101,
drivers/net/ice/base/ice_type.h +16 -2
@@ -1237,12 +1237,18 @@ struct ice_switch_info {/* PHY model */ enum ice_phy_model { -ICE_PHY_E810 =1 , +ICE_PHY_UNSUP =-1 , +ICE_PHY_E810 =1 ,ICE_PHY_E822 ,ICE_PHY_ETH56G ,ICE_PHY_E830 , }; +enum ice_eth56g_mode { +ICE_ETH56G_MODE_0 , +ICE_ETH56G_MODE_1 , +}; +/* Port hardware description */ struct ice_hw {u8 *hw_addr;
@@ -1269,9 +1275,17 @@ struct ice_hw {u8 pf_id;/* device profile info */ enum ice_phy_model phy_model; -u8 phy_addr;/* PHY address */ u8 phy_ports;u8 max_phy_port; +#define ICE_PHYS_PER_CPLX_E824S 1 +#define ICE_PORTS_PER_PHY_E824S 8 + +#define ICE_PHYS_PER_CPLX_C825X 2 +#define ICE_PORTS_PER_PHY_C825X 4 + +#define MAX_PHYS_PER_ICE 2 +u8 num_phys; +u8 phy_addr[MAX_PHYS_PER_ICE ];/* PHY address */ u8 logical_pf_id;u16 max_burst_size;/* driver sets this value */
Signature · 1 line
2.43.0
Re: [PATCH v2 104/148] net/ice/base: refactor ETH56G support for miltiple PHYs per MAC
Quoted 10 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
Support configurations with multiple ETH56G PHYs per a MAC complex. These PHYs have their own addresses and are supposed to have their ports numbered contiguously. This commit mainly provides port number translation for these configurations
Also, handle dual NAC correctly for max PHY ports as they differ from everything else.
Quoted 9 lines
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Ian Stokes <[email protected]>--- drivers/net/ice/base/ice_ptp_hw.c | 234 ++++++++++++++++++----------- drivers/net/ice/base/ice_sbq_cmd.h | 3 +- drivers/net/ice/base/ice_status.h | 2 + drivers/net/ice/base/ice_type.h | 18 ++- 4 files changed, 169 insertions(+), 88 deletions(-)
Typo in title - "multiple".
Patch-by-patch build flags that "ice_is_nac_dual" definition is missing in this patch. From what I can see, it's added later in patch 112, so that definition needs to be moved here.
/Bruce
PATCH v2 105/148 net/ice/base: implement interface to reset timestamp memory
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add an interface to clear the timestamp memory block for E822 and ETH56G based devices.
--- drivers/net/ice/base/ice_ptp_hw.c | 65 +++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_ptp_hw.h | 2 + 2 files changed, 67 insertions(+)
drivers/net/ice/base/ice_ptp_hw.c +65 -0
@@ -1481,6 +1481,25 @@ ice_clear_phy_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx)return 0 ; } +/** +* ice_ptp_reset_ts_memory_eth56g - Clear all timestamps from the port block +* @hw: pointer to the HW struct +*/ +static void ice_ptp_reset_ts_memory_eth56g (struct ice_hw *hw) +{ +unsigned int port; + +for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +if (!(hw->ena_lports &BIT (port))) +continue ; + +ice_write_phy_reg_eth56g (hw, port,PHY_REG_TX_MEMORY_STATUS_L , +0 ); +ice_write_phy_reg_eth56g (hw, port,PHY_REG_TX_MEMORY_STATUS_U , +0 ); + } +} +/** * ice_ptp_prep_port_phy_time_eth56g - Prepare one PHY port with initial time * @hw: pointer to the HW struct
@@ -3002,6 +3021,33 @@ ice_clear_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx)return 0 ; } +/** +* ice_ptp_reset_ts_memory_quad_e822 - Clear all timestamps from the quad block +* @hw: pointer to the HW struct +* @quad: the quad to read from +* +* Clear all timestamps from the PHY quad block that is shared between the +* internal PHYs on the E822 devices. +*/ +void ice_ptp_reset_ts_memory_quad_e822 (struct ice_hw *hw,u8 quad) +{ +ice_write_quad_reg_e822 (hw, quad,Q_REG_TS_CTRL ,Q_REG_TS_CTRL_M ); +ice_write_quad_reg_e822 (hw, quad,Q_REG_TS_CTRL , ~(u32 )Q_REG_TS_CTRL_M ); +} + +/** +* ice_ptp_reset_ts_memory_e822 - Clear all timestamps from all quad blocks +* @hw: pointer to the HW struct +*/ +static void ice_ptp_reset_ts_memory_e822 (struct ice_hw *hw) +{ +u8 quad; + +for (quad =0 ; quad <ICE_MAX_QUAD ; quad++) { +ice_ptp_reset_ts_memory_quad_e822 (hw, quad); + } +} +/** * ice_ptp_set_vernier_wl - Set the window length for vernier calibration * @hw: pointer to the HW struct
@@ -6049,6 +6095,25 @@ ice_clear_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx)return err; } +/** +* ice_ptp_reset_ts_memory - Reset timestamp memory for all blocks +* @hw: pointer to the HW struct +*/ +void ice_ptp_reset_ts_memory (struct ice_hw *hw) +{ +switch (hw->phy_model) { +case ICE_PHY_ETH56G : +ice_ptp_reset_ts_memory_eth56g (hw); +break ; +case ICE_PHY_E822 : +ice_ptp_reset_ts_memory_e822 (hw); +break ; +case ICE_PHY_E810 : +default : +return ; + } +} +/** * ice_ptp_init_phc - Initialize PTP hardware clock * @hw: pointer to the HW struct
drivers/net/ice/base/ice_ptp_hw.h +2 -0
@@ -142,6 +142,7 @@ int ice_read_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx, u64 *tstamp);int ice_clear_phy_tstamp (struct ice_hw *hw,u8 block,u8 idx); +void ice_ptp_reset_ts_memory (struct ice_hw *hw);int ice_ptp_init_phc (struct ice_hw *hw);bool refsync_pin_id_valid (struct ice_hw *hw,u8 id);int
@@ -165,6 +166,7 @@ ice_ptp_read_phy_incval_e822(struct ice_hw *hw, u8 port, u64 *incval);int ice_ptp_read_port_capture_e822 (struct ice_hw *hw,u8 port,u64 *tx_ts,u64 *rx_ts); +void ice_ptp_reset_ts_memory_quad_e822 (struct ice_hw *hw,u8 quad);int ice_cfg_cgu_pll_e822 (struct ice_hw *hw,enum ice_time_ref_freq *clk_freq,enum ice_clk_src *clk_src);
Signature · 1 line
2.43.0
PATCH v2 106/148 net/ice/base: fix iterations over PTP ports
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Replace 'phy_ports' with 'max_phy_port' for max range in iterations over PTP ports in case of ETH56G based devices.
--- drivers/net/ice/base/ice_ptp_hw.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +15 -15
@@ -1041,7 +1041,7 @@ ice_write_phy_port_eth56g_lp(struct ice_hw *hw, u8 port, u32 reg_offs, u32 val,int err;u32 reg_addr; -if (port >= hw->phy_ports) +if (port >= hw->max_phy_port)return ICE_ERR_OUT_OF_RANGE ; err = ice_phy_port_res_address_eth56g(phy_port, res_type, reg_offs,
@@ -1072,7 +1072,7 @@ ice_read_phy_port_eth56g_lp(struct ice_hw *hw, u8 port, u32 reg_offs, u32 *val,int err;u32 reg_addr; -if (port >= hw->phy_ports) +if (port >= hw->max_phy_port)return ICE_ERR_OUT_OF_RANGE ; err = ice_phy_port_res_address_eth56g(phy_port, res_type, reg_offs,
@@ -1489,7 +1489,7 @@ static void ice_ptp_reset_ts_memory_eth56g(struct ice_hw *hw) {unsigned int port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->max_phy_port; port++) {if (!(hw->ena_lports &BIT (port)))continue ;
@@ -1547,7 +1547,7 @@ ice_ptp_prep_phy_time_eth56g(struct ice_hw *hw, u32 time)*/ phy_time = (u64 )time <<32 ; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->max_phy_port; port++) {int err;if (!(hw->ena_lports &BIT (port)))continue ;
@@ -1644,7 +1644,7 @@ ice_ptp_prep_phy_adj_eth56g(struct ice_hw *hw, s32 adj, bool lock_sbq)*/ cycles = (s64 )adj <<32 ; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->max_phy_port; port++) {if (!(hw->ena_lports &BIT (port)))continue ;
@@ -1670,7 +1670,7 @@ ice_ptp_prep_phy_incval_eth56g(struct ice_hw *hw, u64 incval) {u8 port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->max_phy_port; port++) {int err;if (!(hw->ena_lports &BIT (port)))continue ;
@@ -1732,7 +1732,7 @@ ice_ptp_prep_phy_adj_target_eth56g(struct ice_hw *hw, u32 target_time)int err;u8 port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->max_phy_port; port++) {if (!(hw->ena_lports &BIT (port)))continue ;
@@ -1919,7 +1919,7 @@ ice_ptp_port_cmd_eth56g(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,int err;u8 port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->max_phy_port; port++) {if (!(hw->ena_lports &BIT (port)))continue ;
@@ -2043,7 +2043,7 @@ static int ice_ptp_clear_phy_offset_ready_eth56g(struct ice_hw *hw) {u8 port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->max_phy_port; port++) {int err; err = ice_write_phy_reg_eth56g(hw, port,
@@ -3058,7 +3058,7 @@ int ice_ptp_set_vernier_wl(struct ice_hw *hw) {u8 port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->phy_ports; port++) {int err; err = ice_write_phy_reg_e822_lp(hw, port, P_REG_WL,
@@ -3123,7 +3123,7 @@ ice_ptp_prep_phy_time_e822(struct ice_hw *hw, u32 time)*/ phy_time = (u64 )time <<32 ; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->phy_ports; port++) {/* Tx case */ err = ice_write_64b_phy_reg_e822(hw, port,
@@ -3232,7 +3232,7 @@ ice_ptp_prep_phy_adj_e822(struct ice_hw *hw, s32 adj, bool lock_sbq)else cycles = -(((s64)-adj) <<32 ); -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->phy_ports; port++) {int err; err =ice_ptp_prep_port_adj_e822 (hw, port, cycles, lock_sbq);
@@ -3258,7 +3258,7 @@ ice_ptp_prep_phy_incval_e822(struct ice_hw *hw, u64 incval)int err;u8 port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->phy_ports; port++) { err =ice_write_40b_phy_reg_e822 (hw, port,P_REG_TIMETUS_L , incval);if (err)
@@ -3319,7 +3319,7 @@ ice_ptp_prep_phy_adj_target_e822(struct ice_hw *hw, u32 target_time)int err;u8 port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->phy_ports; port++) {/* Tx case */ /* No sub-nanoseconds data */
@@ -4254,7 +4254,7 @@ static int ice_ptp_clear_phy_offset_ready_e822(struct ice_hw *hw) {u8 port; -for (port =0 ; port <ICE_NUM_EXTERNAL_PORTS ; port++) { +for (port =0 ; port < hw->phy_ports; port++) {int err; err =ice_write_phy_reg_e822 (hw, port,P_REG_TX_OR ,0 );
Signature · 1 line
2.43.0
PATCH v2 107/148 net/ice/base: return high address for multi-read eth56g registers
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
The eth56g register checks for 40b and 64b registers do not return the high address offset. Instead it is expected that all offsets are exactly 4 bytes apart in the expected order. The e822 implementations explicitly return the address in the lookup function. This form is better because it allows for the potential of registers which may not have a static offset.
Match the e822 style by refactoring these functions to return the high address in a function parameter.
--- drivers/net/ice/base/ice_ptp_hw.c | 43 ++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 12 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +31 -12
@@ -1209,19 +1209,35 @@ ice_phy_port_mem_write_eth56g(struct ice_hw *hw, u8 port, u16 offset, u32 val)/** * ice_is_64b_phy_reg_eth56g - Check if this is a 64bit PHY register * @low_addr: the low address to check +* @high_addr: on return, contains the high address of the 64bit register * * Checks if the provided low address is one of the known 64bit PHY values -* represented as two 32bit registers. +* represented as two 32bit registers. If it is, return the appropriate high +* register offset to use. */ -static bool ice_is_64b_phy_reg_eth56g (u16 low_addr) +static bool ice_is_64b_phy_reg_eth56g (u16 low_addr,u16 *high_addr) {switch (low_addr) {case PHY_REG_TX_TIMER_INC_PRE_L : + *high_addr =PHY_REG_TX_TIMER_INC_PRE_U ; +return true;case PHY_REG_RX_TIMER_INC_PRE_L : + *high_addr =PHY_REG_RX_TIMER_INC_PRE_U ; +return true;case PHY_REG_TX_CAPTURE_L : + *high_addr =PHY_REG_TX_CAPTURE_U ; +return true;case PHY_REG_RX_CAPTURE_L : + *high_addr =PHY_REG_RX_CAPTURE_U ; +return true;case PHY_REG_TOTAL_TX_OFFSET_L : + *high_addr =PHY_REG_TOTAL_TX_OFFSET_U ; +return true;case PHY_REG_TOTAL_RX_OFFSET_L : + *high_addr =PHY_REG_TOTAL_RX_OFFSET_U ; +return true; +case PHY_REG_TX_MEMORY_STATUS_L : + *high_addr =PHY_REG_TX_MEMORY_STATUS_U ;return true;default :return false;
@@ -1231,15 +1247,18 @@ static bool ice_is_64b_phy_reg_eth56g(u16 low_addr)/** * ice_is_40b_phy_reg_eth56g - Check if this is a 40bit PHY register * @low_addr: the low address to check +* @high_addr: on return, contains the high address of the 40bit value * * Checks if the provided low address is one of the known 40bit PHY values * split into two registers with the lower 8 bits in the low register and the -* upper 32 bits in the high register. +* upper 32 bits in the high register. If it is, return the high register +* offset to use. */ -static bool ice_is_40b_phy_reg_eth56g (u16 low_addr) +static bool ice_is_40b_phy_reg_eth56g (u16 low_addr,u16 *high_addr) {switch (low_addr) {case PHY_REG_TIMETUS_L : + *high_addr =PHY_REG_TIMETUS_U ;return true;default :return false;
@@ -1261,11 +1280,11 @@ static bool ice_is_40b_phy_reg_eth56g(u16 low_addr)static int ice_read_40b_phy_reg_eth56g (struct ice_hw *hw,u8 port,u16 low_addr,u64 *val) { -u16 high_addr = low_addr +sizeof (u32);int err; +u16 high_addr;u32 lo, hi; -if (!ice_is_40b_phy_reg_eth56g (low_addr)) +if (!ice_is_40b_phy_reg_eth56g (low_addr, &high_addr))return ICE_ERR_PARAM ; err =ice_read_phy_reg_eth56g (hw, port, low_addr, &lo);
@@ -1302,11 +1321,11 @@ ice_read_40b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val)static int ice_read_64b_phy_reg_eth56g (struct ice_hw *hw,u8 port,u16 low_addr,u64 *val) { -u16 high_addr = low_addr +sizeof (u32);int err; +u16 high_addr;u32 lo, hi; -if (!ice_is_64b_phy_reg_eth56g (low_addr)) +if (!ice_is_64b_phy_reg_eth56g (low_addr, &high_addr))return ICE_ERR_PARAM ; err =ice_read_phy_reg_eth56g (hw, port, low_addr, &lo);
@@ -1343,11 +1362,11 @@ ice_read_64b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val)static int ice_write_40b_phy_reg_eth56g (struct ice_hw *hw,u8 port,u16 low_addr,u64 val) { -u16 high_addr = low_addr +sizeof (u32);int err; +u16 high_addr;u32 lo, hi; -if (!ice_is_40b_phy_reg_eth56g (low_addr)) +if (!ice_is_40b_phy_reg_eth56g (low_addr, &high_addr))return ICE_ERR_PARAM ; lo = (u32)(val &P_REG_40B_LOW_M );
@@ -1384,11 +1403,11 @@ ice_write_40b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 val)static int ice_write_64b_phy_reg_eth56g (struct ice_hw *hw,u8 port,u16 low_addr,u64 val) { -u16 high_addr = low_addr +sizeof (u32);int err; +u16 high_addr;u32 lo, hi; -if (!ice_is_64b_phy_reg_eth56g (low_addr)) +if (!ice_is_64b_phy_reg_eth56g (low_addr, &high_addr))return ICE_ERR_PARAM ; lo =ICE_LO_DWORD (val);
Signature · 1 line
2.43.0
PATCH v2 108/148 net/ice/base: add function to read Tx timestamp status register
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Both e822 and eth56g based hardware have a register indicating the status of timestamps in the Tx timestamp memory bank. This register is used to indicate which timestamps are currently valid. This is important because the interrupt logic for these devices assumes that software will only read registers with the valid bit set. If software does not follow this practice, it can potentially cause hardware to stop reporting timestamp interrupts.
Use of the status register value also allows software to avoid unnecessarily reading timestamps which haven't yet been captured.
Add a helper function which reads the timestamp memory status registers for these devices.
For e810, it is not clear if the hardware has an equivalent register. Instead, implement a stub which just reports that all timestamps are valid. This allows the timestamp tracking logic to use the same function for all current device variants.
--- drivers/net/ice/base/ice_ptp_hw.c | 113 ++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_ptp_hw.h | 6 ++ 2 files changed, 119 insertions(+)
drivers/net/ice/base/ice_ptp_hw.c +113 -0
@@ -2374,6 +2374,33 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)return 0 ; } +/** +* ice_get_phy_tx_tstamp_ready_eth56g - Read the Tx memory status register +* @hw: pointer to the HW struct +* @port: the PHY port to read from +* @tstamp_ready: contents of the Tx memory status register +* +* Read the PHY_REG_TX_MEMORY_STATUS register indicating which timestamps in +* the PHY are ready. A set bit means the corresponding timestamp is valid and +* ready to be captured from the PHY timestamp block. +*/ +static int +ice_get_phy_tx_tstamp_ready_eth56g (struct ice_hw *hw,u8 port, +u64 *tstamp_ready) +{ +int err; + + err =ice_read_64b_phy_reg_eth56g (hw, port,PHY_REG_TX_MEMORY_STATUS_L , + tstamp_ready); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read TX_MEMORY_STATUS for port %u, err %d\n" , + port, err); +return err; + } + +return 0 ; +} +#define ICE_DEVID_MASK 0xFFF8/**
@@ -4630,6 +4657,41 @@ ice_start_phy_timer_e822(struct ice_hw *hw, u8 port, bool bypass)return 0 ; } +/** +* ice_get_phy_tx_tstamp_ready_e822 - Read Tx memory status register +* @hw: pointer to the HW struct +* @quad: the timestamp quad to read from +* @tstamp_ready: contents of the Tx memory status register +* +* Read the Q_REG_TX_MEMORY_STATUS register indicating which timestamps in +* the PHY are ready. A set bit means the corresponding timestamp is valid and +* ready to be captured from the PHY timestamp block. +*/ +static int +ice_get_phy_tx_tstamp_ready_e822 (struct ice_hw *hw,u8 quad,u64 *tstamp_ready) +{ +u32 hi, lo; +int err; + + err =ice_read_quad_reg_e822 (hw, quad,Q_REG_TX_MEMORY_STATUS_U , &hi); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read TX_MEMORY_STATUS_U for quad %u, err %d\n" , + quad, err); +return err; + } + + err =ice_read_quad_reg_e822 (hw, quad,Q_REG_TX_MEMORY_STATUS_L , &lo); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read TX_MEMORY_STATUS_L for quad %u, err %d\n" , + quad, err); +return err; + } + + *tstamp_ready = (u64 )hi <<32 | (u64 )lo; + +return 0 ; +} +/** * ice_phy_exit_bypass_e822 - Exit bypass mode, after vernier calculations * @hw: pointer to the HW struct
@@ -5168,6 +5230,22 @@ int ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,return 0 ; } +/** +* ice_get_phy_tx_tstamp_ready_e810 - Read Tx memory status register +* @hw: pointer to the HW struct +* @port: the PHY port to read +* @tstamp_ready: contents of the Tx memory status register +* +* E810 devices do not use a Tx memory status register. Instead simply +* indicate that all timestamps are currently ready. +*/ +static int +ice_get_phy_tx_tstamp_ready_e810 (struct ice_hw *hw,u8 port,u64 *tstamp_ready) +{ + *tstamp_ready =0xFFFFFFFFFFFFFFFF ; +return 0 ; +} +/* E810T SMA functions * * The following functions operate specifically on E810T hardware and are used
@@ -6167,6 +6245,41 @@ int ice_ptp_init_phc(struct ice_hw *hw)return err; } +/** +* ice_get_phy_tx_tstamp_ready - Read PHY Tx memory status indication +* @hw: pointer to the HW struct +* @block: the timestamp block to check +* @tstamp_ready: storage for the PHY Tx memory status information +* +* Check the PHY for Tx timestamp memory status. This reports a 64 bit value +* which indicates which timestamps in the block may be captured. A set bit +* means the timestamp can be read. An unset bit means the timestamp is not +* ready and software should avoid reading the register. +*/ +int ice_get_phy_tx_tstamp_ready (struct ice_hw *hw,u8 block,u64 *tstamp_ready) +{ +int err; + +switch (hw->phy_model) { +case ICE_PHY_ETH56G : + err =ice_get_phy_tx_tstamp_ready_eth56g (hw, block, + tstamp_ready); +break ; +case ICE_PHY_E810 : + err =ice_get_phy_tx_tstamp_ready_e810 (hw, block, + tstamp_ready); +break ; +case ICE_PHY_E822 : + err =ice_get_phy_tx_tstamp_ready_e822 (hw, block, + tstamp_ready); +break ; +default : + err =ICE_ERR_NOT_SUPPORTED ; + } + +return err; +} +/** * refsync_pin_id_valid * @hw: pointer to the HW struct
drivers/net/ice/base/ice_ptp_hw.h +6 -0
@@ -146,8 +146,14 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw);int ice_ptp_init_phc (struct ice_hw *hw);bool refsync_pin_id_valid (struct ice_hw *hw,u8 id);int +ice_get_phy_tx_tstamp_ready (struct ice_hw *hw,u8 block,u64 *tstamp_ready); +int ice_ptp_one_port_cmd (struct ice_hw *hw,u8 configured_port,enum ice_ptp_tmr_cmd configured_cmd,bool lock_sbq); +int +ice_ptp_read_port_capture (struct ice_hw *hw,u8 port,u64 *tx_ts,u64 *rx_ts); +int +ice_ptp_read_phy_incval (struct ice_hw *hw,u8 port,u64 *incval);/* E822 family functions */ int
Signature · 1 line
2.43.0
PATCH v2 109/148 net/ice/base: implement upper-level PHY control functions
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Implement upper-level PHY control functions as well as required device specific defines. These include functions returning basic 56G PHY timing parameters and definitions for constant parameters.
--- drivers/net/ice/base/ice_ptp_hw.c | 108 ++++++++++++++++++------------ drivers/net/ice/base/ice_ptp_hw.h | 96 +++++++++++++++++++++++++- drivers/net/ice/base/ice_type.h | 4 +- 3 files changed, 162 insertions(+), 46 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +64 -44
@@ -6139,25 +6139,18 @@ int ice_ptp_clear_phy_offset_ready(struct ice_hw *hw)int ice_read_phy_tstamp (struct ice_hw *hw,u8 block,u8 idx,u64 *tstamp) { -int err; -switch (hw->phy_model) {case ICE_PHY_ETH56G : - err =ice_read_phy_tstamp_eth56g (hw, block, idx, tstamp); -break ; +return ice_read_phy_tstamp_eth56g (hw, block, idx, tstamp);case ICE_PHY_E830 :return ice_read_phy_tstamp_e830 (hw, block, idx, tstamp);case ICE_PHY_E810 : - err =ice_read_phy_tstamp_e810 (hw, block, idx, tstamp); -break ; +return ice_read_phy_tstamp_e810 (hw, block, idx, tstamp);case ICE_PHY_E822 : - err =ice_read_phy_tstamp_e822 (hw, block, idx, tstamp); -break ; +return ice_read_phy_tstamp_e822 (hw, block, idx, tstamp);default : - err =ICE_ERR_NOT_SUPPORTED ; +return ICE_ERR_NOT_SUPPORTED ; } - -return err; }/**
@@ -6173,23 +6166,16 @@ ice_read_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx, u64 *tstamp)int ice_clear_phy_tstamp (struct ice_hw *hw,u8 block,u8 idx) { -int err; -switch (hw->phy_model) {case ICE_PHY_ETH56G : - err =ice_clear_phy_tstamp_eth56g (hw, block, idx); -break ; +return ice_clear_phy_tstamp_eth56g (hw, block, idx);case ICE_PHY_E810 : - err =ice_clear_phy_tstamp_e810 (hw, block, idx); -break ; +return ice_clear_phy_tstamp_e810 (hw, block, idx);case ICE_PHY_E822 : - err =ice_clear_phy_tstamp_e822 (hw, block, idx); -break ; +return ice_clear_phy_tstamp_e822 (hw, block, idx);default : - err =ICE_ERR_NOT_SUPPORTED ; +return ICE_ERR_NOT_SUPPORTED ; } - -return err; }/**
@@ -6219,7 +6205,6 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw)*/ int ice_ptp_init_phc (struct ice_hw *hw) { -int err;u8 src_idx = hw->func_caps.ts_func_info.tmr_index_owned;/* Enable source clocks */
@@ -6230,19 +6215,14 @@ int ice_ptp_init_phc(struct ice_hw *hw)switch (hw->phy_model) {case ICE_PHY_ETH56G : - err =ice_ptp_init_phc_eth56g (hw); -break ; +return ice_ptp_init_phc_eth56g (hw);case ICE_PHY_E810 : - err =ice_ptp_init_phc_e810 (hw); -break ; +return ice_ptp_init_phc_e810 (hw);case ICE_PHY_E822 : - err =ice_ptp_init_phc_e822 (hw); -break ; +return ice_ptp_init_phc_e822 (hw);default : - err =ICE_ERR_NOT_SUPPORTED ; +return ICE_ERR_NOT_SUPPORTED ; } - -return err; }/**
@@ -6258,26 +6238,66 @@ int ice_ptp_init_phc(struct ice_hw *hw)*/ int ice_get_phy_tx_tstamp_ready (struct ice_hw *hw,u8 block,u64 *tstamp_ready) { -int err; -switch (hw->phy_model) {case ICE_PHY_ETH56G : - err =ice_get_phy_tx_tstamp_ready_eth56g (hw, block, - tstamp_ready); -break ; +return ice_get_phy_tx_tstamp_ready_eth56g (hw, block, + tstamp_ready);case ICE_PHY_E810 : - err =ice_get_phy_tx_tstamp_ready_e810 (hw, block, - tstamp_ready); -break ; +return ice_get_phy_tx_tstamp_ready_e810 (hw, block, + tstamp_ready);case ICE_PHY_E822 : - err =ice_get_phy_tx_tstamp_ready_e822 (hw, block, - tstamp_ready); +return ice_get_phy_tx_tstamp_ready_e822 (hw, block, + tstamp_ready);break ;default : - err =ICE_ERR_NOT_SUPPORTED ; +return ICE_ERR_NOT_SUPPORTED ; + } +} + +/** +* ice_ptp_read_port_capture - Read a port's local time capture +* @hw: pointer to HW struct +* @port: Port number to read +* @tx_ts: on return, the Tx port time capture +* @rx_ts: on return, the Rx port time capture +* +* Read the port's Tx and Rx local time capture values. +*/ +int +ice_ptp_read_port_capture (struct ice_hw *hw,u8 port,u64 *tx_ts, +u64 *rx_ts) +{ +switch (hw->phy_model) { +case ICE_PHY_ETH56G : +return ice_ptp_read_port_capture_eth56g (hw, port, + tx_ts, rx_ts); +case ICE_PHY_E822 : +return ice_ptp_read_port_capture_e822 (hw, port, + tx_ts, rx_ts); +default : +return ICE_ERR_NOT_SUPPORTED ; } +} -return err; +/** +* ice_ptp_read_phy_incval - Read a PHY port's current incval +* @hw: pointer to the HW struct +* @port: the port to read +* @incval: on return, the time_clk_cyc incval for this port +* +* Read the time_clk_cyc increment value for a given PHY port. +*/ +int +ice_ptp_read_phy_incval (struct ice_hw *hw,u8 port,u64 *incval) +{ +switch (hw->phy_model) { +case ICE_PHY_ETH56G : +return ice_ptp_read_phy_incval_eth56g (hw, port, incval); +case ICE_PHY_E822 : +return ice_ptp_read_phy_incval_e822 (hw, port, incval); +default : +return ICE_ERR_NOT_SUPPORTED ; + } }/**
drivers/net/ice/base/ice_ptp_hw.h +95 -1
122 lines not on this page · raw message
drivers/net/ice/base/ice_type.h +3 -1
@@ -750,7 +750,9 @@ enum ice_time_ref_freq {ICE_TIME_REF_FREQ_156_250 =4 ,ICE_TIME_REF_FREQ_245_760 =5 , - NUM_ICE_TIME_REF_FREQ +NUM_ICE_TIME_REF_FREQ , + + ICE_TIME_REF_FREQ_INVALID = -1, };/* Clock source specification */
Signature · 1 line
2.43.0
PATCH v2 110/148 net/ice/base: squash multiple fixes for e56g device
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
This commit has multiple fixes related to comments updates, possible unitialized variable use and finally a bug fix related to stale PHY commands. Details of the bug fix are included below as it represents the bulk of the changes.
Code using ice_ptp_one_port_cmd() (or the device specific variants for E822 and ETH56G) has a subtle bug where-in the executing of ice_ptp_exec_tmr_cmd() will cause all other ports to execute their last executed command.Code using ice_ptp_one_port_cmd() (or the device specific variants for E822 and ETH56G) has a subtle bug where-in the executing of ice_ptp_exec_tmr_cmd() will cause all other ports to execute their last executed command.
Most flows operate on all timers at once, but some flows such as handling link state change only operate on one port at a time. This can lead to issues if the userspace performs clock operations at just the right time.
In addition to this bug, recent support for new hardware families has complicated the structure and organization of the various functions involved in programming PHY ports.
Refactor ice_ptp_one_port_cmd() to both fix the issue of stale PHY port commands, and reduce the organizational complexity.
Rename the existing device implementations from ice_ptp_one_port_cmd_<device> to ice_ptp_write_port_cmd_<device>. This function just performs the task of writing one command to one port. Do not export this outside of ice_ptp_hw.c, instead ensure all callers use the refactored ice_ptp_one_port_cmd() which properly initializes all ports.
Fix ice_ptp_one_port_cmd() to correctly loop over all ports. For the configured port, call ice_ptp_write_port_cmd() with the configured command. For all other ports, call ice_ptp_write_port_cmd() with ICE_PTP_NOP.
Stop duplicating the port iteration logic in each of the ice_ptp_port_cmd_<dev>() implementations, instead moving this into the generic ice_ptp_port_cmd() implementation.
--- drivers/net/ice/base/ice_ptp_hw.c | 138 +++++++----------------------- drivers/net/ice/base/ice_ptp_hw.h | 6 -- drivers/net/ice/base/ice_switch.c | 3 + 3 files changed, 33 insertions(+), 114 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +30 -108
@@ -982,13 +982,15 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u8 phy_index, u32 reg_addr, err =ice_sbq_rw_reg_lp (hw, &phy_msg, lock_sbq); -if (err) +if (err) {ice_debug (hw,ICE_DBG_PTP ,"PTP failed to send msg to phy %d\n" , err); -else - *val = phy_msg.data; +return err; + } -return err; + *val = phy_msg.data; + +return ICE_SUCCESS ; }/**
@@ -1479,8 +1481,16 @@ ice_read_phy_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx, u64 *tstamp)* @port: the quad to read from * @idx: the timestamp index to reset * -* Clear a timestamp, resetting its valid bit, in the PHY port memory of +* Read and then forcibly clear the timestamp index to ensure the valid bit is +* cleared and the timestamp status bit is reset in the PHY port memory of * internal PHYs of the 56G devices. +* +* To directly clear the contents of the timestamp block entirely, discarding +* all timestamp data at once, software should instead use +* ice_ptp_reset_ts_memory_quad_eth56g(). +* +* This function should only be called on an idx whose bit is set according to +* ice_get_phy_tx_tstamp_ready(). */ static int ice_clear_phy_tstamp_eth56g (struct ice_hw *hw,u8 port,u8 idx)
@@ -1509,9 +1519,6 @@ static void ice_ptp_reset_ts_memory_eth56g(struct ice_hw *hw)unsigned int port;for (port =0 ; port < hw->max_phy_port; port++) { -if (!(hw->ena_lports &BIT (port))) -continue ; -ice_write_phy_reg_eth56g (hw, port,PHY_REG_TX_MEMORY_STATUS_L ,0 ); ice_write_phy_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_U,
@@ -1568,8 +1575,7 @@ ice_ptp_prep_phy_time_eth56g(struct ice_hw *hw, u32 time)for (port =0 ; port < hw->max_phy_port; port++) {int err; -if (!(hw->ena_lports &BIT (port))) -continue ; + err =ice_ptp_prep_port_phy_time_eth56g (hw, port, phy_time);if (err) {
@@ -1664,8 +1670,6 @@ ice_ptp_prep_phy_adj_eth56g(struct ice_hw *hw, s32 adj, bool lock_sbq) cycles = (s64 )adj <<32 ;for (port =0 ; port < hw->max_phy_port; port++) { -if (!(hw->ena_lports &BIT (port))) -continue ; err =ice_ptp_prep_port_adj_eth56g (hw, port, cycles, lock_sbq);if (err)
@@ -1691,8 +1695,6 @@ ice_ptp_prep_phy_incval_eth56g(struct ice_hw *hw, u64 incval)for (port =0 ; port < hw->max_phy_port; port++) {int err; -if (!(hw->ena_lports &BIT (port))) -continue ; err =ice_write_40b_phy_reg_eth56g (hw, port,PHY_REG_TIMETUS_L , incval);if (err) {
@@ -1752,9 +1754,6 @@ ice_ptp_prep_phy_adj_target_eth56g(struct ice_hw *hw, u32 target_time)u8 port;for (port =0 ; port < hw->max_phy_port; port++) { -if (!(hw->ena_lports &BIT (port))) -continue ; -/* Tx case */ /* No sub-nanoseconds data */ err = ice_write_phy_reg_eth56g_lp(hw, port,
@@ -1836,7 +1835,7 @@ ice_ptp_read_port_capture_eth56g(struct ice_hw *hw, u8 port, u64 *tx_ts, }/** -* ice_ptp_one_port_cmd_eth56g - Prepare a single PHY port for a timer command +* ice_ptp_write_port_cmd_eth56g - Prepare a single PHY port for a timer command * @hw: pointer to HW struct * @port: Port to which cmd has to be sent * @cmd: Command to be sent to the port
@@ -1844,53 +1843,16 @@ ice_ptp_read_port_capture_eth56g(struct ice_hw *hw, u8 port, u64 *tx_ts,* * Prepare the requested port for an upcoming timer sync command. */ -int -ice_ptp_one_port_cmd_eth56g (struct ice_hw *hw,u8 port, -enum ice_ptp_tmr_cmd cmd,bool lock_sbq) +static int +ice_ptp_write_port_cmd_eth56g (struct ice_hw *hw,u8 port, +enum ice_ptp_tmr_cmd cmd,bool lock_sbq) { +u32 val =ice_ptp_tmr_cmd_to_port_reg (hw, cmd);int err; -u32 cmd_val, val; -u8 tmr_idx; - - tmr_idx =ice_get_ptp_src_clock_index (hw); - cmd_val = tmr_idx <<SEL_PHY_SRC ; -switch (cmd) { -case ICE_PTP_INIT_TIME : - cmd_val |=PHY_CMD_INIT_TIME ; -break ; -case ICE_PTP_INIT_INCVAL : - cmd_val |=PHY_CMD_INIT_INCVAL ; -break ; -case ICE_PTP_ADJ_TIME : - cmd_val |=PHY_CMD_ADJ_TIME ; -break ; -case ICE_PTP_ADJ_TIME_AT_TIME : - cmd_val |=PHY_CMD_ADJ_TIME_AT_TIME ; -break ; -case ICE_PTP_READ_TIME : - cmd_val |=PHY_CMD_READ_TIME ; -break ; -default : -ice_warn (hw,"Unknown timer command %u\n" , cmd); -return ICE_ERR_PARAM ; - }/* Tx case */ -/* Read, modify, write */ - err =ice_read_phy_reg_eth56g_lp (hw, port,PHY_REG_TX_TMR_CMD , &val, - lock_sbq); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to read TX_TMR_CMD, err %d\n" , - err); -return err; - } - -/* Modify necessary bits only and perform write */ - val &= ~TS_CMD_MASK ; - val |= cmd_val; - err =ice_write_phy_reg_eth56g_lp (hw, port,PHY_REG_TX_TMR_CMD , val, - lock_sbq); + lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to write back TX_TMR_CMD, err %d\n" , err);
@@ -1898,21 +1860,8 @@ ice_ptp_one_port_cmd_eth56g(struct ice_hw *hw, u8 port, }/* Rx case */ -/* Read, modify, write */ - err =ice_read_phy_reg_eth56g_lp (hw, port,PHY_REG_RX_TMR_CMD , &val, - lock_sbq); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to read RX_TMR_CMD, err %d\n" , - err); -return err; - } - -/* Modify necessary bits only and perform write */ - val &= ~TS_CMD_MASK ; - val |= cmd_val; - err =ice_write_phy_reg_eth56g_lp (hw, port,PHY_REG_RX_TMR_CMD , val, - lock_sbq); + lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to write back RX_TMR_CMD, err %d\n" , err);
@@ -1922,34 +1871,6 @@ ice_ptp_one_port_cmd_eth56g(struct ice_hw *hw, u8 port,return 0 ; } -/** -* ice_ptp_port_cmd_eth56g - Prepare all ports for a timer command -* @hw: pointer to the HW struct -* @cmd: timer command to prepare -* @lock_sbq: true if the sideband queue lock must be acquired -* -* Prepare all ports connected to this device for an upcoming timer sync -* command. -*/ -int -ice_ptp_port_cmd_eth56g (struct ice_hw *hw,enum ice_ptp_tmr_cmd cmd, -bool lock_sbq) -{ -int err; -u8 port; - -for (port =0 ; port < hw->max_phy_port; port++) { -if (!(hw->ena_lports &BIT (port))) -continue ; - - err =ice_ptp_one_port_cmd_eth56g (hw, port, cmd, lock_sbq); -if (err) -return err; - } - -return 0 ; -} -/** * ice_calc_fixed_tx_offset_eth56g - Calculated Fixed Tx offset for a port * @hw: pointer to the HW struct
@@ -2108,7 +2029,7 @@ ice_read_phy_and_phc_time_eth56g(struct ice_hw *hw, u8 port, u64 *phy_time,ice_ptp_src_cmd (hw,ICE_PTP_READ_TIME );/* Prepare the PHY timer for a ICE_PTP_READ_TIME capture command */ - err =ice_ptp_one_port_cmd_eth56g (hw, port,ICE_PTP_READ_TIME , true); + err =ice_ptp_one_port_cmd (hw, port,ICE_PTP_READ_TIME , true);if (err)return err;
@@ -2182,7 +2103,7 @@ static int ice_sync_phy_timer_eth56g(struct ice_hw *hw, u8 port)if (err) goto err_unlock; - err =ice_ptp_one_port_cmd_eth56g (hw, port,ICE_PTP_ADJ_TIME , true); + err =ice_ptp_one_port_cmd (hw, port,ICE_PTP_ADJ_TIME , true);if (err) goto err_unlock;
@@ -2271,8 +2192,7 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass)if (err)return err; - err =ice_ptp_one_port_cmd_eth56g (hw, port,ICE_PTP_INIT_INCVAL , - true); + err =ice_ptp_one_port_cmd (hw, port,ICE_PTP_INIT_INCVAL , true);if (err)return err;
@@ -2925,7 +2845,7 @@ ice_read_quad_reg_e822_lp(struct ice_hw *hw, u8 quad, u16 offset, u32 *val, *val = msg.data; -return 0 ; +return ICE_SUCCESS ; }int
@@ -2966,7 +2886,7 @@ ice_write_quad_reg_e822_lp(struct ice_hw *hw, u8 quad, u16 offset, u32 val,return err; } -return 0 ; +return ICE_SUCCESS ; }int
@@ -5738,6 +5658,8 @@ int ice_ptp_write_port_cmd(struct ice_hw *hw, u8 port, enum ice_ptp_tmr_cmd cmd, bool lock_sbq) {switch (hw->phy_model) { +case ICE_PHY_ETH56G : +return ice_ptp_write_port_cmd_eth56g (hw, port, cmd, lock_sbq);case ICE_PHY_E822 :return ice_ptp_write_port_cmd_e822 (hw, port, cmd, lock_sbq);default :
drivers/net/ice/base/ice_ptp_hw.h +0 -6
@@ -217,9 +217,6 @@ ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd, bool lock_sbq);int ice_get_phy_tx_tstamp_ready_e830 (struct ice_hw *hw,u8 port,u64 *tstamp_ready); -int -ice_ptp_port_cmd_eth56g (struct ice_hw *hw,enum ice_ptp_tmr_cmd cmd, -bool lock_sbq);/** * ice_e822_time_ref - Get the current TIME_REF from capabilities
@@ -311,9 +308,6 @@ int ice_ptp_read_port_capture_eth56g(struct ice_hw *hw, u8 port, u64 *tx_ts, u64 *rx_ts);int -ice_ptp_one_port_cmd_eth56g (struct ice_hw *hw,u8 port, -enum ice_ptp_tmr_cmd cmd,bool lock_sbq); -int ice_ptp_read_tx_hwtstamp_status_eth56g (struct ice_hw *hw,u32 *ts_status);int ice_stop_phy_timer_eth56g (struct ice_hw *hw,u8 port,bool soft_reset);
drivers/net/ice/base/ice_switch.c +3 -0
@@ -6475,6 +6475,9 @@ int ice_get_vsi_vlan_promisc(struct ice_hw *hw, u16 vsi_handle, ice_bitmap_t *promisc_mask, u16 *vid) { + if (!hw || !promisc_mask || !vid) + return ICE_ERR_PARAM; +return _ice_get_vsi_promisc (hw, vsi_handle, promisc_mask, vid, hw->switch_info,ICE_SW_LKUP_PROMISC_VLAN );
Signature · 1 line
2.43.0
PATCH v2 111/148 net/ice/base: add PHY statistics dump
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Added support to dump PHY registers for assisting field debugging of link issue, these registers include FEC correctable uncorrectable statistics dump.
--- drivers/net/ice/base/ice_common.c | 12 +++++++----- drivers/net/ice/base/ice_common.h | 6 +++--- drivers/net/ice/base/ice_ptp_hw.c | 20 ++++++++++---------- 3 files changed, 20 insertions(+), 18 deletions(-)
drivers/net/ice/base/ice_common.c +7 -5
@@ -1672,11 +1672,12 @@ ice_sbq_send_cmd_nolock(struct ice_hw *hw, struct ice_sbq_cmd_desc *desc,* ice_sbq_rw_reg_lp - Fill Sideband Queue command, with lock parameter * @hw: pointer to the HW struct * @in: message info to be filled in descriptor +* @flag: flag to fill desc structure * @lock: true to lock the sq_lock (the usual case); false if the sq_lock has * already been locked at a higher level */ -int ice_sbq_rw_reg_lp (struct ice_hw *hw, -struct ice_sbq_msg_input *in,bool lock) +int ice_sbq_rw_reg_lp (struct ice_hw *hw,struct ice_sbq_msg_input *in, +u16 flag,bool lock) {struct ice_sbq_cmd_desc desc = {0 };struct ice_sbq_msg_req msg = {0 };
@@ -1700,7 +1701,7 @@ int ice_sbq_rw_reg_lp(struct ice_hw *hw,*/ msg_len -=sizeof (msg.data); - desc.flags =CPU_TO_LE16 (ICE_AQ_FLAG_RD ); + desc.flags =CPU_TO_LE16 (flag); desc.opcode =CPU_TO_LE16 (ice_sbq_opc_neigh_dev_req); desc.param0.cmd_len =CPU_TO_LE16 (msg_len);if (lock)
@@ -1718,10 +1719,11 @@ int ice_sbq_rw_reg_lp(struct ice_hw *hw,* ice_sbq_rw_reg - Fill Sideband Queue command * @hw: pointer to the HW struct * @in: message info to be filled in descriptor +* @flag: flag to fill desc structure */ -int ice_sbq_rw_reg (struct ice_hw *hw,struct ice_sbq_msg_input *in) +int ice_sbq_rw_reg (struct ice_hw *hw,struct ice_sbq_msg_input *in,u16 flag) { -return ice_sbq_rw_reg_lp (hw, in, true); +return ice_sbq_rw_reg_lp (hw, in, flag, true); }/**
drivers/net/ice/base/ice_common.h +3 -3
@@ -247,11 +247,11 @@ int ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);void ice_replay_post (struct ice_hw *hw);struct ice_q_ctx *ice_get_lan_q_ctx (struct ice_hw *hw,u16 vsi_handle,u8 tc,u16 q_handle); -int ice_sbq_rw_reg_lp (struct ice_hw *hw, -struct ice_sbq_msg_input *in,bool lock); +int ice_sbq_rw_reg_lp (struct ice_hw *hw,struct ice_sbq_msg_input *in, +u16 flag,bool lock);void ice_sbq_lock (struct ice_hw *hw);void ice_sbq_unlock (struct ice_hw *hw); -int ice_sbq_rw_reg (struct ice_hw *hw,struct ice_sbq_msg_input *in); +int ice_sbq_rw_reg (struct ice_hw *hw,struct ice_sbq_msg_input *in,u16 flag); int ice_aq_get_sensor_reading(struct ice_hw *hw, u8 sensor, u8 format, struct ice_aqc_get_sensor_reading_resp *data,
drivers/net/ice/base/ice_ptp_hw.c +10 -10
@@ -122,7 +122,7 @@ ice_read_cgu_reg_e82x(struct ice_hw *hw, u16 addr, u32 *val) cgu_msg.msg_addr_low = addr; cgu_msg.msg_addr_high =0x0 ; - err =ice_sbq_rw_reg_lp (hw, &cgu_msg, true); + err =ice_sbq_rw_reg_lp (hw, &cgu_msg,ICE_AQ_FLAG_RD , true);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to read CGU register 0x%04x, err %d\n" , addr, err);
@@ -155,7 +155,7 @@ ice_write_cgu_reg_e82x(struct ice_hw *hw, u16 addr, u32 val) cgu_msg.msg_addr_high =0x0 ; cgu_msg.data = val; - err =ice_sbq_rw_reg_lp (hw, &cgu_msg, true); + err =ice_sbq_rw_reg_lp (hw, &cgu_msg,ICE_AQ_FLAG_RD , true);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to write CGU register 0x%04x, err %d\n" , addr, err);
@@ -948,7 +948,7 @@ ice_write_phy_eth56g_raw_lp(struct ice_hw *hw, u8 phy_index, u32 reg_addr, phy_msg.data = val; phy_msg.dest_dev = hw->phy_addr[phy_index]; - err =ice_sbq_rw_reg_lp (hw, &phy_msg, lock_sbq); + err =ice_sbq_rw_reg_lp (hw, &phy_msg,ICE_AQ_FLAG_RD , lock_sbq);if (err) ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n",
@@ -980,7 +980,7 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u8 phy_index, u32 reg_addr, phy_msg.data =0 ; phy_msg.dest_dev = hw->phy_addr[phy_index]; - err =ice_sbq_rw_reg_lp (hw, &phy_msg, lock_sbq); + err =ice_sbq_rw_reg_lp (hw, &phy_msg,ICE_AQ_FLAG_RD , lock_sbq);if (err) { ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n",
@@ -2539,7 +2539,7 @@ ice_read_phy_reg_e822_lp(struct ice_hw *hw, u8 port, u16 offset, u32 *val,ice_fill_phy_msg_e822 (&msg, port, offset); msg.opcode = ice_sbq_msg_rd; - err =ice_sbq_rw_reg_lp (hw, &msg, lock_sbq); + err =ice_sbq_rw_reg_lp (hw, &msg,ICE_AQ_FLAG_RD , lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to send message to PHY, err %d\n" , err);
@@ -2672,7 +2672,7 @@ ice_write_phy_reg_e822_lp(struct ice_hw *hw, u8 port, u16 offset, u32 val, msg.opcode = ice_sbq_msg_wr; msg.data = val; - err =ice_sbq_rw_reg_lp (hw, &msg, lock_sbq); + err =ice_sbq_rw_reg_lp (hw, &msg,ICE_AQ_FLAG_RD , lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to send message to PHY, err %d\n" , err);
@@ -2836,7 +2836,7 @@ ice_read_quad_reg_e822_lp(struct ice_hw *hw, u8 quad, u16 offset, u32 *val, msg.opcode = ice_sbq_msg_rd; - err =ice_sbq_rw_reg_lp (hw, &msg, lock_sbq); + err =ice_sbq_rw_reg_lp (hw, &msg,ICE_AQ_FLAG_RD , lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to send message to PHY, err %d\n" , err);
@@ -2879,7 +2879,7 @@ ice_write_quad_reg_e822_lp(struct ice_hw *hw, u8 quad, u16 offset, u32 val, msg.opcode = ice_sbq_msg_wr; msg.data = val; - err =ice_sbq_rw_reg_lp (hw, &msg, lock_sbq); + err =ice_sbq_rw_reg_lp (hw, &msg,ICE_AQ_FLAG_RD , lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to send message to PHY, err %d\n" , err);
@@ -4722,7 +4722,7 @@ ice_read_phy_reg_e810_lp(struct ice_hw *hw, u32 addr, u32 *val, bool lock_sbq) msg.opcode = ice_sbq_msg_rd; msg.dest_dev = rmn_0; - err =ice_sbq_rw_reg_lp (hw, &msg, lock_sbq); + err =ice_sbq_rw_reg_lp (hw, &msg,ICE_AQ_FLAG_RD , lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to send message to PHY, err %d\n" , err);
@@ -4760,7 +4760,7 @@ ice_write_phy_reg_e810_lp(struct ice_hw *hw, u32 addr, u32 val, bool lock_sbq) msg.dest_dev = rmn_0; msg.data = val; - err =ice_sbq_rw_reg_lp (hw, &msg, lock_sbq); + err =ice_sbq_rw_reg_lp (hw, &msg,ICE_AQ_FLAG_RD , lock_sbq);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to send message to PHY, err %d\n" , err);
Signature · 1 line
2.43.0
PATCH v2 112/148 net/ice/base: move ice_ptp_init_phy_model to align with upstream
In reply to Anatoly BurakovUpstream code has this function in a different place, so move it to match the upstream code.
--- drivers/net/ice/base/ice_ptp_hw.c | 127 +++++++++++++++--------------- drivers/net/ice/base/ice_type.h | 6 ++ 2 files changed, 69 insertions(+), 64 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +63 -64
@@ -2321,70 +2321,6 @@ ice_get_phy_tx_tstamp_ready_eth56g(struct ice_hw *hw, u8 port,return 0 ; } -#define ICE_DEVID_MASK 0xFFF8 - -/** -* ice_ptp_init_phy_model - Initialize hw->phy_model based on device type -* @hw: pointer to the HW structure -* -* Determine the PHY model for the device, and initialize hw->phy_model -* for use by other functions. -*/ -void ice_ptp_init_phy_model (struct ice_hw *hw) -{ -unsigned int phy; - -for (phy =0 ; phy <MAX_PHYS_PER_ICE ; phy++) - hw->phy_addr[phy] =0 ; - -switch (hw->device_id &ICE_DEVID_MASK ) { -case ICE_DEV_ID_E825C_BACKPLANE &ICE_DEVID_MASK : - hw->phy_addr[0 ] = eth56g_dev_0; - hw->phy_addr[1 ] = eth56g_dev_1; - hw->num_phys =ICE_PHYS_PER_CPLX_C825X ; - hw->phy_ports =ICE_PORTS_PER_PHY_C825X ; - hw->max_phy_port =ice_is_nac_dual (hw) ? -ICE_PORTS_PER_PHY_C825X : -ICE_PHYS_PER_CPLX_C825X *ICE_PORTS_PER_PHY_C825X ; -break ; -default : - goto e8xx; - } - -ice_sb_access_ena_eth56g (hw, true); -for (phy =0 ; phy < hw->num_phys; phy++) -if (hw->phy_addr[phy]) { -int err; -u32 phy_rev; - - err =ice_read_phy_eth56g_raw_lp (hw, phy, -PHY_REG_REVISION , - &phy_rev, true); -if (err) { - hw->phy_model =ICE_PHY_UNSUP ; -return ; - } - -if (phy_rev !=PHY_REVISION_ETH56G ) { - hw->phy_model =ICE_PHY_UNSUP ; -return ; - } - } - - hw->phy_model =ICE_PHY_ETH56G ; - -return ; -e8xx: - -if (ice_is_e810 (hw)) - hw->phy_model =ICE_PHY_E810 ; -else - hw->phy_model =ICE_PHY_E822 ; - - hw->phy_ports =ICE_NUM_EXTERNAL_PORTS ; - hw->max_phy_port =ICE_NUM_EXTERNAL_PORTS ; -} -/* E822 family functions * * The following functions operate on the E822 family of devices.
@@ -5643,6 +5579,69 @@ void ice_ptp_unlock(struct ice_hw *hw)wr32 (hw,PFTSYN_SEM + (PFTSYN_SEM_BYTES * hw->pf_id),0 ); } +#define ICE_DEVID_MASK 0xFFF8 + +/** +* ice_ptp_init_phy_model - Initialize hw->phy_model based on device type +* @hw: pointer to the HW structure +* +* Determine the PHY model for the device, and initialize hw->phy_model +* for use by other functions. +*/ +void ice_ptp_init_phy_model (struct ice_hw *hw) +{ +unsigned int phy; + +for (phy =0 ; phy <MAX_PHYS_PER_ICE ; phy++) + hw->phy_addr[phy] =0 ; + +switch (hw->device_id &ICE_DEVID_MASK ) { +case ICE_DEV_ID_E825C_BACKPLANE &ICE_DEVID_MASK : + hw->phy_addr[0 ] = eth56g_dev_0; + hw->phy_addr[1 ] = eth56g_dev_1; + hw->num_phys =ICE_PHYS_PER_CPLX_C825X ; + hw->phy_ports =ICE_PORTS_PER_PHY_C825X ; + hw->max_phy_port =ice_is_nac_dual (hw) ? +ICE_PORTS_PER_PHY_C825X : +ICE_PHYS_PER_CPLX_C825X *ICE_PORTS_PER_PHY_C825X ; +break ; +default : + goto e8xx; + } + +ice_sb_access_ena_eth56g (hw, true); +for (phy =0 ; phy < hw->num_phys; phy++) +if (hw->phy_addr[phy]) { +int err; +u32 phy_rev; + + err =ice_read_phy_eth56g_raw_lp (hw, phy, +PHY_REG_REVISION , + &phy_rev, true); +if (err) { + hw->phy_model =ICE_PHY_UNSUP ; +return ; + } + +if (phy_rev !=PHY_REVISION_ETH56G ) { + hw->phy_model =ICE_PHY_UNSUP ; +return ; + } + } + + hw->phy_model =ICE_PHY_ETH56G ; + +return ; +e8xx: + +if (ice_is_e810 (hw)) + hw->phy_model =ICE_PHY_E810 ; +else + hw->phy_model =ICE_PHY_E822 ; + hw->phy_ports =ICE_NUM_EXTERNAL_PORTS ; + hw->max_phy_port =ICE_NUM_EXTERNAL_PORTS ; +} +/** * ice_ptp_write_port_cmd - Prepare a single PHY port for a timer command * @hw: pointer to HW struct
drivers/net/ice/base/ice_type.h +6 -0
@@ -1696,4 +1696,10 @@ struct ice_aq_get_set_rss_lut_params {/* AQ API version for FW auto drop reports */ #define ICE_FW_API_AUTO_DROP_MAJ 1#define ICE_FW_API_AUTO_DROP_MIN 4 + +static inline bool +ice_is_nac_dual (struct ice_hw *hw) +{ +return !!(hw->dev_caps.nac_topo.mode &ICE_NAC_TOPO_DUAL_M ); +}#endif /* _ICE_TYPE_H_ */
Signature · 1 line
2.43.0
PATCH v2 113/148 net/ice/base: add Get Link Status Data version 2
In reply to Anatoly BurakovE830 introduces a new version of Get Link Status Data which increases the size of struct ice_aqc_get_link_status_data from 32 bytes to 51 bytes.
Add new link partner fields to ice_aqc_get_link_status_data; PHY type, FEC, and flow control. Add new ICE_GET_LINK_STATUS_DATA_V2 and ICE_GET_LINK_STATUS_DATALEN_V2 to support the new version and data length.
Also, moving ice_get_link_status_datalen and ice_get_link_status_datalen to ice_common.c
--- drivers/net/ice/base/ice_adminq_cmd.h | 35 ++++++++++++++++++++++++++- drivers/net/ice/base/ice_common.c | 20 +++++++++++++-- 2 files changed, 52 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +34 -1
@@ -1539,7 +1539,16 @@ struct ice_aqc_get_link_status {__le32 addr_low; }; +enum ice_get_link_status_data_version { +ICE_GET_LINK_STATUS_DATA_V1 =1 , +ICE_GET_LINK_STATUS_DATA_V2 =2 , +}; + +#define ICE_GET_LINK_STATUS_DATALEN_V1 32 +#define ICE_GET_LINK_STATUS_DATALEN_V2 56 +/* Get link status response data structure, also used for Link Status Event */ +#pragma pack(1)struct ice_aqc_get_link_status_data {u8 topo_media_conflict;#define ICE_AQ_LINK_TOPO_CONFLICT BIT(0)
@@ -1626,11 +1635,35 @@ struct ice_aqc_get_link_status_data {#define ICE_AQ_LINK_SPEED_100GB BIT(10)#define ICE_AQ_LINK_SPEED_200GB BIT(11)#define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15) -__le32 reserved3;/* Aligns next field to 8-byte boundary */ +__le16 reserved3;/* Aligns next field to 8-byte boundary */ +u8 ext_fec_status; +#define ICE_AQ_LINK_RS_272_FEC_EN BIT(0)/* RS 272 FEC enabled */ +u8 reserved4;__le64 phy_type_low;/* Use values from ICE_PHY_TYPE_LOW_* */ __le64 phy_type_high;/* Use values from ICE_PHY_TYPE_HIGH_* */ +/* Get link status version 2 link partner data */ +__le64 lp_phy_type_low;/* Use values from ICE_PHY_TYPE_LOW_* */ +__le64 lp_phy_type_high;/* Use values from ICE_PHY_TYPE_HIGH_* */ +u8 lp_fec_adv; +#define ICE_AQ_LINK_LP_10G_KR_FEC_CAP BIT(0) +#define ICE_AQ_LINK_LP_25G_KR_FEC_CAP BIT(1) +#define ICE_AQ_LINK_LP_RS_528_FEC_CAP BIT(2) +#define ICE_AQ_LINK_LP_50G_KR_272_FEC_CAP BIT(3) +#define ICE_AQ_LINK_LP_100G_KR_272_FEC_CAP BIT(4) +#define ICE_AQ_LINK_LP_200G_KR_272_FEC_CAP BIT(5) +u8 lp_fec_req; +#define ICE_AQ_LINK_LP_10G_KR_FEC_REQ BIT(0) +#define ICE_AQ_LINK_LP_25G_KR_FEC_REQ BIT(1) +#define ICE_AQ_LINK_LP_RS_528_FEC_REQ BIT(2) +#define ICE_AQ_LINK_LP_KR_272_FEC_REQ BIT(3) +u8 lp_flowcontrol; +#define ICE_AQ_LINK_LP_PAUSE_ADV BIT(0) +#define ICE_AQ_LINK_LP_ASM_DIR_ADV BIT(1) +u8 reserved[5 ]; }; +#pragma pack() +/* Set event mask command (direct 0x0613) */ struct ice_aqc_set_event_mask {u8 lport_num;
drivers/net/ice/base/ice_common.c +18 -2
@@ -566,6 +566,22 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,return status; } +#define ice_get_link_status_data_ver (hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + ICE_GET_LINK_STATUS_DATA_V2 : ICE_GET_LINK_STATUS_DATA_V1) + +/** +* ice_get_link_status_datalen +* @hw: pointer to the HW struct +* +* return Get Link Status datalen +*/ +static u16 ice_get_link_status_datalen (struct ice_hw *hw) +{ +return (ice_get_link_status_data_ver (hw) == +ICE_GET_LINK_STATUS_DATA_V1 ) ?ICE_GET_LINK_STATUS_DATALEN_V1 : +ICE_GET_LINK_STATUS_DATALEN_V2 ; +} +/** * ice_aq_get_link_info * @pi: port information structure
@@ -602,8 +618,8 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, resp->cmd_flags =CPU_TO_LE16 (cmd_flags); resp->lport_num = pi->lport; - status =ice_aq_send_cmd (hw, &desc, &link_data,sizeof (link_data), cd); - + status =ice_aq_send_cmd (hw, &desc, &link_data, +ice_get_link_status_datalen (hw), cd);if (status)return status;
Signature · 1 line
2.43.0
PATCH v2 114/148 net/ice/base: add port option commands
In reply to Anatoly BurakovAdds the Set/Get Port Options commands (0x06EA/0x06EB), also include additional status and ID bits to improve the Link topology configuration as well as ability to change port option from pre-boot environment via the UEFI driver.
--- drivers/net/ice/base/ice_adminq_cmd.h | 59 ++++++++++++++ drivers/net/ice/base/ice_common.c | 109 ++++++++++++++++++++++++++ drivers/net/ice/base/ice_common.h | 9 +++ drivers/net/ice/base/ice_type.h | 2 + 4 files changed, 179 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +59 -0
@@ -1862,6 +1862,63 @@ struct ice_aqc_set_port_id_led {u8 rsvd[13 ]; }; +/* Get Port Options (indirect, 0x06EA) */ +struct ice_aqc_get_port_options { +u8 lport_num; +u8 lport_num_valid; +#define ICE_AQC_PORT_OPT_PORT_NUM_VALID BIT(0) +u8 port_options_count; +#define ICE_AQC_PORT_OPT_COUNT_S 0 +#define ICE_AQC_PORT_OPT_COUNT_M (0xF << ICE_AQC_PORT_OPT_COUNT_S) +#define ICE_AQC_PORT_OPT_MAX 16 +u8 innermost_phy_index; +u8 port_options; +#define ICE_AQC_PORT_OPT_ACTIVE_S 0 +#define ICE_AQC_PORT_OPT_ACTIVE_M (0xF << ICE_AQC_PORT_OPT_ACTIVE_S) +#define ICE_AQC_PORT_OPT_FORCED BIT(6) +#define ICE_AQC_PORT_OPT_VALID BIT(7) +u8 pending_port_option_status; +#define ICE_AQC_PENDING_PORT_OPT_IDX_S 0 +#define ICE_AQC_PENDING_PORT_OPT_IDX_M (0xF << ICE_AQC_PENDING_PORT_OPT_IDX_S) +#define ICE_AQC_PENDING_PORT_OPT_VALID BIT(7) +u8 rsvd[2 ]; +__le32 addr_high; +__le32 addr_low; +}; + +struct ice_aqc_get_port_options_elem { +u8 pmd; +#define ICE_AQC_PORT_INV_PORT_OPT 4 +#define ICE_AQC_PORT_OPT_PMD_COUNT_S 0 +#define ICE_AQC_PORT_OPT_PMD_COUNT_M (0xF << ICE_AQC_PORT_OPT_PMD_COUNT_S) +#define ICE_AQC_PORT_OPT_PMD_WIDTH_S 4 +#define ICE_AQC_PORT_OPT_PMD_WIDTH_M (0xF << ICE_AQC_PORT_OPT_PMD_WIDTH_S) +u8 max_lane_speed; +#define ICE_AQC_PORT_OPT_MAX_LANE_S 0 +#define ICE_AQC_PORT_OPT_MAX_LANE_M (0xF << ICE_AQC_PORT_OPT_MAX_LANE_S) +#define ICE_AQC_PORT_OPT_MAX_LANE_100M 0 +#define ICE_AQC_PORT_OPT_MAX_LANE_1G 1 +#define ICE_AQC_PORT_OPT_MAX_LANE_2500M 2 +#define ICE_AQC_PORT_OPT_MAX_LANE_5G 3 +#define ICE_AQC_PORT_OPT_MAX_LANE_10G 4 +#define ICE_AQC_PORT_OPT_MAX_LANE_25G 5 +#define ICE_AQC_PORT_OPT_MAX_LANE_50G 6 +#define ICE_AQC_PORT_OPT_MAX_LANE_100G 7 +#define ICE_AQC_PORT_OPT_MAX_LANE_200G 8 +u8 global_scid[2 ]; +u8 phy_scid[2 ]; +u8 pf2port_cid[2 ]; +}; + +/* Set Port Option (direct, 0x06EB) */ +struct ice_aqc_set_port_option { +u8 lport_num; +u8 lport_num_valid; +#define ICE_AQC_SET_PORT_OPT_PORT_NUM_VALID BIT(0) +u8 selected_port_option; +u8 rsvd[13 ]; +}; +/* Set/Get GPIO (direct, 0x06EC/0x06ED) */ struct ice_aqc_gpio {__le16 gpio_ctrl_handle;
@@ -3132,6 +3189,8 @@ struct ice_aq_desc {struct ice_aqc_sw_gpio sw_read_write_gpio;struct ice_aqc_sff_eeprom read_write_sff_param;struct ice_aqc_set_port_id_led set_port_id_led; +struct ice_aqc_get_port_options get_port_options; +struct ice_aqc_set_port_option set_port_option;struct ice_aqc_get_sw_cfg get_sw_conf;struct ice_aqc_set_port_params set_port_params;struct ice_aqc_sw_rules sw_rules;
drivers/net/ice/base/ice_common.c +109 -0
115 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +9 -0
@@ -230,6 +230,15 @@ ice_aq_read_topo_dev_nvm(struct ice_hw *hw, struct ice_sq_cd *cd);int +ice_aq_get_port_options (struct ice_hw *hw, +struct ice_aqc_get_port_options_elem *options, +u8 *option_count,u8 lport,bool lport_valid, +u8 *active_option_idx,bool *active_option_valid, +u8 *pending_option_idx,bool *pending_option_valid); +int +ice_aq_set_port_option (struct ice_hw *hw,u8 lport,u8 lport_valid, +u8 new_option); +int ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues, u16 *q_handle, u16 *q_ids, u32 *q_teids, enum ice_disq_rst_src rst_src, u16 vmvf_num,
drivers/net/ice/base/ice_type.h +2 -0
@@ -1065,6 +1065,8 @@ enum ice_rl_type {#define ICE_TXSCHED_GET_RL_WAKEUP_MV (p) LE16_TO_CPU((p)->info.wake_up_calc)#define ICE_TXSCHED_GET_RL_ENCODE (p) LE16_TO_CPU((p)->info.rl_encode) +#define ICE_MAX_PORT_PER_PCI_DEV 8 +/* The following tree example shows the naming conventions followed under * ice_port_info struct for default scheduler tree topology. *
Signature · 1 line
2.43.0
PATCH v2 115/148 net/ice/base: merge unified E830 headers
In reply to Anatoly BurakovThese changes are a result of combining E800 and E830 autogen files, as well as multiple other infrastructural changes and E830-specific macro additions in place of common definitions to better align with shared code.
--- drivers/net/ice/base/ice_common.c | 35 +- drivers/net/ice/base/ice_hw_autogen.h | 2482 +++++++++++++++++++++---- drivers/net/ice/base/ice_nvm.c | 15 +- 3 files changed, 2158 insertions(+), 374 deletions(-)
drivers/net/ice/base/ice_common.c +23 -12
@@ -702,17 +702,28 @@ ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw,* Also, because we are operating on transmit timer and fc * threshold of LFC, we don't turn on any bit in tx_tmr_priority */ -#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX +#define E800_IDX_OF_LFC E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX -/* Retrieve the transmit timer */ - val =rd32 (hw,PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA (IDX_OF_LFC )); - tx_timer_val = val & -PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M ; - cmd->tx_tmr_value =CPU_TO_LE16 (tx_timer_val); +if ((hw)->mac_type ==ICE_MAC_E830 ) { +/* Retrieve the transmit timer */ + val =rd32 (hw,E830_PRTMAC_CL01_PAUSE_QUANTA ); + tx_timer_val = val &E830_PRTMAC_CL01_PAUSE_QUANTA_CL0_PAUSE_QUANTA_M ; + cmd->tx_tmr_value =CPU_TO_LE16 (tx_timer_val); -/* Retrieve the fc threshold */ - val =rd32 (hw,PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER (IDX_OF_LFC )); - fc_thres_val = val &PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M ; +/* Retrieve the fc threshold */ + val =rd32 (hw,E830_PRTMAC_CL01_QUANTA_THRESH ); + fc_thres_val = val &E830_PRTMAC_CL01_QUANTA_THRESH_CL0_QUANTA_THRESH_M ; + }else { +/* Retrieve the transmit timer */ + val =rd32 (hw,E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA (E800_IDX_OF_LFC )); + tx_timer_val = val & +E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M ; + cmd->tx_tmr_value =CPU_TO_LE16 (tx_timer_val); + +/* Retrieve the fc threshold */ + val =rd32 (hw,E800_PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER (E800_IDX_OF_LFC )); + fc_thres_val = val &E800_PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M ; + } cmd->fc_refresh_threshold =CPU_TO_LE16 (fc_thres_val); }
@@ -2605,11 +2616,11 @@ ice_parse_fdir_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p)if (hw->dcf_enabled)return ; reg_val =rd32 (hw,GLQF_FD_SIZE ); - val = (reg_val &GLQF_FD_SIZE_FD_GSIZE_M ) >> + val = (reg_val &GLQF_FD_SIZE_FD_GSIZE_M_BY_MAC (hw)) >>GLQF_FD_SIZE_FD_GSIZE_S ; func_p->fd_fltr_guar =ice_get_num_per_func (hw, val); - val = (reg_val &GLQF_FD_SIZE_FD_BSIZE_M ) >> + val = (reg_val &GLQF_FD_SIZE_FD_BSIZE_M_BY_MAC (hw)) >>GLQF_FD_SIZE_FD_BSIZE_S ; func_p->fd_fltr_best_effort = val;
@@ -5746,7 +5757,7 @@ enum ice_fw_modes ice_get_fw_mode(struct ice_hw *hw)u32 fw_mode;/* check the current FW mode */ - fw_mode =rd32 (hw,GL_MNG_FWSM ) &GL_MNG_FWSM_FW_MODES_M ; + fw_mode =rd32 (hw,GL_MNG_FWSM ) &E800_GL_MNG_FWSM_FW_MODES_M ;if (fw_mode &ICE_FW_MODE_DBG_M )return ICE_FW_MODE_DBG ;
drivers/net/ice/base/ice_hw_autogen.h +2126 -356
2,748 lines not on this page · raw message
drivers/net/ice/base/ice_nvm.c +9 -6
@@ -1359,13 +1359,16 @@ ice_nvm_access_write(struct ice_hw *hw, struct ice_nvm_access_cmd *cmd,return status;/* Reject requests to write to read-only registers */ -switch (cmd->offset) { -case GL_HICR_EN : -case GLGEN_RSTAT : +if (hw->mac_type ==ICE_MAC_E830 ) { +if (cmd->offset ==E830_GL_HICR_EN ) +return ICE_ERR_OUT_OF_RANGE ; + }else { +if (cmd->offset ==GL_HICR_EN ) +return ICE_ERR_OUT_OF_RANGE ; + } + +if (cmd->offset ==GLGEN_RSTAT )return ICE_ERR_OUT_OF_RANGE ; -default : -break ; - }ice_debug (hw,ICE_DBG_NVM ,"NVM access: writing register %08x with value %08x\n" , cmd->offset, data->regval);
Signature · 1 line
2.43.0
PATCH v2 116/148 net/ice/base: replace array initialization with macros
In reply to Anatoly BurakovCertain compilers do not allow array initialization with indexes, so the best way to avoid the issue when compiling for these platforms is to use a macro.
--- drivers/net/ice/base/ice_common.c | 86 +++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_common.h | 8 +++ 2 files changed, 94 insertions(+)
drivers/net/ice/base/ice_common.c +86 -0
@@ -12,6 +12,92 @@#define ICE_PF_RESET_WAIT_COUNT 300 +static const char *const ice_link_mode_str_low[] = { +ice_arr_elem_idx (0 ,"100BASE_TX" ), +ice_arr_elem_idx (1 ,"100M_SGMII" ), +ice_arr_elem_idx (2 ,"1000BASE_T" ), +ice_arr_elem_idx (3 ,"1000BASE_SX" ), +ice_arr_elem_idx (4 ,"1000BASE_LX" ), +ice_arr_elem_idx (5 ,"1000BASE_KX" ), +ice_arr_elem_idx (6 ,"1G_SGMII" ), +ice_arr_elem_idx (7 ,"2500BASE_T" ), +ice_arr_elem_idx (8 ,"2500BASE_X" ), +ice_arr_elem_idx (9 ,"2500BASE_KX" ), +ice_arr_elem_idx (10 ,"5GBASE_T" ), +ice_arr_elem_idx (11 ,"5GBASE_KR" ), +ice_arr_elem_idx (12 ,"10GBASE_T" ), +ice_arr_elem_idx (13 ,"10G_SFI_DA" ), +ice_arr_elem_idx (14 ,"10GBASE_SR" ), +ice_arr_elem_idx (15 ,"10GBASE_LR" ), +ice_arr_elem_idx (16 ,"10GBASE_KR_CR1" ), +ice_arr_elem_idx (17 ,"10G_SFI_AOC_ACC" ), +ice_arr_elem_idx (18 ,"10G_SFI_C2C" ), +ice_arr_elem_idx (19 ,"25GBASE_T" ), +ice_arr_elem_idx (20 ,"25GBASE_CR" ), +ice_arr_elem_idx (21 ,"25GBASE_CR_S" ), +ice_arr_elem_idx (22 ,"25GBASE_CR1" ), +ice_arr_elem_idx (23 ,"25GBASE_SR" ), +ice_arr_elem_idx (24 ,"25GBASE_LR" ), +ice_arr_elem_idx (25 ,"25GBASE_KR" ), +ice_arr_elem_idx (26 ,"25GBASE_KR_S" ), +ice_arr_elem_idx (27 ,"25GBASE_KR1" ), +ice_arr_elem_idx (28 ,"25G_AUI_AOC_ACC" ), +ice_arr_elem_idx (29 ,"25G_AUI_C2C" ), +ice_arr_elem_idx (30 ,"40GBASE_CR4" ), +ice_arr_elem_idx (31 ,"40GBASE_SR4" ), +ice_arr_elem_idx (32 ,"40GBASE_LR4" ), +ice_arr_elem_idx (33 ,"40GBASE_KR4" ), +ice_arr_elem_idx (34 ,"40G_XLAUI_AOC_ACC" ), +ice_arr_elem_idx (35 ,"40G_XLAUI" ), +ice_arr_elem_idx (36 ,"50GBASE_CR2" ), +ice_arr_elem_idx (37 ,"50GBASE_SR2" ), +ice_arr_elem_idx (38 ,"50GBASE_LR2" ), +ice_arr_elem_idx (39 ,"50GBASE_KR2" ), +ice_arr_elem_idx (40 ,"50G_LAUI2_AOC_ACC" ), +ice_arr_elem_idx (41 ,"50G_LAUI2" ), +ice_arr_elem_idx (42 ,"50G_AUI2_AOC_ACC" ), +ice_arr_elem_idx (43 ,"50G_AUI2" ), +ice_arr_elem_idx (44 ,"50GBASE_CP" ), +ice_arr_elem_idx (45 ,"50GBASE_SR" ), +ice_arr_elem_idx (46 ,"50GBASE_FR" ), +ice_arr_elem_idx (47 ,"50GBASE_LR" ), +ice_arr_elem_idx (48 ,"50GBASE_KR_PAM4" ), +ice_arr_elem_idx (49 ,"50G_AUI1_AOC_ACC" ), +ice_arr_elem_idx (50 ,"50G_AUI1" ), +ice_arr_elem_idx (51 ,"100GBASE_CR4" ), +ice_arr_elem_idx (52 ,"100GBASE_SR4" ), +ice_arr_elem_idx (53 ,"100GBASE_LR4" ), +ice_arr_elem_idx (54 ,"100GBASE_KR4" ), +ice_arr_elem_idx (55 ,"100G_CAUI4_AOC_ACC" ), +ice_arr_elem_idx (56 ,"100G_CAUI4" ), +ice_arr_elem_idx (57 ,"100G_AUI4_AOC_ACC" ), +ice_arr_elem_idx (58 ,"100G_AUI4" ), +ice_arr_elem_idx (59 ,"100GBASE_CR_PAM4" ), +ice_arr_elem_idx (60 ,"100GBASE_KR_PAM4" ), +ice_arr_elem_idx (61 ,"100GBASE_CP2" ), +ice_arr_elem_idx (62 ,"100GBASE_SR2" ), +ice_arr_elem_idx (63 ,"100GBASE_DR" ), +}; + +static const char *const ice_link_mode_str_high[] = { +ice_arr_elem_idx (0 ,"100GBASE_KR2_PAM4" ), +ice_arr_elem_idx (1 ,"100G_CAUI2_AOC_ACC" ), +ice_arr_elem_idx (2 ,"100G_CAUI2" ), +ice_arr_elem_idx (3 ,"100G_AUI2_AOC_ACC" ), +ice_arr_elem_idx (4 ,"100G_AUI2" ), +ice_arr_elem_idx (5 ,"200G_CR4_PAM4" ), +ice_arr_elem_idx (6 ,"200G_SR4" ), +ice_arr_elem_idx (7 ,"200G_FR4" ), +ice_arr_elem_idx (8 ,"200G_LR4" ), +ice_arr_elem_idx (9 ,"200G_DR4" ), +ice_arr_elem_idx (10 ,"200G_KR4_PAM4" ), +ice_arr_elem_idx (11 ,"200G_AUI4_AOC_ACC" ), +ice_arr_elem_idx (12 ,"200G_AUI4" ), +ice_arr_elem_idx (13 ,"200G_AUI8_AOC_ACC" ), +ice_arr_elem_idx (14 ,"200G_AUI8" ), +ice_arr_elem_idx (15 ,"400GBASE_FR8" ), +}; +/** * dump_phy_type - helper function that prints PHY type strings * @hw: pointer to the HW structure
drivers/net/ice/base/ice_common.h +8 -0
@@ -84,6 +84,14 @@ ice_aq_get_internal_data(struct ice_hw *hw, u16 cluster_id, u16 table_id,*/ #define ICE_ALIGN (ptr, align) (((ptr) + ((align) - 1)) & ~((align) - 1)) +/* Define a macro for initializing array using indexes. Due to limitation +* of MSVC compiler it is necessary to allow other projects to replace +* that macro and strip the index from initialization. +* Linux driver is using coccinelle to maintain source sync with upstream +* and is not requiring this macro. +*/ +#define ice_arr_elem_idx (idx, val) [(idx)] = (val) +int ice_write_rxq_ctx (struct ice_hw *hw,struct ice_rlan_ctx *rlan_ctx,u32 rxq_index);
Signature · 1 line
2.43.0
PATCH v2 117/148 net/ice/base: switch speed conversions to static lookups
In reply to Anatoly BurakovRefactor to use a constant time lookup in a table for speed conversions from ICE_AQ_LINK_SPEED values to speeds defined in firmware.
Also, make sure 200000MBPS is defined when needed.
--- drivers/net/ice/base/ice_common.c | 40 ++++++++++++++++++++++++++-- drivers/net/ice/base/ice_common.h | 1 + drivers/net/ice/base/ice_lan_tx_rx.h | 2 +- 3 files changed, 40 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_common.c +38 -2
@@ -3417,8 +3417,8 @@ bool ice_is_100m_speed_supported(struct ice_hw *hw)* Note: In the structure of [phy_type_low, phy_type_high], there should * be one bit set, as this function will convert one PHY type to its * speed. -* If no bit gets set, ICE_LINK_SPEED_UNKNOWN will be returned -* If more than one bit gets set, ICE_LINK_SPEED_UNKNOWN will be returned +* If no bit gets set, ICE_AQ_LINK_SPEED_UNKNOWN will be returned +* If more than one bit gets set, ICE_AQ_LINK_SPEED_UNKNOWN will be returned */ static u16 ice_get_link_speed_based_on_phy_type (u64 phy_type_low,u64 phy_type_high)
@@ -6441,6 +6441,42 @@ bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw) ICE_FW_API_REPORT_DFLT_CFG_PATCH); } +/* each of the indexes into the following array match the speed of a return +* value from the list of AQ returned speeds like the range: +* ICE_AQ_LINK_SPEED_10MB .. ICE_AQ_LINK_SPEED_100GB excluding +* ICE_AQ_LINK_SPEED_UNKNOWN which is BIT(15) The array is defined as 15 +* elements long because the link_speed returned by the firmware is a 16 bit +* value, but is indexed by [fls(speed) - 1] +*/ +static const u32 ice_aq_to_link_speed[] = { +ICE_LINK_SPEED_10MBPS ,/* BIT(0) */ +ICE_LINK_SPEED_100MBPS , +ICE_LINK_SPEED_1000MBPS , +ICE_LINK_SPEED_2500MBPS , +ICE_LINK_SPEED_5000MBPS , +ICE_LINK_SPEED_10000MBPS , +ICE_LINK_SPEED_20000MBPS , +ICE_LINK_SPEED_25000MBPS , +ICE_LINK_SPEED_40000MBPS , +ICE_LINK_SPEED_50000MBPS , +ICE_LINK_SPEED_100000MBPS ,/* BIT(10) */ +ICE_LINK_SPEED_200000MBPS , +}; + +/** +* ice_get_link_speed - get integer speed from table +* @index: array index from fls(aq speed) - 1 +* +* Returns: u32 value containing integer speed +*/ +u32 ice_get_link_speed (u16 index) +{ +if (index >=ARRAY_SIZE (ice_aq_to_link_speed)) +return ICE_LINK_SPEED_UNKNOWN ; + +return ice_aq_to_link_speed[index]; +} +/** * ice_fw_supports_fec_dis_auto * @hw: pointer to the hardware structure
drivers/net/ice/base/ice_common.h +1 -0
@@ -226,6 +226,7 @@ int ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length, bool write, struct ice_sq_cd *cd); +u32 ice_get_link_speed (u16 index); int ice_aq_prog_topo_dev_nvm(struct ice_hw *hw,
drivers/net/ice/base/ice_lan_tx_rx.h +1 -1
@@ -2469,5 +2469,5 @@ static inline struct ice_rx_ptype_decoded ice_decode_rx_desc_ptype(u16 ptype)#define ICE_LINK_SPEED_40000MBPS 40000#define ICE_LINK_SPEED_50000MBPS 50000#define ICE_LINK_SPEED_100000MBPS 100000 - +#define ICE_LINK_SPEED_200000MBPS 200000#endif /* _ICE_LAN_TX_RX_H_ */
Signature · 1 line
2.43.0
PATCH v2 118/148 net/ice/base: support E830 in DDP pkg handling
In reply to Anatoly BurakovAdd support for E830 DDP packages in the DDP package handling code.
--- drivers/net/ice/base/ice_ddp.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ice/base/ice_ddp.c +6 -0
@@ -424,6 +424,9 @@ static u32 ice_get_pkg_segment_id(enum ice_mac_type mac_type)u32 seg_id;switch (mac_type) { +case ICE_MAC_E830 : + seg_id =SEGMENT_TYPE_ICE_E830 ; +break ;case ICE_MAC_GENERIC :case ICE_MAC_GENERIC_3K :case ICE_MAC_GENERIC_3K_E825 :
@@ -444,6 +447,9 @@ static u32 ice_get_pkg_sign_type(enum ice_mac_type mac_type)u32 sign_type;switch (mac_type) { +case ICE_MAC_E830 : + sign_type =SEGMENT_SIGN_TYPE_RSA3K_SBB ; +break ;case ICE_MAC_GENERIC_3K : sign_type =SEGMENT_SIGN_TYPE_RSA3K ;break ;
Signature · 1 line
2.43.0
PATCH v2 119/148 net/ice/base: support E830 in Topology AQ command
In reply to Anatoly BurakovIn E830, regarding the Get Tx Topology AQ command, there is a change in the way that the RD bit must be set. For E830, the RD bit must be cleared. Setting the RD bit for the E830 device was causing the Get Tx Topology command to fail.
Fix it to clear RD bit for E830 device.
--- drivers/net/ice/base/ice_ddp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_ddp.c +6 -1
@@ -2301,11 +2301,16 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size,if (buf) cmd->set_flags |=ICE_AQC_TX_TOPO_FLAGS_SRC_RAM |ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW ; + + desc.flags |=CPU_TO_LE16 (ICE_AQ_FLAG_RD ); }else {ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_get_tx_topo); cmd->get_flags =ICE_AQC_TX_TOPO_GET_RAM ; + +if (!ice_is_e830 (hw)) + desc.flags |=CPU_TO_LE16 (ICE_AQ_FLAG_RD ); } - desc.flags |=CPU_TO_LE16 (ICE_AQ_FLAG_RD ); + status =ice_aq_send_cmd (hw, &desc, buf, buf_size, cd);if (status)return status;
Signature · 1 line
2.43.0
PATCH v2 120/148 net/ice/base: add E830 PTP init
In reply to Anatoly BurakovAdd E830 PTP initialization flow.
TXPP requires SW and HW timer clock synchronization which is done during the PTP initialization flow.
The E810 and E830 PTP initialization flows are similar. The primary difference that E810 initializes the PHY via AQCs, and E830 does not initialize the external PHY.
--- drivers/net/ice/base/ice_ptp_hw.c | 41 +++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +39 -2
@@ -911,6 +911,18 @@ static void ice_ptp_exec_tmr_cmd(struct ice_hw *hw)ice_flush (hw); } +/** +* ice_ptp_zero_syn_dlay - Set synchronization delay to zero +* @hw: pointer to HW struct +* +* Zero E810 and E830 specific PTP hardware clock synchronization delay. +*/ +static void ice_ptp_zero_syn_dlay (struct ice_hw *hw) +{ +wr32 (hw,GLTSYN_SYNC_DLAY ,0 ); +ice_flush (hw); +} +enum eth56g_res_type {ETH56G_PHY_REG ,ETH56G_PHY_MEM ,
@@ -4899,8 +4911,7 @@ int ice_ptp_init_phy_e810(struct ice_hw *hw)*/ static int ice_ptp_init_phc_e810 (struct ice_hw *hw) { -/* Ensure synchronization delay is zero */ -wr32 (hw,GLTSYN_SYNC_DLAY ,0 ); +ice_ptp_zero_syn_dlay (hw);/* Initialize the PHY */ return ice_ptp_init_phy_e810 (hw);
@@ -5400,6 +5411,24 @@ int ice_ptp_read_sdp_section_from_nvm(struct ice_hw *hw, bool *section_exist,return err; } +/* E830 functions +* +* The following functions operate on the E830 series devices. +* +*/ + +/** +* ice_ptp_init_phc_e830 - Perform E830 specific PHC initialization +* @hw: pointer to HW struct +* +* Perform E830-specific PTP hardware clock initialization steps. +*/ +static int ice_ptp_init_phc_e830 (struct ice_hw *hw) +{ +ice_ptp_zero_syn_dlay (hw); +return 0 ; +} +/** * ice_ptp_write_direct_incval_e830 - Prep PHY port increment value change * @hw: pointer to HW struct
@@ -5636,6 +5665,8 @@ void ice_ptp_init_phy_model(struct ice_hw *hw)if (ice_is_e810 (hw)) hw->phy_model =ICE_PHY_E810 ; +else if (ice_is_e830 (hw)) + hw->phy_model =ICE_PHY_E830 ;else hw->phy_model =ICE_PHY_E822 ; hw->phy_ports =ICE_NUM_EXTERNAL_PORTS ;
@@ -6113,6 +6144,7 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw)ice_ptp_reset_ts_memory_e822 (hw);break ;case ICE_PHY_E810 : +case ICE_PHY_E830 :default :return ; }
@@ -6141,6 +6173,8 @@ int ice_ptp_init_phc(struct ice_hw *hw)return ice_ptp_init_phc_e810 (hw);case ICE_PHY_E822 :return ice_ptp_init_phc_e822 (hw); +case ICE_PHY_E830 : +return ice_ptp_init_phc_e830 (hw);default :return ICE_ERR_NOT_SUPPORTED ; }
@@ -6163,6 +6197,9 @@ int ice_get_phy_tx_tstamp_ready(struct ice_hw *hw, u8 block, u64 *tstamp_ready)case ICE_PHY_ETH56G :return ice_get_phy_tx_tstamp_ready_eth56g (hw, block, tstamp_ready); +case ICE_PHY_E830 : +return ice_get_phy_tx_tstamp_ready_e830 (hw, block, + tstamp_ready);case ICE_PHY_E810 :return ice_get_phy_tx_tstamp_ready_e810 (hw, block, tstamp_ready);
Signature · 1 line
2.43.0
PATCH v2 121/148 net/ice/base: allow skipping main timer programming
In reply to Anatoly BurakovAllow initialization functions to skip main timer programming.
--- drivers/net/ice/base/ice_ptp_hw.c | 31 ++++++++++++++++++++----------- drivers/net/ice/base/ice_ptp_hw.h | 9 ++++++--- drivers/net/ice/ice_ethdev.c | 2 +- 3 files changed, 27 insertions(+), 15 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +20 -11
@@ -5806,6 +5806,7 @@ static int ice_ptp_tmr_cmd(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,* ice_ptp_init_time - Initialize device time to provided value * @hw: pointer to HW struct * @time: 64bits of time (GLTSYN_TIME_L and GLTSYN_TIME_H) +* @wr_main_tmr: program the main timer * * Initialize the device to the specified time provided. This requires a three * step process:
@@ -5815,7 +5816,7 @@ static int ice_ptp_tmr_cmd(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,* 3) issue an init_time timer command to synchronously switch both the source * and port timers to the new init time value at the next clock cycle. */ -int ice_ptp_init_time (struct ice_hw *hw,u64 time) +int ice_ptp_init_time (struct ice_hw *hw,u64 time,bool wr_main_tmr) {int err;u8 tmr_idx;
@@ -5827,9 +5828,11 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time)if (hw->phy_model ==ICE_PHY_E830 )return ice_ptp_write_direct_phc_time_e830 (hw, time); -wr32 (hw,GLTSYN_SHTIME_L (tmr_idx),ICE_LO_DWORD (time)); -wr32 (hw,GLTSYN_SHTIME_H (tmr_idx),ICE_HI_DWORD (time)); -wr32 (hw,GLTSYN_SHTIME_0 (tmr_idx),0 ); +if (wr_main_tmr) { +wr32 (hw,GLTSYN_SHTIME_L (tmr_idx),ICE_LO_DWORD (time)); +wr32 (hw,GLTSYN_SHTIME_H (tmr_idx),ICE_HI_DWORD (time)); +wr32 (hw,GLTSYN_SHTIME_0 (tmr_idx),0 ); + }/* PHY Clks */ /* Fill Rx and Tx ports and send msg to PHY */
@@ -5857,8 +5860,9 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time)* ice_ptp_write_incval - Program PHC with new increment value * @hw: pointer to HW struct * @incval: Source timer increment value per clock cycle +* @wr_main_tmr: Program the main timer * -* Program the PHC with a new increment value. This requires a three-step +* Program the timers with a new increment value. This requires a three-step * process: * * 1) Write the increment value to the source timer shadow registers
@@ -5867,7 +5871,8 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time)* the source and port timers to the new increment value at the next clock * cycle. */ -int ice_ptp_write_incval (struct ice_hw *hw,u64 incval) +int ice_ptp_write_incval (struct ice_hw *hw,u64 incval, +bool wr_main_tmr) {int err;u8 tmr_idx;
@@ -5878,9 +5883,11 @@ int ice_ptp_write_incval(struct ice_hw *hw, u64 incval)if (hw->phy_model ==ICE_PHY_E830 )return ice_ptp_write_direct_incval_e830 (hw, incval); -/* Shadow Adjust */ -wr32 (hw,GLTSYN_SHADJ_L (tmr_idx),ICE_LO_DWORD (incval)); -wr32 (hw,GLTSYN_SHADJ_H (tmr_idx),ICE_HI_DWORD (incval)); +if (wr_main_tmr) { +/* Shadow Adjust */ +wr32 (hw,GLTSYN_SHADJ_L (tmr_idx),ICE_LO_DWORD (incval)); +wr32 (hw,GLTSYN_SHADJ_H (tmr_idx),ICE_HI_DWORD (incval)); + }switch (hw->phy_model) {case ICE_PHY_ETH56G :
@@ -5906,17 +5913,19 @@ int ice_ptp_write_incval(struct ice_hw *hw, u64 incval)* ice_ptp_write_incval_locked - Program new incval while holding semaphore * @hw: pointer to HW struct * @incval: Source timer increment value per clock cycle +* @wr_main_tmr: Program the main timer * * Program a new PHC incval while holding the PTP semaphore. */ -int ice_ptp_write_incval_locked (struct ice_hw *hw,u64 incval) +int ice_ptp_write_incval_locked (struct ice_hw *hw,u64 incval, +bool wr_main_tmr) {int err;if (!ice_ptp_lock (hw))return ICE_ERR_NOT_READY ; - err =ice_ptp_write_incval (hw, incval); + err =ice_ptp_write_incval (hw, incval, wr_main_tmr);ice_ptp_unlock (hw);
drivers/net/ice/base/ice_ptp_hw.h +6 -3
@@ -142,9 +142,12 @@ u64 ice_ptp_read_src_incval(struct ice_hw *hw);bool ice_ptp_lock (struct ice_hw *hw);void ice_ptp_unlock (struct ice_hw *hw);void ice_ptp_src_cmd (struct ice_hw *hw,enum ice_ptp_tmr_cmd cmd); -int ice_ptp_init_time (struct ice_hw *hw,u64 time); -int ice_ptp_write_incval (struct ice_hw *hw,u64 incval); -int ice_ptp_write_incval_locked (struct ice_hw *hw,u64 incval); +int ice_ptp_init_time (struct ice_hw *hw,u64 time, +bool wr_main_tmr); +int ice_ptp_write_incval (struct ice_hw *hw,u64 incval, +bool wr_main_tmr); +int ice_ptp_write_incval_locked (struct ice_hw *hw,u64 incval, +bool wr_main_tmr);int ice_ptp_adj_clock (struct ice_hw *hw,s32 adj,bool lock_sbq);int ice_ptp_adj_clock_at_time (struct ice_hw *hw,u64 at_time,s32 adj);
drivers/net/ice/ice_ethdev.c +1 -1
@@ -6438,7 +6438,7 @@ ice_timesync_enable(struct rte_eth_dev *dev)return -1 ; } - ret =ice_ptp_write_incval (hw,ICE_PTP_NOMINAL_INCVAL_E810 ); + ret =ice_ptp_write_incval (hw,ICE_PTP_NOMINAL_INCVAL_E810 , true);if (ret) {PMD_DRV_LOG (ERR ,"Failed to write PHC increment time value" );
Signature · 1 line
2.43.0
PATCH v2 122/148 net/ice/base: add missing files for shared code update
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add missing files that are present in shared code update. Although these do not contain code add them so that shared code update matches like for like.
---
drivers/net/ice/base/{ice_fwlog.h => ice_vf_mbx.c} | 0
drivers/net/ice/base/{ice_fwlog.h => ice_vf_mbx.h} | 0
drivers/net/ice/base/meson.build | 1 +
3 files changed, 1 insertion(+)
copy drivers/net/ice/base/{ice_fwlog.h => ice_vf_mbx.c} (100%)
copy drivers/net/ice/base/{ice_fwlog.h => ice_vf_mbx.h} (100%)drivers/net/ice/base/ice_vf_mbx.c renamed from drivers/net/ice/base/ice_fwlog.h +0 -0
drivers/net/ice/base/ice_vf_mbx.h renamed from drivers/net/ice/base/ice_fwlog.h +0 -0
drivers/net/ice/base/meson.build +1 -0
@@ -28,6 +28,7 @@ sources = [ 'ice_parser_rt.c', 'ice_ddp.c', 'ice_fwlog.c', + 'ice_vf_mbx.c', ] error_cflags = [
Signature · 1 line
2.43.0
Re: [PATCH v2 122/148] net/ice/base: add missing files for shared code update
Quoted 5 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
Add missing files that are present in shared code update. Although these do not contain code add them so that shared code update matches like for like.
Quoted 9 lines
Signed-off-by Ian Stokes <[email protected]>--- drivers/net/ice/base/{ice_fwlog.h => ice_vf_mbx.c} | 0 drivers/net/ice/base/{ice_fwlog.h => ice_vf_mbx.h} | 0 drivers/net/ice/base/meson.build | 1 + 3 files changed, 1 insertion(+) copy drivers/net/ice/base/{ice_fwlog.h => ice_vf_mbx.c} (100%) copy drivers/net/ice/base/{ice_fwlog.h => ice_vf_mbx.h} (100%)
The log empty files were also added in this set (patch 59). Merge this into that patch.
/Bruce
PATCH v2 123/148 net/ice/base: align code to upstream
In reply to Anatoly BurakovCurrently, there are some miscellaneous changes that are missing from DPDK that are present in upstream code. This patch aligns our code to that of upstream, with following changes:
- Comment fixes
- Whitespace/line break alignment
- Moving function definitions within headers
- Moving functions within .c files
- Moving case statements within code
- Adding missing constants
- Renaming functions
- Moving variable declarations
--- drivers/net/ice/base/ice_adminq_cmd.h | 18 ++-- drivers/net/ice/base/ice_bitops.h | 4 +- drivers/net/ice/base/ice_common.c | 11 +- drivers/net/ice/base/ice_common.h | 1 - drivers/net/ice/base/ice_controlq.c | 7 +- drivers/net/ice/base/ice_controlq.h | 1 - drivers/net/ice/base/ice_ddp.c | 3 +- drivers/net/ice/base/ice_devids.h | 8 +- drivers/net/ice/base/ice_fdir.c | 22 ++-- drivers/net/ice/base/ice_flex_pipe.c | 106 ++++++++++---------- drivers/net/ice/base/ice_flex_type.h | 1 - drivers/net/ice/base/ice_flow.c | 91 +++++++++-------- drivers/net/ice/base/ice_flow.h | 17 ++-- drivers/net/ice/base/ice_hw_autogen.h | 2 +- drivers/net/ice/base/ice_lan_tx_rx.h | 3 +- drivers/net/ice/base/ice_nvm.c | 19 ++-- drivers/net/ice/base/ice_nvm.h | 1 - drivers/net/ice/base/ice_parser.c | 20 ++-- drivers/net/ice/base/ice_parser.h | 18 ++-- drivers/net/ice/base/ice_parser_rt.c | 22 ++-- drivers/net/ice/base/ice_parser_rt.h | 2 +- drivers/net/ice/base/ice_protocol_type.h | 11 +- drivers/net/ice/base/ice_ptp_consts.h | 3 +- drivers/net/ice/base/ice_ptp_hw.c | 106 +++++++++++--------- drivers/net/ice/base/ice_sched.h | 10 +- drivers/net/ice/base/ice_switch.c | 122 ++++++++++++----------- drivers/net/ice/base/ice_switch.h | 9 +- drivers/net/ice/base/ice_type.h | 3 +- drivers/net/ice/base/ice_xlt_kb.c | 4 +- 29 files changed, 331 insertions(+), 314 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +9 -9
@@ -761,7 +761,7 @@ struct ice_aqc_recipe_content {#define ICE_AQ_RECIPE_ID_S 0#define ICE_AQ_RECIPE_ID_M (0x3F << ICE_AQ_RECIPE_ID_S)#define ICE_AQ_RECIPE_ID_IS_ROOT BIT(7) -#define ICE_AQ_SW_ID_LKUP_IDX 0 +#define ICE_AQ_SW_ID_LKUP_IDX 0u8 lkup_indx[5 ];#define ICE_AQ_RECIPE_LKUP_DATA_S 0#define ICE_AQ_RECIPE_LKUP_DATA_M (0x3F << ICE_AQ_RECIPE_LKUP_DATA_S)
@@ -1096,9 +1096,9 @@ struct ice_aqc_txsched_elem {u8 generic;#define ICE_AQC_ELEM_GENERIC_MODE_M 0x1#define ICE_AQC_ELEM_GENERIC_PRIO_S 0x1 -#define ICE_AQC_ELEM_GENERIC_PRIO_M (0x7 << ICE_AQC_ELEM_GENERIC_PRIO_S) +#define ICE_AQC_ELEM_GENERIC_PRIO_M (0x7 << ICE_AQC_ELEM_GENERIC_PRIO_S)#define ICE_AQC_ELEM_GENERIC_SP_S 0x4 -#define ICE_AQC_ELEM_GENERIC_SP_M (0x1 << ICE_AQC_ELEM_GENERIC_SP_S) +#define ICE_AQC_ELEM_GENERIC_SP_M (0x1 << ICE_AQC_ELEM_GENERIC_SP_S)#define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S 0x5#define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_M \ (0x3 << ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S)
@@ -2012,10 +2012,11 @@ struct ice_aqc_nvm {#define ICE_AQC_NVM_REVERT_LAST_ACTIV BIT(6)/* Write Activate only */ #define ICE_AQC_NVM_ACTIV_SEL_MASK MAKEMASK(0x7, 3)#define ICE_AQC_NVM_FLASH_ONLY BIT(7) -#define ICE_AQC_NVM_POR_FLAG 0/* Used by NVM Write completion on ARQ */ -#define ICE_AQC_NVM_PERST_FLAG 1 -#define ICE_AQC_NVM_EMPR_FLAG 2 -#define ICE_AQC_NVM_EMPR_ENA BIT(0) +#define ICE_AQC_NVM_RESET_LVL_M MAKEMASK(0x3, 0)/* Write reply only */ +#define ICE_AQC_NVM_POR_FLAG 0 +#define ICE_AQC_NVM_PERST_FLAG 1 +#define ICE_AQC_NVM_EMPR_FLAG 2 +#define ICE_AQC_NVM_EMPR_ENA BIT(0)/* Write Activate reply only */ __le16 module_typeid;__le16 length;#define ICE_AQC_NVM_ERASE_LEN 0xFFFF
@@ -2894,7 +2895,6 @@ struct ice_aqc_dis_txq_item { (1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S)__le16 q_id[STRUCT_HACK_VAR_LEN ]; }; -#pragma pack()/* Tx LAN Queues Cleanup Event (0x0C31) */
@@ -2974,7 +2974,7 @@ struct ice_pkg_ver { };#define ICE_PKG_NAME_SIZE 32 -#define ICE_SEG_ID_SIZE 28 +#define ICE_SEG_ID_SIZE 28#define ICE_SEG_NAME_SIZE 28struct ice_aqc_get_pkg_info {
drivers/net/ice/base/ice_bitops.h +2 -2
@@ -375,7 +375,7 @@ static inline bool ice_is_any_bit_set(ice_bitmap_t *bitmap, u16 size) }/** -* ice_cp_bitmap - copy bitmaps. +* ice_cp_bitmap - copy bitmaps * @dst: bitmap destination * @src: bitmap to copy from * @size: Size of the bitmaps in bits
@@ -433,7 +433,7 @@ ice_bitmap_hweight(ice_bitmap_t *bm, u16 size) }/** -* ice_cmp_bitmap - compares two bitmaps. +* ice_cmp_bitmap - compares two bitmaps * @bmp1: the bitmap to compare * @bmp2: the bitmap to compare with bmp1 * @size: Size of the bitmaps in bits
drivers/net/ice/base/ice_common.c +6 -5
@@ -5,7 +5,6 @@#include "ice_common.h" #include "ice_sched.h" #include "ice_adminq_cmd.h" -#include "ice_flow.h" #include "ice_ptp_hw.h" #include "ice_switch.h"
@@ -598,6 +597,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, cmd->param0 |=CPU_TO_LE16 (ICE_AQC_GET_PHY_RQM ); cmd->param0 |=CPU_TO_LE16 (report_mode); + status =ice_aq_send_cmd (hw, &desc, pcaps, pcaps_size, cd);ice_debug (hw,ICE_DBG_LINK ,"get phy caps dump\n" );
@@ -694,6 +694,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,if (!pi)return ICE_ERR_PARAM ; hw = pi->hw; + li_old = &pi->phy.link_info_old; li = &pi->phy.link_info; hw_fc_info = &pi->fc;
@@ -1130,6 +1131,7 @@ int ice_init_hw(struct ice_hw *hw) goto err_unroll_sched;/* Get MAC information */ +/* A single port can report up to two (LAN and WoL) addresses */ mac_buf =ice_calloc (hw,2 ,sizeof (struct ice_aqc_manage_mac_read_resp ));
@@ -1156,6 +1158,7 @@ int ice_init_hw(struct ice_hw *hw) status =ice_alloc_fd_res_cntr (hw, &hw->fd_ctr_base);if (status) goto err_unroll_fltr_mgmt_struct; + status =ice_init_hw_tbls (hw);if (status) goto err_unroll_fltr_mgmt_struct;
@@ -2088,7 +2091,7 @@ int ice_aq_q_shutdown(struct ice_hw *hw, bool unloading)* When attempting to acquire the Global Config Lock, the driver can * learn of three states: * 1) 0 - acquired lock, and can perform download package -* 2) ICE_ERR_AQ_ERROR - did not get lock, driver should fail to load +* 2) ICE_ERR_AQ_ERROR - did not get lock, driver should fail to load * 3) ICE_ERR_AQ_NO_WORK - did not get lock, but another driver has * successfully downloaded the package; the driver does * not have to download the package and can continue
@@ -3349,7 +3352,7 @@ void ice_clear_pxe_mode(struct ice_hw *hw) }/** -* ice_aq_set_port_params - set physical port parameters. +* ice_aq_set_port_params - set physical port parameters * @pi: pointer to the port info struct * @bad_frame_vsi: defines the VSI to which bad frames are forwarded * @save_bad_pac: if set packets with errors are forwarded to the bad frames VSI
@@ -3363,7 +3366,6 @@ int ice_aq_set_port_params(struct ice_port_info *pi, u16 bad_frame_vsi, bool save_bad_pac, bool pad_short_pac, bool double_vlan, struct ice_sq_cd *cd) - { struct ice_aqc_set_port_params *cmd;struct ice_hw *hw = pi->hw;
@@ -4463,7 +4465,6 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params cmd_resp->flags =CPU_TO_LE16 (flags); status =ice_aq_send_cmd (hw, &desc, lut, lut_size,NULL ); - params->lut_size =LE16_TO_CPU (desc.datalen);return status; }
drivers/net/ice/base/ice_common.h +0 -1
@@ -188,7 +188,6 @@ int ice_get_link_default_override(struct ice_link_default_override_tlv *ldo, struct ice_port_info *pi);bool ice_is_phy_caps_an_enabled (struct ice_aqc_get_phy_caps_data *caps); -enum ice_fc_mode ice_caps_to_fc_mode (u8 caps);enum ice_fec_mode ice_caps_to_fec_mode (u8 caps,u8 fec_options);int
drivers/net/ice/base/ice_controlq.c +4 -3
@@ -470,7 +470,7 @@ ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) }/** -* ice_aq_ver_check - Check the reported AQ API version. +* ice_aq_ver_check - Check the reported AQ API version * @hw: pointer to the hardware structure * * Checks if the driver should load on a given AQ API version.
@@ -658,8 +658,9 @@ static bool ice_is_sbq_supported(struct ice_hw *hw)* * NOTE: this function does not destroy the control queue locks. */ -static void ice_shutdown_ctrlq (struct ice_hw *hw,enum ice_ctl_q q_type, -bool unloading) +static void +ice_shutdown_ctrlq (struct ice_hw *hw,enum ice_ctl_q q_type, +bool unloading) {struct ice_ctl_q_info *cq;
drivers/net/ice/base/ice_controlq.h +0 -1
@@ -87,7 +87,6 @@ struct ice_sq_cd {struct ice_aq_desc *wb_desc; }; -/* rq event information */ struct ice_rq_event_info {struct ice_aq_desc desc;
drivers/net/ice/base/ice_ddp.c +1 -2
@@ -1037,7 +1037,6 @@ static enum ice_ddp_state ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver) (pkg_ver->major == ICE_PKG_SUPP_VER_MAJ && pkg_ver->minor < ICE_PKG_SUPP_VER_MNR))return ICE_DDP_PKG_FILE_VERSION_TOO_LOW ; -return ICE_DDP_PKG_SUCCESS ; }
@@ -2338,8 +2337,8 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)struct ice_pkg_hdr *pkg_hdr;enum ice_ddp_state state;u16 i, size =0 , offset; -int status;u32 reg =0 ; +int status;u8 flags;if (!buf || !len)
drivers/net/ice/base/ice_devids.h +4 -4
@@ -6,6 +6,8 @@#define _ICE_DEVIDS_H_/* Device IDs */ +#define ICE_DEV_ID_E822_SI_DFLT 0x1888 +/* Intel(R) Ethernet Connection E823-L for backplane */ #define ICE_DEV_ID_E823L_BACKPLANE 0x124C/* Intel(R) Ethernet Connection E823-L for SFP */ #define ICE_DEV_ID_E823L_SFP 0x124D
@@ -53,8 +55,6 @@/* Intel(R) Ethernet Controller E810-XXV for SFP */ #define ICE_DEV_ID_E810_XXV_SFP 0x159B/* Intel(R) Ethernet Connection E823-C for backplane */ -#define ICE_DEV_ID_E822_SI_DFLT 0x1888 -/* Intel(R) Ethernet Connection E823-L for backplane */ #define ICE_DEV_ID_E823C_BACKPLANE 0x188A/* Intel(R) Ethernet Connection E823-C for QSFP */ #define ICE_DEV_ID_E823C_QSFP 0x188B
@@ -87,9 +87,9 @@/* Intel(R) Ethernet Connection E825-C for backplane */ #define ICE_DEV_ID_E825C_BACKPLANE 0x579C/* Intel(R) Ethernet Connection E825-C for QSFP */ -#define ICE_DEV_ID_E825C_QSFP 0x579D +#define ICE_DEV_ID_E825C_QSFP 0x579D/* Intel(R) Ethernet Connection E825-C for SFP */ -#define ICE_DEV_ID_E825C_SFP 0x579E +#define ICE_DEV_ID_E825C_SFP 0x579E/* Intel(R) Ethernet Connection E825-C 1GbE */ #define ICE_DEV_ID_E825C_SGMII 0x579F#define ICE_DEV_ID_C825X 0x0DCD
drivers/net/ice/base/ice_fdir.c +13 -9
@@ -6,6 +6,7 @@#include "ice_fdir.h" /* These are training packet headers used to program flow director filters. */ +static const u8 ice_fdir_tcpv4_pkt[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x45 ,0x00 ,
@@ -3587,7 +3588,7 @@ int ice_get_fdir_cnt_all(struct ice_hw *hw) }/** -* ice_pkt_insert_ipv6_addr - insert a be32 IPv6 address into a memory buffer. +* ice_pkt_insert_ipv6_addr - insert a be32 IPv6 address into a memory buffer * @pkt: packet buffer * @offset: offset into buffer * @addr: IPv6 address to convert and insert into pkt at offset
@@ -3602,12 +3603,12 @@ static void ice_pkt_insert_ipv6_addr(u8 *pkt, int offset, __be32 *addr) }/** -* ice_pkt_insert_u6_qfi - insert a u6 value qfi into a memory buffer for gtpu +* ice_pkt_insert_u6_qfi - insert a u6 value QFI into a memory buffer for GTPU * @pkt: packet buffer * @offset: offset into buffer * @data: 8 bit value to convert and insert into pkt at offset * -* This function is designed for inserting qfi (6 bits) for gtpu. +* This function is designed for inserting QFI (6 bits) for GTPU. */ static void ice_pkt_insert_u6_qfi (u8 *pkt,int offset,u8 data) {
@@ -3618,7 +3619,7 @@ static void ice_pkt_insert_u6_qfi(u8 *pkt, int offset, u8 data) }/** -* ice_pkt_insert_u8 - insert a u8 value into a memory buffer. +* ice_pkt_insert_u8 - insert a u8 value into a memory buffer * @pkt: packet buffer * @offset: offset into buffer * @data: 8 bit value to convert and insert into pkt at offset
@@ -3629,7 +3630,7 @@ static void ice_pkt_insert_u8(u8 *pkt, int offset, u8 data) }/** -* ice_pkt_insert_u8_tc - insert a u8 value into a memory buffer for TC ipv6. +* ice_pkt_insert_u8_tc - insert a u8 value into a memory buffer for TC IPv6 * @pkt: packet buffer * @offset: offset into buffer * @data: 8 bit value to convert and insert into pkt at offset
@@ -3651,7 +3652,7 @@ static void ice_pkt_insert_u8_tc(u8 *pkt, int offset, u8 data) }/** -* ice_pkt_insert_u16 - insert a be16 value into a memory buffer. +* ice_pkt_insert_u16 - insert a be16 value into a memory buffer * @pkt: packet buffer * @offset: offset into buffer * @data: 16 bit value to convert and insert into pkt at offset
@@ -3662,7 +3663,7 @@ static void ice_pkt_insert_u16(u8 *pkt, int offset, __be16 data) }/** -* ice_pkt_insert_u32 - insert a be32 value into a memory buffer. +* ice_pkt_insert_u32 - insert a be32 value into a memory buffer * @pkt: packet buffer * @offset: offset into buffer * @data: 32 bit value to convert and insert into pkt at offset
@@ -3673,7 +3674,7 @@ static void ice_pkt_insert_u32(u8 *pkt, int offset, __be32 data) }/** -* ice_pkt_insert_mac_addr - insert a MAC addr into a memory buffer. +* ice_pkt_insert_mac_addr - insert a MAC addr into a memory buffer * @pkt: packet buffer * @addr: MAC address to convert and insert into pkt at offset */
@@ -4101,7 +4102,8 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,ice_pkt_insert_u8 (loc,ICE_IPV4_TOS_OFFSET , input->ip.v4.tos);ice_pkt_insert_u8 (loc,ICE_IPV4_TTL_OFFSET , input->ip.v4.ttl);ice_pkt_insert_mac_addr (loc, input->ext_data.dst_mac); -ice_pkt_insert_mac_addr (loc +ETH_ALEN , input->ext_data.src_mac); +ice_pkt_insert_mac_addr (loc +ETH_ALEN , + input->ext_data.src_mac);break ;case ICE_FLTR_PTYPE_NONF_IPV4_SCTP : ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET,
@@ -4223,6 +4225,8 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->ip.v4.dst_ip);ice_pkt_insert_u8 (loc,ICE_IPV4_TOS_OFFSET , input->ip.v4.tos);ice_pkt_insert_u8 (loc,ICE_IPV4_TTL_OFFSET , input->ip.v4.ttl); +ice_pkt_insert_u8 (loc,ICE_IPV4_PROTO_OFFSET , + input->ip.v4.proto);ice_pkt_insert_mac_addr (loc, input->ext_data.dst_mac);ice_pkt_insert_mac_addr (loc +ETH_ALEN , input->ext_data.src_mac);
drivers/net/ice/base/ice_flex_pipe.c +54 -52
146 lines not on this page · raw message
drivers/net/ice/base/ice_flex_type.h +0 -1
@@ -643,7 +643,6 @@ struct ice_prof_tcam_entry {u8 key[ICE_TCAM_KEY_SZ ];u8 prof_id; }; -#pragma pack()struct ice_prof_id_section {
drivers/net/ice/base/ice_flow.c +45 -46
238 lines not on this page · raw message
drivers/net/ice/base/ice_flow.h +8 -9
@@ -371,14 +371,14 @@ enum ice_flow_avf_hdr_field {enum ice_rss_cfg_hdr_type {ICE_RSS_OUTER_HEADERS ,/* take outer headers as inputset. */ ICE_RSS_INNER_HEADERS ,/* take inner headers as inputset. */ -/* take inner headers as inputset for packet with outer ipv4. */ +/* take inner headers as inputset for packet with outer IPv4. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV4 , -/* take inner headers as inputset for packet with outer ipv6. */ +/* take inner headers as inputset for packet with outer IPv6. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV6 ,/* take outer headers first then inner headers as inputset */ -/* take inner as inputset for GTPoGRE with outer ipv4 + gre. */ +/* take inner as inputset for GTPoGRE with outer IPv4 + GRE. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV4_GRE , -/* take inner as inputset for GTPoGRE with outer ipv6 + gre. */ +/* take inner as inputset for GTPoGRE with outer IPv6 + GRE. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV6_GRE ,ICE_RSS_ANY_HEADERS };
@@ -576,16 +576,15 @@ int ice_flow_assoc_prof(struct ice_hw *hw, enum ice_block blk, struct ice_flow_prof *prof, u16 vsi_handle);int -ice_flow_assoc_vsig_vsi (struct ice_hw *hw,enum ice_block blk,u16 vsi_handle, -u16 vsig); -int ice_flow_set_hw_prof (struct ice_hw *hw,u16 dest_vsi_handle,u16 fdir_vsi_handle,struct ice_parser_profile *prof,enum ice_block blk);int +ice_flow_assoc_vsig_vsi (struct ice_hw *hw,enum ice_block blk,u16 vsi_handle, +u16 vsig); +int ice_flow_get_hw_prof (struct ice_hw *hw,enum ice_block blk,u64 prof_id,u8 *hw_prof); -u64 ice_flow_find_entry (struct ice_hw *hw,enum ice_block blk,u64 entry_id); int ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id,
@@ -604,7 +603,7 @@ void ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len, u16 val_loc, u16 mask_loc);int ice_flow_rem_vsi_prof (struct ice_hw *hw,enum ice_block blk, -u16 vsi_handle,u64 prof_id); +u16 vsi_handle,u64 prof_id);void ice_rem_vsi_rss_list (struct ice_hw *hw,u16 vsi_handle);int ice_replay_rss_cfg (struct ice_hw *hw,u16 vsi_handle);int
drivers/net/ice/base/ice_hw_autogen.h +1 -1
@@ -22,6 +22,7 @@#define GLNVM_FLA 0x000B6108#define GL_HIDA_MAX_INDEX 15#define GL_HIBA_MAX_INDEX 1023 +#define GL_MNG_FWSM_FW_LOADING_M BIT(30)#define GL_RDPU_CNTRL 0x00052054/* Reset Source: CORER */ #define GL_RDPU_CNTRL_RX_PAD_EN_S 0#define GL_RDPU_CNTRL_RX_PAD_EN_M BIT(0)
@@ -5533,7 +5534,6 @@#define GL_MNG_FW_RAM_STAT_MNG_MEM_ECC_ERR_S 1#define GL_MNG_FW_RAM_STAT_MNG_MEM_ECC_ERR_M BIT(1)#define GL_MNG_FWSM 0x000B6134/* Reset Source: POR */ -#define GL_MNG_FWSM_FW_LOADING_M BIT(30)#define GL_MNG_FWSM_FW_MODES_S 0#define GL_MNG_FWSM_FW_MODES_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_GL_MNG_FWSM_FW_MODES_M : E800_GL_MNG_FWSM_FW_MODES_M)#define E800_GL_MNG_FWSM_FW_MODES_M MAKEMASK(0x7, 0)
drivers/net/ice/base/ice_lan_tx_rx.h +2 -1
@@ -920,7 +920,8 @@ enum ice_rx_flex_desc_exstat_bits { ICE_RX_FLEX_DESC_EXSTAT_OVERSIZE_S = 3, }; -/* For ice_32b_rx_flex_desc.ts_low: +/* +* For ice_32b_rx_flex_desc.ts_low: * [0]: Timestamp-low validity bit * [1:7]: Timestamp-low value */
drivers/net/ice/base/ice_nvm.c +7 -12
@@ -125,8 +125,7 @@ ice_read_flat_nvm(struct ice_hw *hw, u32 offset, u32 *length, u8 *data,* * Reads one 16 bit word from the Shadow RAM using ice_read_flat_nvm. */ -static int -ice_read_sr_word_aq (struct ice_hw *hw,u16 offset,u16 *data) +static int ice_read_sr_word_aq (struct ice_hw *hw,u16 offset,u16 *data) {u32 bytes =sizeof (u16);__le16 data_local;
@@ -535,8 +534,7 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len,* * Reads the part number string from the NVM. */ -int -ice_read_pba_string (struct ice_hw *hw,u8 *pba_num,u32 pba_num_size) +int ice_read_pba_string (struct ice_hw *hw,u8 *pba_num,u32 pba_num_size) {u16 pba_tlv, pba_tlv_len;u16 pba_word, pba_size;
@@ -620,7 +618,7 @@ static int ice_get_nvm_srev(struct ice_hw *hw, enum ice_bank_select bank, u32 *s* @nvm: pointer to NVM info structure * * Read the NVM EETRACK ID and map version of the main NVM image bank, filling -* in the nvm info structure. +* in the NVM info structure. */ static int ice_get_nvm_ver_info (struct ice_hw *hw,enum ice_bank_select bank,struct ice_nvm_info *nvm)
@@ -845,7 +843,7 @@ int ice_get_inactive_orom_ver(struct ice_hw *hw, struct ice_orom_info *orom) }/** -* ice_discover_flash_size - Discover the available flash size. +* ice_discover_flash_size - Discover the available flash size * @hw: pointer to the HW struct * * The device flash could be up to 16MB in size. However, it is possible that
@@ -909,8 +907,7 @@ static int ice_discover_flash_size(struct ice_hw *hw)* sector size by using the highest bit. The reported pointer value will be in * bytes, intended for flat NVM reads. */ -static int -ice_read_sr_pointer (struct ice_hw *hw,u16 offset,u32 *pointer) +static int ice_read_sr_pointer (struct ice_hw *hw,u16 offset,u32 *pointer) {int status;u16 value;
@@ -941,8 +938,7 @@ ice_read_sr_pointer(struct ice_hw *hw, u16 offset, u32 *pointer)* Each area size word is specified in 4KB sector units. This function reports * the size in bytes, intended for flat NVM reads. */ -static int -ice_read_sr_area_size (struct ice_hw *hw,u16 offset,u32 *size) +static int ice_read_sr_area_size (struct ice_hw *hw,u16 offset,u32 *size) {int status;u16 value;
@@ -967,8 +963,7 @@ ice_read_sr_area_size(struct ice_hw *hw, u16 offset, u32 *size)* structure for later use in order to calculate the correct offset to read * from the active module. */ -static int -ice_determine_active_flash_banks (struct ice_hw *hw) +static int ice_determine_active_flash_banks (struct ice_hw *hw) {struct ice_bank_info *banks = &hw->flash.banks;u16 ctrl_word;
drivers/net/ice/base/ice_nvm.h +0 -1
@@ -34,7 +34,6 @@ struct ice_orom_civd_info {u8 combo_name_len;/* Length of the unicode combo image version string, max of 32 */ __le16 combo_name[32 ];/* Unicode string representing the Combo Image version */ }; -#pragma pack()#define ICE_NVM_ACCESS_MAJOR_VER 0
drivers/net/ice/base/ice_parser.c +10 -10
@@ -310,7 +310,7 @@ void ice_parser_destroy(struct ice_parser *psr)* @rslt: input/output parameter to save parser result. */ int ice_parser_run (struct ice_parser *psr,const u8 *pkt_buf, -int pkt_len,struct ice_parser_result *rslt) +int pkt_len,struct ice_parser_result *rslt) {ice_parser_rt_reset (&psr->rt);ice_parser_rt_pktbuf_set (&psr->rt, pkt_buf, pkt_len);
@@ -341,10 +341,10 @@ void ice_parser_result_dump(struct ice_hw *hw, struct ice_parser_result *rslt)static void _bst_vm_set (struct ice_parser *psr,const char *prefix,bool on) { -struct ice_bst_tcam_item *item;u16 i =0 ;while (true) { +struct ice_bst_tcam_item *item; item =ice_bst_tcam_search (psr->bst_tcam_table, psr->bst_lbl_table, prefix, &i);
@@ -372,10 +372,10 @@ _tunnel_port_set(struct ice_parser *psr, const char *prefix, u16 udp_port, bool on) {u8 *buf = (u8 *)&udp_port; -struct ice_bst_tcam_item *item;u16 i =0 ;while (true) { +struct ice_bst_tcam_item *item; item =ice_bst_tcam_search (psr->bst_tcam_table, psr->bst_lbl_table, prefix, &i);
@@ -413,7 +413,7 @@ _tunnel_port_set(struct ice_parser *psr, const char *prefix, u16 udp_port,* @on: true to turn on; false to turn off */ int ice_parser_vxlan_tunnel_set (struct ice_parser *psr, -u16 udp_port,bool on) +u16 udp_port,bool on) {return _tunnel_port_set (psr,"TNL_VXLAN" , udp_port, on); }
@@ -425,7 +425,7 @@ int ice_parser_vxlan_tunnel_set(struct ice_parser *psr,* @on: true to turn on; false to turn off */ int ice_parser_geneve_tunnel_set (struct ice_parser *psr, -u16 udp_port,bool on) +u16 udp_port,bool on) {return _tunnel_port_set (psr,"TNL_GENEVE" , udp_port, on); }
@@ -437,7 +437,7 @@ int ice_parser_geneve_tunnel_set(struct ice_parser *psr,* @on: true to turn on; false to turn off */ int ice_parser_ecpri_tunnel_set (struct ice_parser *psr, -u16 udp_port,bool on) +u16 udp_port,bool on) {return _tunnel_port_set (psr,"TNL_UDP_ECPRI" , udp_port, on); }
@@ -486,10 +486,10 @@ static bool _nearest_proto_id(struct ice_parser_result *rslt, u16 offset,* @prof: input/output parameter to save the profile */ int ice_parser_profile_init (struct ice_parser_result *rslt, -const u8 *pkt_buf,const u8 *msk_buf, -int buf_len,enum ice_block blk, -bool prefix_match, -struct ice_parser_profile *prof) +const u8 *pkt_buf,const u8 *msk_buf, +int buf_len,enum ice_block blk, +bool prefix_match, +struct ice_parser_profile *prof) {u8 proto_id =0xff ;u16 proto_off =0 ;
drivers/net/ice/base/ice_parser.h +9 -9
@@ -59,11 +59,11 @@ int ice_parser_create(struct ice_hw *hw, struct ice_parser **psr);void ice_parser_destroy (struct ice_parser *psr);void ice_parser_dvm_set (struct ice_parser *psr,bool on);int ice_parser_vxlan_tunnel_set (struct ice_parser *psr, -u16 udp_port,bool on); +u16 udp_port,bool on);int ice_parser_geneve_tunnel_set (struct ice_parser *psr, -u16 udp_port,bool on); +u16 udp_port,bool on);int ice_parser_ecpri_tunnel_set (struct ice_parser *psr, -u16 udp_port,bool on); +u16 udp_port,bool on);struct ice_parser_proto_off {u8 proto_id;/* hardware protocol ID */
@@ -84,7 +84,7 @@ struct ice_parser_result { };int ice_parser_run (struct ice_parser *psr,const u8 *pkt_buf, -int pkt_len,struct ice_parser_result *rslt); +int pkt_len,struct ice_parser_result *rslt);void ice_parser_result_dump (struct ice_hw *hw,struct ice_parser_result *rslt);struct ice_parser_fv {
@@ -95,7 +95,7 @@ struct ice_parser_fv { };struct ice_parser_profile { -struct ice_parser_fv fv[48 ];/* field vector array */ +struct ice_parser_fv fv[48 ];/* field vector arrary */ int fv_num;/* field vector number must <= 48 */ u16 flags;/* 16 bits key builder flag */ u16 flags_msk;/* key builder flag masker */
@@ -104,10 +104,10 @@ struct ice_parser_profile { };int ice_parser_profile_init (struct ice_parser_result *rslt, -const u8 *pkt_buf,const u8 *msk_buf, -int buf_len,enum ice_block blk, -bool prefix_match, -struct ice_parser_profile *prof); +const u8 *pkt_buf,const u8 *msk_buf, +int buf_len,enum ice_block blk, +bool prefix_match, +struct ice_parser_profile *prof);void ice_parser_profile_dump (struct ice_hw *hw,struct ice_parser_profile *prof); bool ice_check_ddp_support_proto_id(struct ice_hw *hw,
drivers/net/ice/base/ice_parser_rt.c +11 -11
@@ -346,7 +346,7 @@ static void _bst_pgp_set(struct ice_parser_rt *rt, rt->pg, bst->address); } -static struct ice_pg_cam_item *_pg_cam_match (struct ice_parser_rt *rt) +static struct ice_pg_cam_item *__pg_cam_match (struct ice_parser_rt *rt) {struct ice_parser *psr = rt->psr;struct ice_pg_cam_item *item;
@@ -361,7 +361,7 @@ static struct ice_pg_cam_item *_pg_cam_match(struct ice_parser_rt *rt)return item; } -static struct ice_pg_nm_cam_item *_pg_nm_cam_match (struct ice_parser_rt *rt) +static struct ice_pg_nm_cam_item *__pg_nm_cam_match (struct ice_parser_rt *rt) {struct ice_parser *psr = rt->psr;struct ice_pg_nm_cam_item *item;
@@ -411,9 +411,8 @@ static void _flg_add(struct ice_parser_rt *rt, int idx, bool val)static void _flg_update (struct ice_parser_rt *rt,struct ice_alu *alu) { -int i; -if (alu->dedicate_flags_ena) { +int i;if (alu->flags_extr_imm) {for (i =0 ; i < alu->dst_len; i++) _flg_add(rt, alu->dst_start + i,
@@ -653,12 +652,12 @@ static void _alu_pg_exe(struct ice_parser_rt *rt)static void _proto_off_update (struct ice_parser_rt *rt) {struct ice_parser *psr = rt->psr; -int i;if (rt->action->is_pg) {struct ice_proto_grp_item *proto_grp = &psr->proto_grp_table[rt->action->proto_id];u16 po; +int i;for (i =0 ; i <8 ; i++) {struct ice_proto_off *entry = &proto_grp->po[i];
@@ -696,11 +695,11 @@ static void _marker_set(struct ice_parser_rt *rt, int idx)static void _marker_update (struct ice_parser_rt *rt) {struct ice_parser *psr = rt->psr; -int i;if (rt->action->is_mg) {struct ice_mk_grp_item *mk_grp = &psr->mk_grp_table[rt->action->marker_id]; +int i;for (i =0 ; i <8 ; i++) {u8 marker = mk_grp->markers[i];
@@ -771,13 +770,11 @@ static void _result_resolve(struct ice_parser_rt *rt,* @rslt: input/output parameter to save parser result */ int ice_parser_rt_execute (struct ice_parser_rt *rt, -struct ice_parser_result *rslt) +struct ice_parser_result *rslt) {struct ice_pg_nm_cam_item *pg_nm_cam;struct ice_parser *psr = rt->psr;struct ice_pg_cam_item *pg_cam; -struct ice_bst_tcam_item *bst; -struct ice_imem_item *imem;int status =0 ;u16 node;u16 pc;
@@ -786,6 +783,9 @@ int ice_parser_rt_execute(struct ice_parser_rt *rt,ice_debug (rt->psr->hw,ICE_DBG_PARSER ,"Start with Node: %d\n" , node);while (true) { +struct ice_bst_tcam_item *bst; +struct ice_imem_item *imem; + pc = rt->gpr[GPR_NP_IDX ]; imem = &psr->imem_table[pc]; ice_debug(rt->psr->hw, ICE_DBG_PARSER, "Load imem at pc: %d\n",
@@ -829,9 +829,9 @@ int ice_parser_rt_execute(struct ice_parser_rt *rt, } rt->action =NULL ; - pg_cam =_pg_cam_match (rt); + pg_cam =__pg_cam_match (rt);if (!pg_cam) { - pg_nm_cam =_pg_nm_cam_match (rt); + pg_nm_cam =__pg_nm_cam_match (rt);if (pg_nm_cam) {ice_debug (rt->psr->hw,ICE_DBG_PARSER ,"Match ParseGraph Nomatch CAM Address %d\n" , pg_nm_cam->idx);
drivers/net/ice/base/ice_parser_rt.h +1 -1
@@ -49,5 +49,5 @@ void ice_parser_rt_pktbuf_set(struct ice_parser_rt *rt, const u8 *pkt_buf,struct ice_parser_result ;int ice_parser_rt_execute (struct ice_parser_rt *rt, -struct ice_parser_result *rslt); +struct ice_parser_result *rslt);#endif /* _ICE_PARSER_RT_H_ */
drivers/net/ice/base/ice_protocol_type.h +6 -5
@@ -98,6 +98,10 @@ enum ice_sw_tunnel_type {ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP ,ICE_SW_TUN_IPV6_GTPU_IPV6_TCP ,ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP , +ICE_SW_TUN_IPV4_GTPU_IPV4 , +ICE_SW_TUN_IPV4_GTPU_IPV6 , +ICE_SW_TUN_IPV6_GTPU_IPV4 , +ICE_SW_TUN_IPV6_GTPU_IPV6 ,ICE_SW_TUN_PPPOE ,ICE_SW_TUN_PPPOE_PAY , ICE_SW_TUN_PPPOE_IPV4,
@@ -128,10 +132,6 @@ enum ice_sw_tunnel_type {ICE_SW_TUN_PPPOE_PAY_QINQ ,ICE_SW_TUN_PPPOE_IPV4_QINQ ,ICE_SW_TUN_PPPOE_IPV6_QINQ , -ICE_SW_TUN_IPV4_GTPU_IPV4 , -ICE_SW_TUN_IPV4_GTPU_IPV6 , -ICE_SW_TUN_IPV6_GTPU_IPV4 , -ICE_SW_TUN_IPV6_GTPU_IPV6 ,ICE_SW_TUN_GTP_IPV4 ,ICE_SW_TUN_GTP_IPV6 ,ICE_ALL_TUNNELS /* All tunnel types including NVGRE */
@@ -223,7 +223,8 @@ enum ice_prot_id {#define ICE_MDID_SIZE 2#define ICE_TUN_FLAG_MDID 20 -#define ICE_TUN_FLAG_MDID_OFF (word) (ICE_MDID_SIZE * (ICE_TUN_FLAG_MDID + (word))) +#define ICE_TUN_FLAG_MDID_OFF (word) \ + (ICE_MDID_SIZE * (ICE_TUN_FLAG_MDID + (word)))#define ICE_TUN_FLAG_MASK 0xFF#define ICE_FROM_NETWORK_FLAG_MASK 0x8#define ICE_DIR_FLAG_MASK 0x10
drivers/net/ice/base/ice_ptp_consts.h +2 -1
@@ -157,7 +157,8 @@ const struct ice_cgu_pll_params_e822 e822_cgu_params[NUM_ICE_TIME_REF_FREQ] = { }, }; -/* struct ice_vernier_info_e822 +/* +* struct ice_vernier_info_e822 * * E822 hardware calibrates the delay of the timestamp indication from the * actual packet transmission or reception during the initialization of the
drivers/net/ice/base/ice_ptp_hw.c +61 -45
285 lines not on this page · raw message
drivers/net/ice/base/ice_sched.h +5 -5
@@ -101,6 +101,10 @@ int ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req, struct ice_aqc_txsched_elem_data *buf, u16 buf_size, u16 *elems_ret, struct ice_sq_cd *cd); + +int +ice_sched_set_node_bw_lmt (struct ice_port_info *pi,struct ice_sched_node *node, +enum ice_rl_type rl_type,u32 bw);int ice_sched_init_port (struct ice_port_info *pi);int ice_sched_query_res_alloc (struct ice_hw *hw);void ice_sched_get_psm_clk_freq (struct ice_hw *hw);
@@ -235,11 +239,7 @@ void ice_sched_replay_agg(struct ice_hw *hw);int ice_sched_replay_tc_node_bw (struct ice_port_info *pi);int ice_replay_vsi_agg (struct ice_hw *hw,u16 vsi_handle);int ice_sched_replay_root_node_bw (struct ice_port_info *pi); -int -ice_sched_replay_q_bw (struct ice_port_info *pi,struct ice_q_ctx *q_ctx); -int -ice_sched_set_node_bw_lmt (struct ice_port_info *pi,struct ice_sched_node *node, -enum ice_rl_type rl_type,u32 bw); +int ice_sched_replay_q_bw (struct ice_port_info *pi,struct ice_q_ctx *q_ctx);int ice_sched_cfg_node_bw_alloc (struct ice_hw *hw,struct ice_sched_node *node,enum ice_rl_type rl_type,u16 bw_alloc);
drivers/net/ice/base/ice_switch.c +62 -60
219 lines not on this page · raw message
drivers/net/ice/base/ice_switch.h +5 -4
@@ -15,7 +15,7 @@#define ICE_FLTR_RX BIT(0)#define ICE_FLTR_TX BIT(1)#define ICE_FLTR_RX_LB BIT(2) -#define ICE_FLTR_TX_RX (ICE_FLTR_RX | ICE_FLTR_TX) +#define ICE_FLTR_TX_RX (ICE_FLTR_RX | ICE_FLTR_TX)/* Switch Profile IDs for Profile related switch rules */ #define ICE_PROFID_IPV4_TCP 4
@@ -254,6 +254,7 @@ union lg_act_entry {struct entry_generic_act generic_act;struct entry_statistics statistics; }; +struct ice_prof_type_entry {u16 prof_id;enum ice_sw_tunnel_type type;
@@ -289,7 +290,8 @@ struct ice_rule_query_data {u16 vsi_handle; }; -/* This structure allows to pass info about lb_en and lan_en +/* +* This structure allows to pass info about lb_en and lan_en * flags to ice_add_adv_rule. Values in act would be used * only if act_valid was set to true, otherwise dflt * values would be used.
@@ -507,8 +509,7 @@ ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries, bool res_shared, u16 *desc_id, struct ice_sq_cd *cd);int ice_add_vlan (struct ice_hw *hw,struct LIST_HEAD_TYPE *m_list); -int -ice_remove_vlan (struct ice_hw *hw,struct LIST_HEAD_TYPE *v_list); +int ice_remove_vlan (struct ice_hw *hw,struct LIST_HEAD_TYPE *v_list);void ice_rem_all_sw_rules_info (struct ice_hw *hw);int ice_add_mac (struct ice_hw *hw,struct LIST_HEAD_TYPE *m_lst);int ice_remove_mac (struct ice_hw *hw,struct LIST_HEAD_TYPE *m_lst);
drivers/net/ice/base/ice_type.h +1 -2
@@ -1323,7 +1323,6 @@ struct ice_hw { void *buf, u16 buf_size);void *aq_send_cmd_param;u8 dcf_enabled;/* Device Config Function */ -u8 api_branch;/* API branch version */ u8 api_maj_ver;/* API major version */ u8 api_min_ver;/* API minor version */
@@ -1395,6 +1394,7 @@ struct ice_hw {/* tunneling info */ struct ice_lock tnl_lock;struct ice_tunnel_table tnl; +/* dvm boost update information */ struct ice_dvm_table dvm_upd;
@@ -1679,7 +1679,6 @@ struct ice_aq_get_set_rss_lut_params {/* AQ API version for report default configuration */ #define ICE_FW_API_REPORT_DFLT_CFG_MAJ 1#define ICE_FW_API_REPORT_DFLT_CFG_MIN 7 -#define ICE_FW_API_REPORT_DFLT_CFG_PATCH 3/* FW branch number for hardware families */
drivers/net/ice/base/ice_xlt_kb.c +2 -2
@@ -24,7 +24,7 @@ static void _xlt_kb_entry_dump(struct ice_hw *hw, }/** -* ice_imem_dump - dump a xlt key build info +* ice_xlt_kb_dump - dump a xlt key build info * @hw: pointer to the hardware structure * @kb: key build to dump */
@@ -180,7 +180,7 @@ struct ice_xlt_kb *ice_xlt_kb_get_fd(struct ice_hw *hw) }/** -* ice_xlt_kb_get_fd - create rss xlt key build +* ice_xlt_kb_get_rss - create rss xlt key build * @hw: pointer to the hardware structure */ struct ice_xlt_kb *ice_xlt_kb_get_rss (struct ice_hw *hw)
Signature · 1 line
2.43.0
PATCH v2 124/148 net/ice/base: use const char* array for storing link modes
In reply to Anatoly BurakovThis shortens the amount of code needed to do the same thing.
--- drivers/net/ice/base/ice_common.c | 133 +++++++----------------------- 1 file changed, 28 insertions(+), 105 deletions(-)
drivers/net/ice/base/ice_common.c +28 -105
@@ -98,117 +98,34 @@ static const char * const ice_link_mode_str_high[] = { };/** -* dump_phy_type - helper function that prints PHY type strings -* @hw: pointer to the HW structure -* @phy: 64 bit PHY type to decipher -* @i: bit index within phy -* @phy_string: string corresponding to bit i in phy -* @prefix: prefix string to differentiate multiple dumps -*/ -static void -dump_phy_type (struct ice_hw *hw,u64 phy,u8 i,const char *phy_string, -const char *prefix) -{ -if (phy &BIT_ULL (i)) -ice_debug (hw,ICE_DBG_PHY ,"%s: bit(%d): %s\n" , prefix, i, - phy_string); -} - -/** -* ice_dump_phy_type_low - helper function to dump phy_type_low +* ice_dump_phy_type - helper function to dump phy_type * @hw: pointer to the HW structure * @low: 64 bit value for phy_type_low +* @high: 64 bit value for phy_type_high * @prefix: prefix string to differentiate multiple dumps */ static void -ice_dump_phy_type_low (struct ice_hw *hw,u64 low,const char *prefix) +ice_dump_phy_type (struct ice_hw *hw,u64 low,u64 high,const char *prefix) { +u32 i; +ice_debug (hw,ICE_DBG_PHY ,"%s: phy_type_low: 0x%016llx\n" , prefix, (unsigned long long )low); -dump_phy_type (hw, low,0 ,"100BASE_TX" , prefix); -dump_phy_type (hw, low,1 ,"100M_SGMII" , prefix); -dump_phy_type (hw, low,2 ,"1000BASE_T" , prefix); -dump_phy_type (hw, low,3 ,"1000BASE_SX" , prefix); -dump_phy_type (hw, low,4 ,"1000BASE_LX" , prefix); -dump_phy_type (hw, low,5 ,"1000BASE_KX" , prefix); -dump_phy_type (hw, low,6 ,"1G_SGMII" , prefix); -dump_phy_type (hw, low,7 ,"2500BASE_T" , prefix); -dump_phy_type (hw, low,8 ,"2500BASE_X" , prefix); -dump_phy_type (hw, low,9 ,"2500BASE_KX" , prefix); -dump_phy_type (hw, low,10 ,"5GBASE_T" , prefix); -dump_phy_type (hw, low,11 ,"5GBASE_KR" , prefix); -dump_phy_type (hw, low,12 ,"10GBASE_T" , prefix); -dump_phy_type (hw, low,13 ,"10G_SFI_DA" , prefix); -dump_phy_type (hw, low,14 ,"10GBASE_SR" , prefix); -dump_phy_type (hw, low,15 ,"10GBASE_LR" , prefix); -dump_phy_type (hw, low,16 ,"10GBASE_KR_CR1" , prefix); -dump_phy_type (hw, low,17 ,"10G_SFI_AOC_ACC" , prefix); -dump_phy_type (hw, low,18 ,"10G_SFI_C2C" , prefix); -dump_phy_type (hw, low,19 ,"25GBASE_T" , prefix); -dump_phy_type (hw, low,20 ,"25GBASE_CR" , prefix); -dump_phy_type (hw, low,21 ,"25GBASE_CR_S" , prefix); -dump_phy_type (hw, low,22 ,"25GBASE_CR1" , prefix); -dump_phy_type (hw, low,23 ,"25GBASE_SR" , prefix); -dump_phy_type (hw, low,24 ,"25GBASE_LR" , prefix); -dump_phy_type (hw, low,25 ,"25GBASE_KR" , prefix); -dump_phy_type (hw, low,26 ,"25GBASE_KR_S" , prefix); -dump_phy_type (hw, low,27 ,"25GBASE_KR1" , prefix); -dump_phy_type (hw, low,28 ,"25G_AUI_AOC_ACC" , prefix); -dump_phy_type (hw, low,29 ,"25G_AUI_C2C" , prefix); -dump_phy_type (hw, low,30 ,"40GBASE_CR4" , prefix); -dump_phy_type (hw, low,31 ,"40GBASE_SR4" , prefix); -dump_phy_type (hw, low,32 ,"40GBASE_LR4" , prefix); -dump_phy_type (hw, low,33 ,"40GBASE_KR4" , prefix); -dump_phy_type (hw, low,34 ,"40G_XLAUI_AOC_ACC" , prefix); -dump_phy_type (hw, low,35 ,"40G_XLAUI" , prefix); -dump_phy_type (hw, low,36 ,"50GBASE_CR2" , prefix); -dump_phy_type (hw, low,37 ,"50GBASE_SR2" , prefix); -dump_phy_type (hw, low,38 ,"50GBASE_LR2" , prefix); -dump_phy_type (hw, low,39 ,"50GBASE_KR2" , prefix); -dump_phy_type (hw, low,40 ,"50G_LAUI2_AOC_ACC" , prefix); -dump_phy_type (hw, low,41 ,"50G_LAUI2" , prefix); -dump_phy_type (hw, low,42 ,"50G_AUI2_AOC_ACC" , prefix); -dump_phy_type (hw, low,43 ,"50G_AUI2" , prefix); -dump_phy_type (hw, low,44 ,"50GBASE_CP" , prefix); -dump_phy_type (hw, low,45 ,"50GBASE_SR" , prefix); -dump_phy_type (hw, low,46 ,"50GBASE_FR" , prefix); -dump_phy_type (hw, low,47 ,"50GBASE_LR" , prefix); -dump_phy_type (hw, low,48 ,"50GBASE_KR_PAM4" , prefix); -dump_phy_type (hw, low,49 ,"50G_AUI1_AOC_ACC" , prefix); -dump_phy_type (hw, low,50 ,"50G_AUI1" , prefix); -dump_phy_type (hw, low,51 ,"100GBASE_CR4" , prefix); -dump_phy_type (hw, low,52 ,"100GBASE_SR4" , prefix); -dump_phy_type (hw, low,53 ,"100GBASE_LR4" , prefix); -dump_phy_type (hw, low,54 ,"100GBASE_KR4" , prefix); -dump_phy_type (hw, low,55 ,"100G_CAUI4_AOC_ACC" , prefix); -dump_phy_type (hw, low,56 ,"100G_CAUI4" , prefix); -dump_phy_type (hw, low,57 ,"100G_AUI4_AOC_ACC" , prefix); -dump_phy_type (hw, low,58 ,"100G_AUI4" , prefix); -dump_phy_type (hw, low,59 ,"100GBASE_CR_PAM4" , prefix); -dump_phy_type (hw, low,60 ,"100GBASE_KR_PAM4" , prefix); -dump_phy_type (hw, low,61 ,"100GBASE_CP2" , prefix); -dump_phy_type (hw, low,62 ,"100GBASE_SR2" , prefix); -dump_phy_type (hw, low,63 ,"100GBASE_DR" , prefix); -} +for (i =0 ; i <ARRAY_SIZE (ice_link_mode_str_low); i++) { +if (low &BIT_ULL (i)) +ice_debug (hw,ICE_DBG_PHY ,"%s: bit(%d): %s\n" , + prefix, i, ice_link_mode_str_low[i]); + } -/** -* ice_dump_phy_type_high - helper function to dump phy_type_high -* @hw: pointer to the HW structure -* @high: 64 bit value for phy_type_high -* @prefix: prefix string to differentiate multiple dumps -*/ -static void -ice_dump_phy_type_high (struct ice_hw *hw,u64 high,const char *prefix) -{ice_debug (hw,ICE_DBG_PHY ,"%s: phy_type_high: 0x%016llx\n" , prefix, (unsigned long long )high); -dump_phy_type (hw, high,0 ,"100GBASE_KR2_PAM4" , prefix); -dump_phy_type (hw, high,1 ,"100G_CAUI2_AOC_ACC" , prefix); -dump_phy_type (hw, high,2 ,"100G_CAUI2" , prefix); -dump_phy_type (hw, high,3 ,"100G_AUI2_AOC_ACC" , prefix); -dump_phy_type (hw, high,4 ,"100G_AUI2" , prefix); +for (i =0 ; i <ARRAY_SIZE (ice_link_mode_str_high); i++) { +if (high &BIT_ULL (i)) +ice_debug (hw,ICE_DBG_PHY ,"%s: bit(%d): %s\n" , + prefix, i, ice_link_mode_str_high[i]); + } }/**
@@ -602,19 +519,25 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,ice_debug (hw,ICE_DBG_LINK ,"get phy caps dump\n" ); -if (report_mode ==ICE_AQC_REPORT_TOPO_CAP_MEDIA ) +switch (report_mode) { +case ICE_AQC_REPORT_TOPO_CAP_MEDIA : prefix ="phy_caps_media" ; -else if (report_mode ==ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA ) +break ; +case ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA : prefix ="phy_caps_no_media" ; -else if (report_mode ==ICE_AQC_REPORT_ACTIVE_CFG ) +break ; +case ICE_AQC_REPORT_ACTIVE_CFG : prefix ="phy_caps_active" ; -else if (report_mode ==ICE_AQC_REPORT_DFLT_CFG ) +break ; +case ICE_AQC_REPORT_DFLT_CFG : prefix ="phy_caps_default" ; -else +break ; +default : prefix ="phy_caps_invalid" ; + } -ice_dump_phy_type_low (hw,LE64_TO_CPU (pcaps->phy_type_low), prefix); -ice_dump_phy_type_high (hw,LE64_TO_CPU (pcaps->phy_type_high), prefix); +ice_dump_phy_type (hw,LE64_TO_CPU (pcaps->phy_type_low), +LE64_TO_CPU (pcaps->phy_type_high), prefix);ice_debug (hw,ICE_DBG_LINK ,"%s: report_mode = 0x%x\n" , prefix, report_mode);
Signature · 1 line
2.43.0
Re: [PATCH v2 124/148] net/ice/base: use const char* array for storing link modes
Quoted 8 lines · Anatoly Burakov
This shortens the amount of code needed to do the same thing.
Signed-off-by Lukasz Plachno <[email protected]>Signed-off-by Anatoly Burakov <[email protected]>--- drivers/net/ice/base/ice_common.c | 133 +++++++----------------------- 1 file changed, 28 insertions(+), 105 deletions(-)
I think this patch can be squashed with patch 116.
/Bruce
PATCH v2 125/148 net/ice/base: fix compile issues on some targets
In reply to Anatoly BurakovTo avoid triggering compile errors reported on some targets, use explicit type casts to specify type conversion.
--- drivers/net/ice/base/ice_flow.h | 2 +- drivers/net/ice/base/ice_parser.c | 7 ++++--- drivers/net/ice/base/ice_ptp_hw.c | 9 +++++---- drivers/net/ice/base/ice_switch.c | 7 ++++--- 4 files changed, 14 insertions(+), 11 deletions(-)
drivers/net/ice/base/ice_flow.h +1 -1
@@ -485,7 +485,7 @@ struct ice_flow_entry {u8 acts_cnt; }; -#define ICE_FLOW_ENTRY_HNDL (e) ((intptr_t)e) +#define ICE_FLOW_ENTRY_HNDL (e) ((u64)e)#define ICE_FLOW_ENTRY_PTR (h) ((struct ice_flow_entry *)(h))struct ice_flow_prof {
drivers/net/ice/base/ice_parser.c +4 -3
@@ -96,7 +96,7 @@ void *ice_parser_sect_item_get(u32 sect_type, void *section,if (index >=LE16_TO_CPU (hdr->count))return NULL ; -return (void *)((uintptr_t )section + data_off + index * size); +return (void *)((u64 )section + data_off + index * size); }/**
@@ -146,9 +146,10 @@ void *ice_parser_create_table(struct ice_hw *hw, u32 sect_type,if (no_offset) idx++;else - idx = hdr->offset + state.entry_idx; + idx =LE16_TO_CPU (hdr->offset) + + state.entry_idx;parse_item (hw, idx, - (void *)((uintptr_t )table + idx * item_size), + (void *)((u64 )table + idx * item_size), data, item_size); } }while (data);
drivers/net/ice/base/ice_ptp_hw.c +5 -4
@@ -4027,7 +4027,7 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port,return err; } - rx_cycle = val &P_REG_RX_80_TO_160_CNT_RXCYC_M ; + rx_cycle = (u8)(val &P_REG_RX_80_TO_160_CNT_RXCYC_M );if (rx_cycle) { mult = rx_cycle *40 ;
@@ -5850,13 +5850,14 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time, bool wr_main_tmr)/* Fill Rx and Tx ports and send msg to PHY */ switch (hw->phy_model) {case ICE_PHY_ETH56G : - err =ice_ptp_prep_phy_time_eth56g (hw, time &0xFFFFFFFF ); + err =ice_ptp_prep_phy_time_eth56g (hw, + (u32)(time &0xFFFFFFFF ));break ;case ICE_PHY_E810 : - err =ice_ptp_prep_phy_time_e810 (hw, time &0xFFFFFFFF ); + err =ice_ptp_prep_phy_time_e810 (hw, (u32)(time &0xFFFFFFFF ));break ;case ICE_PHY_E822 : - err =ice_ptp_prep_phy_time_e822 (hw, time &0xFFFFFFFF ); + err =ice_ptp_prep_phy_time_e822 (hw, (u32)(time &0xFFFFFFFF ));break ;default : err =ICE_ERR_NOT_SUPPORTED ;
drivers/net/ice/base/ice_switch.c +4 -3
@@ -7794,7 +7794,8 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, }for (i =0 ; i < entry->r_group.n_val_pairs; i++) { - buf[recps].content.lkup_indx[i +1 ] = entry->fv_idx[i]; + buf[recps].content.lkup_indx[i +1 ] = + (u8 )entry->fv_idx[i]; buf[recps].content.mask[i +1 ] =CPU_TO_LE16 (entry->fv_mask[i]); }
@@ -7815,8 +7816,8 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, ((chain_idx <<ICE_AQ_RECIPE_RESULT_DATA_S ) &ICE_AQ_RECIPE_RESULT_DATA_M );ice_clear_bit (chain_idx, result_idx_bm); - chain_idx =ice_find_first_bit (result_idx_bm, -ICE_MAX_FV_WORDS ); + chain_idx = (u8 )ice_find_first_bit (result_idx_bm, +ICE_MAX_FV_WORDS ); }/* fill recipe dependencies */
Signature · 1 line
2.43.0
Re: [PATCH v2 125/148] net/ice/base: fix compile issues on some targets
Quoted 29 lines · Anatoly Burakov
To avoid triggering compile errors reported on some targets, use explicit type casts to specify type conversion.
Signed-off-by Anatoly Burakov <[email protected]>--- drivers/net/ice/base/ice_flow.h | 2 +- drivers/net/ice/base/ice_parser.c | 7 ++++--- drivers/net/ice/base/ice_ptp_hw.c | 9 +++++---- drivers/net/ice/base/ice_switch.c | 7 ++++--- 4 files changed, 14 insertions(+), 11 deletions(-)drivers/net/ice/base/ice_flow.h +1
-1@@ -485,7 +485,7 @@ struct ice_flow_entry {u8 acts_cnt; }; -#define ICE_FLOW_ENTRY_HNDL (e) ((intptr_t)e) +#define ICE_FLOW_ENTRY_HNDL (e) ((u64)e)#define ICE_FLOW_ENTRY_PTR (h) ((struct ice_flow_entry *)(h))struct ice_flow_prof {drivers/net/ice/base/ice_parser.c +0
-0
drivers/net/ice/base/ice_parser.c void *ice_parser_sect_item_get(u32 sect_type, void *section, · line 101
Quoted 7 lines
drivers/net/ice/base/ice_parser.c +1
-1@@ -96,7 +96,7 @@ void *ice_parser_sect_item_get(u32 sect_type, void *section,if (index >=LE16_TO_CPU (hdr->count))return NULL ; -return (void *)((uintptr_t )section + data_off + index * size); +return (void *)((u64 )section + data_off + index * size); }
This change (and below) gives compilation errors with 32-bit, since you are casting from a 64-bit int to a 32-bit pointer. Better to keep as uintptr_t.
Quoted 4 lines
drivers/net/ice/base/ice_parser.c +0
-0/** @@ -146,9 +146,10 @@ void *ice_parser_create_table(struct ice_hw *hw, u32 sect_type,if (no_offset) idx++;
drivers/net/ice/base/ice_parser.c void *ice_parser_create_table(struct ice_hw *hw, u32 sect_type, · line 155
Quoted 10 lines
drivers/net/ice/base/ice_parser.c +3
-2else - idx = hdr->offset + state.entry_idx; + idx =LE16_TO_CPU (hdr->offset) + + state.entry_idx;parse_item (hw, idx, - (void *)((uintptr_t )table + idx * item_size), + (void *)((u64 )table + idx * item_size), data, item_size); } }while (data);
/Bruce
PATCH v2 126/148 net/ice/base: move code to common headers
In reply to Anatoly BurakovTo align with upstream release, move some code to common headers.
--- drivers/net/ice/base/ice_ptp_hw.c | 4 ++-- drivers/net/ice/base/ice_ptp_hw.h | 2 ++ drivers/net/ice/base/ice_sched.c | 8 +++---- drivers/net/ice/base/ice_sched.h | 18 ++++++++++++++++ drivers/net/ice/base/ice_switch.c | 17 ++++++--------- drivers/net/ice/base/ice_switch.h | 36 +++++++++++++++++++++++++++++++ 6 files changed, 68 insertions(+), 17 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +2 -2
@@ -171,7 +171,7 @@ ice_write_cgu_reg_e82x(struct ice_hw *hw, u16 addr, u32 val)* * Convert the specified TIME_REF clock frequency to a string. */ -static const char *ice_clk_freq_str (u8 clk_freq) +const char *ice_clk_freq_str (u8 clk_freq) {switch ((enum ice_time_ref_freq )clk_freq) {case ICE_TIME_REF_FREQ_25_000 :
@@ -197,7 +197,7 @@ static const char *ice_clk_freq_str(u8 clk_freq)* * Convert the specified clock source to its string name. */ -static const char *ice_clk_src_str (u8 clk_src) +const char *ice_clk_src_str (u8 clk_src) {switch ((enum ice_clk_src )clk_src) {case ICE_CLK_SRC_TCX0 :
drivers/net/ice/base/ice_ptp_hw.h +2 -0
@@ -188,6 +188,8 @@ ice_ptp_read_phy_incval_e822(struct ice_hw *hw, u8 port, u64 *incval);int ice_ptp_read_port_capture_e822 (struct ice_hw *hw,u8 port,u64 *tx_ts,u64 *rx_ts); +const char *ice_clk_freq_str (u8 clk_freq); +const char *ice_clk_src_str (u8 clk_src);void ice_ptp_reset_ts_memory_quad_e822 (struct ice_hw *hw,u8 quad); int ice_cfg_cgu_pll_e822(struct ice_hw *hw, enum ice_time_ref_freq *clk_freq,
drivers/net/ice/base/ice_sched.c +4 -4
@@ -913,7 +913,7 @@ ice_aq_cfg_l2_node_cgd(struct ice_hw *hw, u16 num_l2_nodes,* * This function add nodes to HW as well as to SW DB for a given layer */ -static int +int ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node, struct ice_sched_node *parent, u8 layer, u16 num_nodes, u16 *num_nodes_added, u32 *first_node_teid,
@@ -2277,7 +2277,7 @@ ice_sched_get_free_vsi_parent(struct ice_hw *hw, struct ice_sched_node *node,* This function removes the child from the old parent and adds it to a new * parent */ -static void +void ice_sched_update_parent (struct ice_sched_node *new_parent,struct ice_sched_node *node) {
@@ -2311,7 +2311,7 @@ ice_sched_update_parent(struct ice_sched_node *new_parent,* * This function move the child nodes to a given parent. */ -static int +int ice_sched_move_nodes (struct ice_port_info *pi,struct ice_sched_node *parent,u16 num_items,u32 *list) {
@@ -4382,7 +4382,7 @@ ice_sched_set_node_bw_dflt(struct ice_port_info *pi,* node's RL profile ID of type CIR, EIR, or SRL, and removes old profile * ID from local database. The caller needs to hold scheduler lock. */ -static int +int ice_sched_set_node_bw (struct ice_port_info *pi,struct ice_sched_node *node,enum ice_rl_type rl_type,u32 bw,u8 layer_num) {
drivers/net/ice/base/ice_sched.h +18 -0
@@ -105,6 +105,21 @@ ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req,int ice_sched_set_node_bw_lmt (struct ice_port_info *pi,struct ice_sched_node *node,enum ice_rl_type rl_type,u32 bw); + +int +ice_sched_set_node_bw (struct ice_port_info *pi,struct ice_sched_node *node, +enum ice_rl_type rl_type,u32 bw,u8 layer_num); + +int +ice_sched_add_elems (struct ice_port_info *pi,struct ice_sched_node *tc_node, +struct ice_sched_node *parent,u8 layer,u16 num_nodes, +u16 *num_nodes_added,u32 *first_node_teid, +struct ice_sched_node **prealloc_node); + +int +ice_sched_move_nodes (struct ice_port_info *pi,struct ice_sched_node *parent, +u16 num_items,u32 *list); +int ice_sched_init_port (struct ice_port_info *pi);int ice_sched_query_res_alloc (struct ice_hw *hw);void ice_sched_get_psm_clk_freq (struct ice_hw *hw);
@@ -123,6 +138,9 @@ int ice_sched_add_node(struct ice_port_info *pi, u8 layer, struct ice_aqc_txsched_elem_data *info, struct ice_sched_node *prealloc_node); +void +ice_sched_update_parent (struct ice_sched_node *new_parent, +struct ice_sched_node *node);void ice_free_sched_node (struct ice_port_info *pi,struct ice_sched_node *node);struct ice_sched_node *ice_sched_get_tc_node (struct ice_port_info *pi,u8 tc); struct ice_sched_node *
drivers/net/ice/base/ice_switch.c +6 -11
@@ -38,11 +38,6 @@ static const u8 dummy_eth_header[DUMMY_ETH_HDR_LEN] = { 0x2, 0, 0, 0, 0, 0,0x2 ,0 ,0 ,0 ,0 ,0 , 0x81, 0, 0, 0}; -struct ice_dummy_pkt_offsets { -enum ice_protocol_type type; -u16 offset;/* ICE_PROTOCOL_LAST indicates end of list */ -}; -static const struct ice_dummy_pkt_offsets dummy_gre_tcp_packet_offsets[] = { {ICE_MAC_OFOS ,0 }, { ICE_ETYPE_OL, 12 },
@@ -4927,7 +4922,7 @@ ice_find_rule_entry(struct LIST_HEAD_TYPE *list_head,* handle element. This can be extended further to search VSI list with more * than 1 vsi_count. Returns pointer to VSI list entry if found. */ -static struct ice_vsi_list_map_info * +struct ice_vsi_list_map_info *ice_find_vsi_list_entry (struct ice_sw_recipe *recp_list,u16 vsi_handle,u16 *vsi_list_id) {
@@ -8388,7 +8383,7 @@ bool ice_is_prof_rule(enum ice_sw_tunnel_type type)* @rinfo: other information regarding the rule e.g. priority and action info * @rid: return the recipe ID of the recipe created */ -static int +int ice_add_adv_recipe (struct ice_hw *hw,struct ice_adv_lkup_elem *lkups,u16 lkups_cnt,struct ice_adv_rule_info *rinfo,u16 *rid) {
@@ -8620,7 +8615,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,* @pkt_len: packet length of dummy packet * @offsets: pointer to receive the pointer to the offsets for the packet */ -static void +void ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, enum ice_sw_tunnel_type tun_type, const u8 **pkt, u16 *pkt_len,
@@ -9151,7 +9146,7 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,* @pkt_len: packet length of dummy packet * @offsets: offset info for the dummy packet */ -static int +int ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, struct ice_sw_rule_lkup_rx_tx *s_rule, const u8 *dummy_pkt, u16 pkt_len,
@@ -9364,7 +9359,7 @@ ice_fill_adv_packet_vlan(u16 vlan_type, u8 *pkt,* Helper function to search for a given advance rule entry * Returns pointer to entry storing the rule if found */ -static struct ice_adv_fltr_mgmt_list_entry * +struct ice_adv_fltr_mgmt_list_entry *ice_find_adv_rule_entry (struct ice_hw *hw,struct ice_adv_lkup_elem *lkups,u16 lkups_cnt,u16 recp_id,struct ice_adv_rule_info *rinfo)
@@ -9415,7 +9410,7 @@ ice_find_adv_rule_entry(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,* Add the new VSI to the previously created VSI list set * using the update switch rule command */ -static int +int ice_adv_add_update_vsi_list(struct ice_hw *hw, struct ice_adv_fltr_mgmt_list_entry *m_entry, struct ice_adv_rule_info *cur_fltr,
drivers/net/ice/base/ice_switch.h +36 -0
@@ -438,6 +438,42 @@ enum ice_promisc_flags { ICE_PROMISC_MAX, }; +struct ice_dummy_pkt_offsets { +enum ice_protocol_type type; +u16 offset;/* ICE_PROTOCOL_LAST indicates end of list */ +}; + +void +ice_find_dummy_packet (struct ice_adv_lkup_elem *lkups,u16 lkups_cnt, +enum ice_sw_tunnel_type tun_type,const u8 **pkt, +u16 *pkt_len, +const struct ice_dummy_pkt_offsets **offsets); + +int +ice_fill_adv_dummy_packet (struct ice_adv_lkup_elem *lkups,u16 lkups_cnt, +struct ice_sw_rule_lkup_rx_tx *s_rule, +const u8 *dummy_pkt,u16 pkt_len, +const struct ice_dummy_pkt_offsets *offsets); + +int +ice_add_adv_recipe (struct ice_hw *hw,struct ice_adv_lkup_elem *lkups, +u16 lkups_cnt,struct ice_adv_rule_info *rinfo,u16 *rid); + +struct ice_adv_fltr_mgmt_list_entry * +ice_find_adv_rule_entry (struct ice_hw *hw,struct ice_adv_lkup_elem *lkups, +u16 lkups_cnt,u16 recp_id, +struct ice_adv_rule_info *rinfo); + +int +ice_adv_add_update_vsi_list (struct ice_hw *hw, +struct ice_adv_fltr_mgmt_list_entry *m_entry, +struct ice_adv_rule_info *cur_fltr, +struct ice_adv_rule_info *new_fltr); + +struct ice_vsi_list_map_info * +ice_find_vsi_list_entry (struct ice_sw_recipe *recp_list,u16 vsi_handle, +u16 *vsi_list_id); +/* VSI related commands */ int ice_aq_add_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
Signature · 1 line
2.43.0
Re: [PATCH v2 126/148] net/ice/base: move code to common headers
Quoted 2 lines · Anatoly Burakov
To align with upstream release, move some code to common headers.
My reading of this patch is not so much moving code, as making functions non-static, and as part of that putting prototypes for those funcs in the headers.
/Bruce
PATCH v2 127/148 net/ice/base: make some switch-related functions static
In reply to Anatoly BurakovTo better align with upstream release, remove some functions from switch header and make them static instead.
--- drivers/net/ice/base/ice_ptp_hw.c | 14 +++++++------- drivers/net/ice/base/ice_ptp_hw.h | 16 ---------------- 2 files changed, 7 insertions(+), 23 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +7 -7
@@ -3330,7 +3330,7 @@ ice_ptp_read_port_capture_e822(struct ice_hw *hw, u8 port, u64 *tx_ts,* Note there is no equivalent of this operation on E810, as that device * always handles all external PHYs internally. */ -int +static int ice_ptp_write_port_cmd_e822 (struct ice_hw *hw,u8 port,enum ice_ptp_tmr_cmd cmd,bool lock_sbq) {
@@ -5093,8 +5093,8 @@ ice_ptp_prep_phy_adj_target_e810(struct ice_hw *hw, u32 target_time)* Prepare the external PHYs connected to this device for a timer sync * command. */ -int ice_ptp_port_cmd_e810 (struct ice_hw *hw,enum ice_ptp_tmr_cmd cmd, -bool lock_sbq) +static int ice_ptp_port_cmd_e810 (struct ice_hw *hw,enum ice_ptp_tmr_cmd cmd, +bool lock_sbq) {u32 val =ice_ptp_tmr_cmd_to_port_reg (hw, cmd);int err;
@@ -5501,7 +5501,7 @@ ice_ptp_write_direct_phc_time_e830(struct ice_hw *hw, u64 time)* Prepare the external PHYs connected to this device for a timer sync * command. */ -int +static int ice_ptp_port_cmd_e830 (struct ice_hw *hw,enum ice_ptp_tmr_cmd cmd,bool lock_sbq) {
@@ -5550,7 +5550,7 @@ ice_read_phy_tstamp_e830(struct ice_hw *hw, u8 lport, u8 idx, u64 *tstamp)* @tstamp_ready: contents of the Tx memory status register * */ -int +static int ice_get_phy_tx_tstamp_ready_e830 (struct ice_hw *hw,u8 port,u64 *tstamp_ready) {u64 hi;
@@ -5696,8 +5696,8 @@ void ice_ptp_init_phy_model(struct ice_hw *hw)* programming only a single port, instead use ice_ptp_one_port_cmd() to * ensure non-modified ports get properly initialized to ICE_PTP_NOP. */ -int ice_ptp_write_port_cmd (struct ice_hw *hw,u8 port, -enum ice_ptp_tmr_cmd cmd,bool lock_sbq) +static int ice_ptp_write_port_cmd (struct ice_hw *hw,u8 port, +enum ice_ptp_tmr_cmd cmd,bool lock_sbq) {switch (hw->phy_model) {case ICE_PHY_ETH56G :
drivers/net/ice/base/ice_ptp_hw.h +0 -16
@@ -195,12 +195,6 @@ int ice_cfg_cgu_pll_e822(struct ice_hw *hw, enum ice_time_ref_freq *clk_freq, enum ice_clk_src *clk_src);int -ice_ptp_write_port_cmd_e822 (struct ice_hw *hw,u8 port, -enum ice_ptp_tmr_cmd cmd,bool lock_sbq); -int -ice_ptp_write_port_cmd (struct ice_hw *hw,u8 port,enum ice_ptp_tmr_cmd cmd, -bool lock_sbq); -int ice_cfg_cgu_pll_e825c (struct ice_hw *hw,enum ice_time_ref_freq *clk_freq,enum ice_clk_src *clk_src);int
@@ -213,16 +207,6 @@ ice_cfg_cgu_bypass_mux_e825c(struct ice_hw *hw, u8 port_num, bool clock_1588, unsigned int ena);int ice_cfg_synce_ethdiv_e825c (struct ice_hw *hw,u8 *divider); -/* E8 Family */ -int -ice_ptp_port_cmd_e830 (struct ice_hw *hw,enum ice_ptp_tmr_cmd cmd, -bool lock_sbq); -int -ice_ptp_port_cmd_e810 (struct ice_hw *hw,enum ice_ptp_tmr_cmd cmd, -bool lock_sbq); -int -ice_get_phy_tx_tstamp_ready_e830 (struct ice_hw *hw,u8 port,u64 *tstamp_ready); -/** * ice_e822_time_ref - Get the current TIME_REF from capabilities * @hw: pointer to the HW structure
Signature · 1 line
2.43.0
Re: [PATCH v2 127/148] net/ice/base: make some switch-related functions static
Quoted 5 lines · Anatoly Burakov
To better align with upstream release, remove some functions from switch header and make them static instead.
Signed-off-by Anatoly Burakov <[email protected]>---
Not sure about this, but I wonder if this should be squashed with the previous patch to have a single patch that adjusts functions to be static or non-static. If you feel it's better to have one patch move from non-static to static, and the follow-up move other functions the opposite direction, that is fine too.
/Bruce
PATCH v2 128/148 net/ice/base: add support for L2TP on switch
In reply to Anatoly BurakovAdd dummy packet and tunnel type to support L2TP on switch, now we can use session id as input set for swicth rule.
--- drivers/net/ice/base/ice_switch.c | 438 +++++++++++++++--------------- 1 file changed, 219 insertions(+), 219 deletions(-)
drivers/net/ice/base/ice_switch.c +219 -219
@@ -1653,83 +1653,6 @@ static const u8 dummy_pppoe_ipv4_packet[] = { 0x00, 0x00, /* 2 bytes for 4 bytes alignment */ }; -static const -struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_tcp_packet_offsets[] = { - {ICE_MAC_OFOS ,0 }, - {ICE_VLAN_OFOS ,12 }, - {ICE_ETYPE_OL ,16 }, - {ICE_PPPOE ,18 }, - {ICE_IPV4_OFOS ,26 }, - {ICE_TCP_IL ,46 }, - {ICE_PROTOCOL_LAST ,0 }, -}; - -static const u8 dummy_pppoe_ipv4_tcp_packet[] = { -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x81 ,0x00 ,0x00 ,0x00 ,/* ICE_VLAN_OFOS 12 */ - -0x88 ,0x64 ,/* ICE_ETYPE_OL 16 */ - -0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 18 */ -0x00 ,0x16 , - -0x00 ,0x21 ,/* PPP Link Layer 24 */ - -0x45 ,0x00 ,0x00 ,0x28 ,/* ICE_IPV4_OFOS 26 */ -0x00 ,0x01 ,0x00 ,0x00 , -0x00 ,0x06 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_TCP_IL 46 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x50 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ -}; - -static const -struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_udp_packet_offsets[] = { - {ICE_MAC_OFOS ,0 }, - {ICE_VLAN_OFOS ,12 }, - {ICE_ETYPE_OL ,16 }, - {ICE_PPPOE ,18 }, - {ICE_IPV4_OFOS ,26 }, - {ICE_UDP_ILOS ,46 }, - {ICE_PROTOCOL_LAST ,0 }, -}; - -static const u8 dummy_pppoe_ipv4_udp_packet[] = { -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x81 ,0x00 ,0x00 ,0x00 ,/* ICE_VLAN_OFOS 12 */ - -0x88 ,0x64 ,/* ICE_ETYPE_OL 16 */ - -0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 18 */ -0x00 ,0x16 , - -0x00 ,0x21 ,/* PPP Link Layer 24 */ - -0x45 ,0x00 ,0x00 ,0x1c ,/* ICE_IPV4_OFOS 26 */ -0x00 ,0x01 ,0x00 ,0x00 , -0x00 ,0x11 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_UDP_ILOS 46 */ -0x00 ,0x08 ,0x00 ,0x00 , - -0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ -}; -static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_offsets[] = { {ICE_MAC_OFOS ,0 }, {ICE_VLAN_OFOS ,12 },
@@ -1767,93 +1690,6 @@ static const u8 dummy_pppoe_ipv6_packet[] = { 0x00, 0x00, /* 2 bytes for 4 bytes alignment */ }; -static const -struct ice_dummy_pkt_offsets dummy_pppoe_ipv6_tcp_packet_offsets[] = { - {ICE_MAC_OFOS ,0 }, - {ICE_VLAN_OFOS ,12 }, - {ICE_ETYPE_OL ,16 }, - {ICE_PPPOE ,18 }, - {ICE_IPV6_OFOS ,26 }, - {ICE_TCP_IL ,66 }, - {ICE_PROTOCOL_LAST ,0 }, -}; - -static const u8 dummy_pppoe_ipv6_tcp_packet[] = { -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x81 ,0x00 ,0x00 ,0x00 ,/* ICE_VLAN_OFOS 12 */ - -0x88 ,0x64 ,/* ICE_ETYPE_OL 16 */ - -0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 18 */ -0x00 ,0x2a , - -0x00 ,0x57 ,/* PPP Link Layer 24 */ - -0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_OFOS 26 */ -0x00 ,0x14 ,0x06 ,0x00 ,/* Next header is TCP */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_TCP_IL 66 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x50 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ -}; - -static const -struct ice_dummy_pkt_offsets dummy_pppoe_ipv6_udp_packet_offsets[] = { - {ICE_MAC_OFOS ,0 }, - {ICE_VLAN_OFOS ,12 }, - {ICE_ETYPE_OL ,16 }, - {ICE_PPPOE ,18 }, - {ICE_IPV6_OFOS ,26 }, - {ICE_UDP_ILOS ,66 }, - {ICE_PROTOCOL_LAST ,0 }, -}; - -static const u8 dummy_pppoe_ipv6_udp_packet[] = { -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x81 ,0x00 ,0x00 ,0x00 ,/* ICE_VLAN_OFOS 12 */ - -0x88 ,0x64 ,/* ICE_ETYPE_OL 16 */ - -0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 18 */ -0x00 ,0x2a , - -0x00 ,0x57 ,/* PPP Link Layer 24 */ - -0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_OFOS 26 */ -0x00 ,0x08 ,0x11 ,0x00 ,/* Next header UDP*/ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_UDP_ILOS 66 */ -0x00 ,0x08 ,0x00 ,0x00 , - -0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ -}; -static const struct ice_dummy_pkt_offsets dummy_ipv4_esp_packet_offsets[] = { {ICE_MAC_OFOS ,0 }, {ICE_IPV4_OFOS ,14 },
@@ -2024,61 +1860,6 @@ static const u8 dummy_ipv6_nat_pkt[] = { }; -static const struct ice_dummy_pkt_offsets dummy_ipv4_l2tpv3_packet_offsets[] = { - {ICE_MAC_OFOS ,0 }, - {ICE_IPV4_OFOS ,14 }, - {ICE_L2TPV3 ,34 }, - {ICE_PROTOCOL_LAST ,0 }, -}; - -static const u8 dummy_ipv4_l2tpv3_pkt[] = { -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x08 ,0x00 , - -0x45 ,0x00 ,0x00 ,0x20 ,/* ICE_IPV4_IL 14 */ -0x00 ,0x00 ,0x40 ,0x00 , -0x40 ,0x73 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_L2TPV3 34 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ -}; - -static const struct ice_dummy_pkt_offsets dummy_ipv6_l2tpv3_packet_offsets[] = { - {ICE_MAC_OFOS ,0 }, - {ICE_IPV6_OFOS ,14 }, - {ICE_L2TPV3 ,54 }, - {ICE_PROTOCOL_LAST ,0 }, -}; - -static const u8 dummy_ipv6_l2tpv3_pkt[] = { -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x86 ,0xDD , - -0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_IL 14 */ -0x00 ,0x0c ,0x73 ,0x40 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , - -0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_L2TPV3 54 */ -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ -}; -static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_offsets[] = { {ICE_MAC_OFOS ,0 }, {ICE_VLAN_EX ,12 },
@@ -2161,6 +1942,225 @@ static const u8 dummy_qinq_pppoe_ipv6_packet[] = { 0x00, 0x00, /* 2 bytes for 4 bytes alignment */ }; +static const struct ice_dummy_pkt_offsets dummy_ipv4_l2tpv3_packet_offsets[] = { + {ICE_MAC_OFOS ,0 }, + {ICE_IPV4_OFOS ,14 }, + {ICE_L2TPV3 ,34 }, + {ICE_PROTOCOL_LAST ,0 }, +}; + +static const u8 dummy_ipv4_l2tpv3_pkt[] = { +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x08 ,0x00 , + +0x45 ,0x00 ,0x00 ,0x20 ,/* ICE_IPV4_IL 14 */ +0x00 ,0x00 ,0x40 ,0x00 , +0x40 ,0x73 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_L2TPV3 34 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ +}; + +static const struct ice_dummy_pkt_offsets dummy_ipv6_l2tpv3_packet_offsets[] = { + {ICE_MAC_OFOS ,0 }, + {ICE_IPV6_OFOS ,14 }, + {ICE_L2TPV3 ,54 }, + {ICE_PROTOCOL_LAST ,0 }, +}; + +static const u8 dummy_ipv6_l2tpv3_pkt[] = { +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x86 ,0xDD , + +0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_IL 14 */ +0x00 ,0x0c ,0x73 ,0x40 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_L2TPV3 54 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ +}; + +static const +struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_tcp_packet_offsets[] = { + {ICE_MAC_OFOS ,0 }, + {ICE_VLAN_OFOS ,12 }, + {ICE_ETYPE_OL ,16 }, + {ICE_PPPOE ,18 }, + {ICE_IPV4_OFOS ,26 }, + {ICE_TCP_IL ,46 }, + {ICE_PROTOCOL_LAST ,0 }, +}; + +static const u8 dummy_pppoe_ipv4_tcp_packet[] = { +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x81 ,0x00 ,0x00 ,0x00 ,/* ICE_VLAN_OFOS 12 */ + +0x88 ,0x64 ,/* ICE_ETYPE_OL 16 */ + +0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 18 */ +0x00 ,0x16 , + +0x00 ,0x21 ,/* PPP Link Layer 24 */ + +0x45 ,0x00 ,0x00 ,0x28 ,/* ICE_IPV4_OFOS 26 */ +0x00 ,0x01 ,0x00 ,0x00 , +0x00 ,0x06 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_TCP_IL 46 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x50 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ +}; + +static const +struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_udp_packet_offsets[] = { + {ICE_MAC_OFOS ,0 }, + {ICE_VLAN_OFOS ,12 }, + {ICE_ETYPE_OL ,16 }, + {ICE_PPPOE ,18 }, + {ICE_IPV4_OFOS ,26 }, + {ICE_UDP_ILOS ,46 }, + {ICE_PROTOCOL_LAST ,0 }, +}; + +static const u8 dummy_pppoe_ipv4_udp_packet[] = { +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x81 ,0x00 ,0x00 ,0x00 ,/* ICE_VLAN_OFOS 12 */ + +0x88 ,0x64 ,/* ICE_ETYPE_OL 16 */ + +0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 18 */ +0x00 ,0x16 , + +0x00 ,0x21 ,/* PPP Link Layer 24 */ + +0x45 ,0x00 ,0x00 ,0x1c ,/* ICE_IPV4_OFOS 26 */ +0x00 ,0x01 ,0x00 ,0x00 , +0x00 ,0x11 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_UDP_ILOS 46 */ +0x00 ,0x08 ,0x00 ,0x00 , + +0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ +}; + +static const +struct ice_dummy_pkt_offsets dummy_pppoe_ipv6_tcp_packet_offsets[] = { + {ICE_MAC_OFOS ,0 }, + {ICE_VLAN_OFOS ,12 }, + {ICE_ETYPE_OL ,16 }, + {ICE_PPPOE ,18 }, + {ICE_IPV6_OFOS ,26 }, + {ICE_TCP_IL ,66 }, + {ICE_PROTOCOL_LAST ,0 }, +}; + +static const u8 dummy_pppoe_ipv6_tcp_packet[] = { +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x81 ,0x00 ,0x00 ,0x00 ,/* ICE_VLAN_OFOS 12 */ + +0x88 ,0x64 ,/* ICE_ETYPE_OL 16 */ + +0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 18 */ +0x00 ,0x2a , + +0x00 ,0x57 ,/* PPP Link Layer 24 */ + +0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_OFOS 26 */ +0x00 ,0x14 ,0x06 ,0x00 ,/* Next header is TCP */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_TCP_IL 66 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x50 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ +}; + +static const +struct ice_dummy_pkt_offsets dummy_pppoe_ipv6_udp_packet_offsets[] = { + {ICE_MAC_OFOS ,0 }, + {ICE_VLAN_OFOS ,12 }, + {ICE_ETYPE_OL ,16 }, + {ICE_PPPOE ,18 }, + {ICE_IPV6_OFOS ,26 }, + {ICE_UDP_ILOS ,66 }, + {ICE_PROTOCOL_LAST ,0 }, +}; + +static const u8 dummy_pppoe_ipv6_udp_packet[] = { +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x81 ,0x00 ,0x00 ,0x00 ,/* ICE_VLAN_OFOS 12 */ + +0x88 ,0x64 ,/* ICE_ETYPE_OL 16 */ + +0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 18 */ +0x00 ,0x2a , + +0x00 ,0x57 ,/* PPP Link Layer 24 */ + +0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_OFOS 26 */ +0x00 ,0x08 ,0x11 ,0x00 ,/* Next header UDP*/ +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 , + +0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_UDP_ILOS 66 */ +0x00 ,0x08 ,0x00 ,0x00 , + +0x00 ,0x00 ,/* 2 bytes for 4 bytes alignment */ +}; +/* this is a recipe to profile association bitmap */ static ice_declare_bitmap(recipe_to_profile[ICE_MAX_NUM_RECIPES], ICE_MAX_NUM_PROFILES);
Signature · 1 line
2.43.0
PATCH v2 129/148 net/ice/base: add L2TPv3 support for adv rules
In reply to Anatoly BurakovThis patch adds L2TPv3 dummy packets, data structures and defines.
--- drivers/net/ice/base/ice_switch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_switch.c +6 -2
@@ -1944,6 +1944,7 @@ static const u8 dummy_qinq_pppoe_ipv6_packet[] = {static const struct ice_dummy_pkt_offsets dummy_ipv4_l2tpv3_packet_offsets[] = { {ICE_MAC_OFOS ,0 }, + {ICE_ETYPE_OL ,12 }, {ICE_IPV4_OFOS ,14 }, {ICE_L2TPV3 ,34 }, {ICE_PROTOCOL_LAST ,0 },
@@ -1953,7 +1954,8 @@ static const u8 dummy_ipv4_l2tpv3_pkt[] = {0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x08 ,0x00 , + +0x08 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x45 ,0x00 ,0x00 ,0x20 ,/* ICE_IPV4_IL 14 */ 0x00, 0x00, 0x40, 0x00,
@@ -1969,6 +1971,7 @@ static const u8 dummy_ipv4_l2tpv3_pkt[] = {static const struct ice_dummy_pkt_offsets dummy_ipv6_l2tpv3_packet_offsets[] = { {ICE_MAC_OFOS ,0 }, + {ICE_ETYPE_OL ,12 }, {ICE_IPV6_OFOS ,14 }, {ICE_L2TPV3 ,54 }, {ICE_PROTOCOL_LAST ,0 },
@@ -1978,7 +1981,8 @@ static const u8 dummy_ipv6_l2tpv3_pkt[] = {0x00 ,0x00 ,0x00 ,0x00 ,/* ICE_MAC_OFOS 0 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x86 ,0xDD , + +0x86 ,0xDD ,/* ICE_ETYPE_OL 12 */ 0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_IL 14 */ 0x00, 0x0c, 0x73, 0x40,
Signature · 1 line
2.43.0
PATCH v2 130/148 net/ice/base: detect and store device sensor reading capability
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
The driver can use this capability to see if temperature sensor reading or other HW sensor reading capabilities are supported before reading them using the Get Sensor Reading AQ command.
--- drivers/net/ice/base/ice_adminq_cmd.h | 1 + drivers/net/ice/base/ice_common.c | 23 +++++++++++++++++++++++ drivers/net/ice/base/ice_type.h | 3 +++ 3 files changed, 27 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +1 -0
@@ -119,6 +119,7 @@ struct ice_aqc_list_caps_elem {#define ICE_AQC_CAPS_1588 0x0046#define ICE_AQC_CAPS_MAX_MTU 0x0047#define ICE_AQC_CAPS_IWARP 0x0051 +#define ICE_AQC_CAPS_SENSOR_READING 0x0067#define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076#define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077#define ICE_AQC_CAPS_NVM_MGMT 0x0080
drivers/net/ice/base/ice_common.c +23 -0
@@ -2853,6 +2853,26 @@ ice_parse_nac_topo_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, dev_p->nac_topo.id); } +/** +* ice_parse_sensor_reading_cap - Parse ICE_AQC_CAPS_SENSOR_READING cap +* @hw: pointer to the HW struct +* @dev_p: pointer to device capabilities structure +* @cap: capability element to parse +* +* Parse ICE_AQC_CAPS_SENSOR_READING for device capability for reading +* enabled sensors. +*/ +static void +ice_parse_sensor_reading_cap (struct ice_hw *hw,struct ice_hw_dev_caps *dev_p, +struct ice_aqc_list_caps_elem *cap) +{ + dev_p->supported_sensors =LE32_TO_CPU (cap->number); + +ice_debug (hw,ICE_DBG_INIT , +"dev caps: supported sensors (bitmap) = 0x%x\n" , + dev_p->supported_sensors); +} +/** * ice_parse_dev_caps - Parse device capabilities * @hw: pointer to the HW struct
@@ -2901,6 +2921,9 @@ ice_parse_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,case ICE_AQC_CAPS_NAC_TOPOLOGY :ice_parse_nac_topo_dev_caps (hw, dev_p, &cap_resp[i]);break ; +case ICE_AQC_CAPS_SENSOR_READING : +ice_parse_sensor_reading_cap (hw, dev_p, &cap_resp[i]); +break ;default :/* Don't list common capabilities as unknown */ if (!found)
drivers/net/ice/base/ice_type.h +3 -0
@@ -827,6 +827,9 @@ struct ice_hw_dev_caps {struct ice_ts_dev_info ts_dev_info;u32 num_funcs;struct ice_nac_topology nac_topo; +/* bitmap of supported sensors */ +u32 supported_sensors; +#define ICE_SENSOR_SUPPORT_E810_INT_TEMP BIT(0) };/* Information about MAC such as address, etc... */
Signature · 1 line
2.43.0
PATCH v2 131/148 net/ice/base: add missing defines and misc cleanup
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add various missing defines and definitions that are currently not present in DPDK but are present in upstream code.
--- drivers/net/ice/base/ice_adminq_cmd.h | 86 +++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 4 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +82 -4
@@ -496,6 +496,7 @@ struct ice_aqc_vsi_props {#define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S 0#define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_M (0xF << ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S)#define ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA BIT(0) +#define ICE_AQ_VSI_SW_FLAG_RX_PASS_PRUNE_ENA BIT(3)#define ICE_AQ_VSI_SW_FLAG_LAN_ENA BIT(4)u8 veb_stat_id;#define ICE_AQ_VSI_SW_VEB_STAT_ID_S 0
@@ -894,6 +895,8 @@ struct ice_sw_rule_lkup_rx_tx {#define ICE_SINGLE_ACT_PTR 0x2#define ICE_SINGLE_ACT_PTR_VAL_S 4#define ICE_SINGLE_ACT_PTR_VAL_M (0x1FFF << ICE_SINGLE_ACT_PTR_VAL_S) +/* Bit 17 should be set if pointed action includes a FWD cmd */ +#define ICE_SINGLE_ACT_PTR_HAS_FWD BIT(17)/* Bit 18 should be set to 1 */ #define ICE_SINGLE_ACT_PTR_BIT BIT(18)
@@ -1289,10 +1292,11 @@ struct ice_aqc_get_phy_caps {/* 18.0 - Report qualified modules */ #define ICE_AQC_GET_PHY_RQM BIT(0)/* 18.1 - 18.3 : Report mode -* 000b - Report NVM capabilities -* 001b - Report topology capabilities -* 010b - Report SW configured -* 100b - Report default capabilities +* 000b - Report topology capabilities, without media +* 001b - Report topology capabilities, with media +* 010b - Report Active configuration +* 011b - Report PHY Type and FEC mode capabilities +* 100b - Report Default capabilities */ #define ICE_AQC_REPORT_MODE_S 1#define ICE_AQC_REPORT_MODE_M (7 << ICE_AQC_REPORT_MODE_S)
@@ -1681,6 +1685,7 @@ struct ice_aqc_set_event_mask {#define ICE_AQ_LINK_EVENT_PORT_TX_SUSPENDED BIT(9)#define ICE_AQ_LINK_EVENT_TOPO_CONFLICT BIT(10)#define ICE_AQ_LINK_EVENT_MEDIA_CONFLICT BIT(11) +#define ICE_AQ_LINK_EVENT_PHY_FW_LOAD_FAIL BIT(12)u8 reserved1[6 ]; };
@@ -1734,6 +1739,8 @@ struct ice_aqc_link_topo_params {#define ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE 6#define ICE_AQC_LINK_TOPO_NODE_TYPE_MEZZ 7#define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM 8 +#define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL 9 +#define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX 10#define ICE_AQC_LINK_TOPO_NODE_TYPE_GPS 11#define ICE_AQC_LINK_TOPO_NODE_CTX_S 4#define ICE_AQC_LINK_TOPO_NODE_CTX_M \
@@ -1772,6 +1779,11 @@ struct ice_aqc_get_link_topo {struct ice_aqc_link_topo_addr addr;u8 node_part_num;#define ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575 0x21 +#define ICE_AQC_GET_LINK_TOPO_NODE_NR_ZL30632_80032 0x24 +#define ICE_AQC_GET_LINK_TOPO_NODE_NR_SI5383_5384 0x25 +#define ICE_AQC_GET_LINK_TOPO_NODE_NR_E822_PHY 0x30 +#define ICE_AQC_GET_LINK_TOPO_NODE_NR_C827 0x31 +#define ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX 0x47#define ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS 0x48u8 rsvd[9 ]; };
@@ -1800,6 +1812,7 @@ struct ice_aqc_get_link_topo_pin {#define ICE_AQC_LINK_TOPO_IO_FUNC_RED_LED 12#define ICE_AQC_LINK_TOPO_IO_FUNC_GREEN_LED 13#define ICE_AQC_LINK_TOPO_IO_FUNC_BLUE_LED 14 +#define ICE_AQC_LINK_TOPO_IO_FUNC_CLK_IN 20#define ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S 5#define ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_M \ (0x7 << ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S)
@@ -2018,6 +2031,12 @@ struct ice_aqc_nvm {#define ICE_AQC_NVM_PERST_FLAG 1#define ICE_AQC_NVM_EMPR_FLAG 2#define ICE_AQC_NVM_EMPR_ENA BIT(0)/* Write Activate reply only */ +/* For Write Activate, several flags are sent as part of a separate +* flags2 field using a separate byte. For simplicity of the software +* interface, we pass the flags as a 16 bit value so these flags are +* all offset by 8 bits +*/ +#define ICE_AQC_NVM_ACTIV_REQ_EMPR BIT(8)/* NVM Write Activate only */ __le16 module_typeid;__le16 length;#define ICE_AQC_NVM_ERASE_LEN 0xFFFF
@@ -2070,6 +2089,7 @@ struct ice_aqc_nvm { ICE_AQC_NVM_SDP_CFG_SDP_NUM_OFFSET)#define ICE_AQC_NVM_SDP_CFG_NA_PIN_MASK MAKEMASK(0x1, 15) +#define ICE_AQC_NVM_MINSREV_MOD_ID 0x130#define ICE_AQC_NVM_TX_TOPO_MOD_ID 0x14B#define ICE_AQC_NVM_CMPO_MOD_ID 0x153
@@ -2080,6 +2100,21 @@ struct ice_aqc_nvm_cmpo {__le16 cages_cfg[8 ]; }; +/* Used for reading and writing MinSRev using 0x0701 and 0x0703. Note that the +* type field is excluded from the section when reading and writing from +* a module using the module_typeid field with these AQ commands. +*/ +struct ice_aqc_nvm_minsrev { +__le16 length; +__le16 validity; +#define ICE_AQC_NVM_MINSREV_NVM_VALID BIT(0) +#define ICE_AQC_NVM_MINSREV_OROM_VALID BIT(1) +__le16 nvm_minsrev_l; +__le16 nvm_minsrev_h; +__le16 orom_minsrev_l; +__le16 orom_minsrev_h; +}; +struct ice_aqc_nvm_tx_topo_user_sel {__le16 length;u8 data;
@@ -2404,6 +2439,15 @@ struct ice_aqc_clear_fd_table {u8 reserved[12 ]; }; +/* Sideband Control Interface Commands */ +/* Neighbor Device Request (indirect 0x0C00); also used for the response. */ +struct ice_aqc_neigh_dev_req { +__le16 sb_data_len; +u8 reserved[6 ]; +__le32 addr_high; +__le32 addr_low; +}; +/* Allocate ACL table (indirect 0x0C10) */ #define ICE_AQC_ACL_KEY_WIDTH 40#define ICE_AQC_ACL_KEY_WIDTH_BYTES 5
@@ -2994,6 +3038,29 @@ struct ice_aqc_get_pkg_info_resp {struct ice_aqc_get_pkg_info pkg_info[STRUCT_HACK_VAR_LEN ]; }; +/* Configure CGU Error Reporting (direct, 0x0C60) */ +struct ice_aqc_cfg_cgu_err { +u8 cmd; +#define ICE_AQC_CFG_CGU_EVENT_SHIFT 0 +#define ICE_AQC_CFG_CGU_EVENT_MASK BIT(ICE_AQC_CFG_CGU_EVENT_SHIFT) +#define ICE_AQC_CFG_CGU_EVENT_EN (0 << ICE_AQC_CFG_CGU_EVENT_SHIFT) +#define ICE_AQC_CFG_CGU_EVENT_DIS ICE_AQC_CFG_CGU_EVENT_MASK +#define ICE_AQC_CFG_CGU_ERR_SHIFT 1 +#define ICE_AQC_CFG_CGU_ERR_MASK BIT(ICE_AQC_CFG_CGU_ERR_SHIFT) +#define ICE_AQC_CFG_CGU_ERR_EN (0 << ICE_AQC_CFG_CGU_ERR_SHIFT) +#define ICE_AQC_CFG_CGU_ERR_DIS ICE_AQC_CFG_CGU_ERR_MASK +u8 rsvd[15 ]; +}; + +/* CGU Error Event (direct, 0x0C60) */ +struct ice_aqc_event_cgu_err { +u8 err_type; +#define ICE_AQC_CGU_ERR_SYNCE_LOCK_LOSS BIT(0) +#define ICE_AQC_CGU_ERR_HOLDOVER_CHNG BIT(1) +#define ICE_AQC_CGU_ERR_TIMESYNC_LOCK_LOSS BIT(2) +u8 rsvd[15 ]; +}; +/* Driver Shared Parameters (direct, 0x0C90) */ struct ice_aqc_driver_shared_params {u8 set_or_get_op;
@@ -3223,6 +3290,7 @@ struct ice_aq_desc {struct ice_aqc_get_set_rss_lut get_set_rss_lut;struct ice_aqc_get_set_rss_key get_set_rss_key;struct ice_aqc_clear_fd_table clear_fd_table; +struct ice_aqc_neigh_dev_req neigh_dev;struct ice_aqc_acl_alloc_table alloc_table;struct ice_aqc_acl_tbl_actpair tbl_actpair;struct ice_aqc_acl_alloc_scen alloc_scen;
@@ -3244,6 +3312,8 @@ struct ice_aq_desc {struct ice_aqc_get_vsi_resp get_vsi_resp;struct ice_aqc_download_pkg download_pkg;struct ice_aqc_get_pkg_info_list get_pkg_info_list; +struct ice_aqc_cfg_cgu_err config_cgu_err; +struct ice_aqc_event_cgu_err cgu_err;struct ice_aqc_driver_shared_params drv_shared_params;struct ice_aqc_debug_dump_internals debug_dump;struct ice_aqc_set_mac_lb set_mac_lb;
@@ -3461,6 +3531,8 @@ enum ice_adminq_opc { ice_aqc_opc_nvm_sr_dump =0x0707 , ice_aqc_opc_nvm_save_factory_settings =0x0708 , ice_aqc_opc_nvm_update_empr =0x0709 , + ice_aqc_opc_nvm_pkg_data =0x070A , + ice_aqc_opc_nvm_pass_component_tbl =0x070B , ice_aqc_opc_nvm_sanitization = 0x070C,/* LLDP commands */
@@ -3483,6 +3555,8 @@ enum ice_adminq_opc { ice_aqc_opc_get_rss_key =0x0B04 , ice_aqc_opc_get_rss_lut =0x0B05 , ice_aqc_opc_clear_fd_table =0x0B06 , +/* Sideband Control Interface commands */ + ice_aqc_opc_neighbour_device_request =0x0C00 ,/* ACL commands */ ice_aqc_opc_alloc_acl_tbl =0x0C10 , ice_aqc_opc_dealloc_acl_tbl = 0x0C11,
@@ -3517,6 +3591,10 @@ enum ice_adminq_opc { ice_aqc_opc_update_pkg =0x0C42 , ice_aqc_opc_get_pkg_info_list =0x0C43 , +/* 1588/SyncE commands/events */ + ice_aqc_opc_cfg_cgu_err =0x0C60 , + ice_aqc_opc_event_cgu_err =0x0C60 , + ice_aqc_opc_driver_shared_params = 0x0C90,/* Standalone Commands/Events */
Signature · 1 line
2.43.0
PATCH v2 132/148 net/ice/base: increase PF reset wait timeout to 500 milliseconds
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
In the CORE ICE driver enabled devlink to issue EMPR resets during NVM update. As a result, resets took a matter of around 25ms longer than driver wait time to finish.
Fix this by increasing driver wait time from 300ms to 500ms.
--- drivers/net/ice/base/ice_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_common.c +1 -1
@@ -9,7 +9,7 @@#include "ice_ptp_hw.h" #include "ice_switch.h" -#define ICE_PF_RESET_WAIT_COUNT 300 +#define ICE_PF_RESET_WAIT_COUNT 500static const char *const ice_link_mode_str_low[] = {ice_arr_elem_idx (0 ,"100BASE_TX" ),
Signature · 1 line
2.43.0
PATCH v2 133/148 net/ice/base: fix memcpy type
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Modified function ice_aq_manage_mac_read so that ICE_NONDMA_TO_NONDMA memcpy type is used when copying MAC address value from AQC buffer to hardware descriptor. Since (in case of tools) both locations are in user space there is no need to use ICE_DMA_TO_NONDMA memcpy type that was used previously.
--- drivers/net/ice/base/ice_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_common.c +2 -2
@@ -380,10 +380,10 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size,if (resp[i].addr_type ==ICE_AQC_MAN_MAC_ADDR_TYPE_LAN ) {ice_memcpy (hw->port_info->mac.lan_addr, resp[i].mac_addr,ETH_ALEN , -ICE_DMA_TO_NONDMA ); +ICE_NONDMA_TO_NONDMA );ice_memcpy (hw->port_info->mac.perm_addr, resp[i].mac_addr, -ETH_ALEN ,ICE_DMA_TO_NONDMA ); +ETH_ALEN ,ICE_NONDMA_TO_NONDMA );break ; }return 0 ;
Signature · 1 line
2.43.0
Re: [PATCH v2 133/148] net/ice/base: fix memcpy type
Quoted 20 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
Modified function
ice_aq_manage_mac_readso thatICE_NONDMA_TO_NONDMAmemcpy type is used when copying MAC address value from AQC buffer to hardware descriptor. Since (in case of tools) both locations are in user space there is no need to useICE_DMA_TO_NONDMAmemcpy type that was used previously.Signed-off-by Stefan Wegrzyn <[email protected]>Signed-off-by Ian Stokes <[email protected]>--- drivers/net/ice/base/ice_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ice/base/ice_common.c +0
-0@@ -380,10 +380,10 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size,if (resp[i].addr_type ==ICE_AQC_MAN_MAC_ADDR_TYPE_LAN ) { ice_memcpy(hw->port_info->mac.lan_addr,
drivers/net/ice/base/ice_common.c ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, · line 389
Quoted 10 lines
drivers/net/ice/base/ice_common.c +2
-2resp[i].mac_addr,ETH_ALEN , - ICE_DMA_TO_NONDMA); + ICE_NONDMA_TO_NONDMA);ice_memcpy (hw->port_info->mac.perm_addr, resp[i].mac_addr, -ETH_ALEN ,ICE_DMA_TO_NONDMA ); +ETH_ALEN ,ICE_NONDMA_TO_NONDMA );break ; }return 0 ;
This change is similar to that in patch 92, consider squashing there.
/Bruce
PATCH v2 134/148 net/ice/base: too big a timeout for QV diagnostic tests
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
QV tools are affected by two issues:
- Diagnostic tests do not end and cannot be aborted
- Celo hangs after tests start
Reason is that huge timeout dedicated to FPGA was applied. This patch is adjusting the code to QV compilation flags and use correct timeout.
--- drivers/net/ice/base/ice_common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_common.c +5 -3
@@ -1139,7 +1139,7 @@ void ice_deinit_hw(struct ice_hw *hw)*/ int ice_check_reset (struct ice_hw *hw) { -u32 cnt, reg =0 , grst_timeout, uld_mask; +u32 cnt, reg =0 , grst_timeout, uld_mask, reset_wait_cnt;/* Poll for Device Active state in case a recent CORER, GLOBR, * or EMPR has occurred. The grst delay value is in 100ms units.
@@ -1170,8 +1170,10 @@ int ice_check_reset(struct ice_hw *hw) uld_mask =ICE_RESET_DONE_MASK ; + reset_wait_cnt =ICE_PF_RESET_WAIT_COUNT ; +/* Device is Active; check Global Reset processes are done */ -for (cnt =0 ; cnt <ICE_PF_RESET_WAIT_COUNT ; cnt++) { +for (cnt =0 ; cnt < reset_wait_cnt; cnt++) { reg =rd32 (hw,GLNVM_ULD ) & uld_mask;if (reg == uld_mask) {ice_debug (hw,ICE_DBG_INIT ,"Global reset processes done. %d\n" , cnt);
@@ -1180,7 +1182,7 @@ int ice_check_reset(struct ice_hw *hw)ice_msec_delay (10 , true); } -if (cnt ==ICE_PF_RESET_WAIT_COUNT ) { +if (cnt == reset_wait_cnt) {ice_debug (hw,ICE_DBG_INIT ,"Wait for Reset Done timed out. GLNVM_ULD = 0x%x\n" , reg);return ICE_ERR_RESET_FAILED ;
Signature · 1 line
2.43.0
PATCH v2 135/148 net/ice/base: fix ice_get_ctx() issue
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
No need to invert mask since we only reserve the masked bits instead of clear them.
--- drivers/net/ice/base/ice_common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ice/base/ice_common.c +4 -4
@@ -5044,7 +5044,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)ice_memcpy (&dest_byte, src,sizeof (dest_byte),ICE_NONDMA_TO_NONDMA ); - dest_byte &= ~(mask); + dest_byte &= mask; dest_byte >>= shift_width;
@@ -5084,7 +5084,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* the data in the memory is stored as little endian so mask it * correctly */ - src_word &= ~(CPU_TO_LE16 (mask)); + src_word &=CPU_TO_LE16 (mask);/* get the data back into host order before shifting */ dest_word =LE16_TO_CPU (src_word);
@@ -5135,7 +5135,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* the data in the memory is stored as little endian so mask it * correctly */ - src_dword &= ~(CPU_TO_LE32 (mask)); + src_dword &=CPU_TO_LE32 (mask);/* get the data back into host order before shifting */ dest_dword =LE32_TO_CPU (src_dword);
@@ -5186,7 +5186,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)/* the data in the memory is stored as little endian so mask it * correctly */ - src_qword &= ~(CPU_TO_LE64 (mask)); + src_qword &=CPU_TO_LE64 (mask);/* get the data back into host order before shifting */ dest_qword =LE64_TO_CPU (src_qword);
Signature · 1 line
2.43.0
PATCH v2 136/148 net/ice/base: add AQ function to configure SyncE error reporting
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
The AE driver will call this function to enable the SyncE error reporting mechanism and enable event reporting when errors occur.
--- drivers/net/ice/base/ice_common.c | 29 +++++++++++++++++++++++++++++ drivers/net/ice/base/ice_common.h | 3 +++ 2 files changed, 32 insertions(+)
drivers/net/ice/base/ice_common.c +29 -0
@@ -5501,6 +5501,35 @@ ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u16 tc_bitmap, ICE_SCHED_NODE_OWNER_LAN); } +/** +* ice_aq_cfg_cgu_err +* @hw: pointer to the HW struct +* @ena_event_report: enable or disable event reporting +* @ena_err_report: enable/re-enable or disable error reporting mechanism +* @cd: pointer to command details structure or NULL +* +* Configure CGU error reporting mechanism (0x0C60) +*/ +int +ice_aq_cfg_cgu_err (struct ice_hw *hw,bool ena_event_report, +bool ena_err_report,struct ice_sq_cd *cd) +{ +struct ice_aqc_cfg_cgu_err *cmd; +struct ice_aq_desc desc; + + cmd = &desc.params.config_cgu_err; + +ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_cfg_cgu_err); + +if (!ena_event_report) + cmd->cmd |=ICE_AQC_CFG_CGU_EVENT_DIS ; + +if (!ena_err_report) + cmd->cmd |=ICE_AQC_CFG_CGU_ERR_DIS ; + +return ice_aq_send_cmd (hw, &desc,NULL ,0 , cd); +} +/** * ice_aq_get_sensor_reading * @hw: pointer to the HW struct
drivers/net/ice/base/ice_common.h +3 -0
@@ -270,6 +270,9 @@ void ice_sbq_lock(struct ice_hw *hw);void ice_sbq_unlock (struct ice_hw *hw);int ice_sbq_rw_reg (struct ice_hw *hw,struct ice_sbq_msg_input *in,u16 flag);int +ice_aq_cfg_cgu_err (struct ice_hw *hw,bool ena_event_report,bool ena_err_report, +struct ice_sq_cd *cd); +int ice_aq_get_sensor_reading (struct ice_hw *hw,u8 sensor,u8 format,struct ice_aqc_get_sensor_reading_resp *data,struct ice_sq_cd *cd);
Signature · 1 line
2.43.0
PATCH v2 137/148 net/ice/base: support DCF query port ETS adminq
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
In the adminq command query port ETS function, the root node teid is needed. However, for DCF, the root node is not initialized at parent HW init stage, which will cause error when we refer to the variable. In this patch, we will check whether the root node is available or not first. If not available in DCF case, after receiving virtchnl message, PF will add the root node info before sending adminq command to FW.
--- drivers/net/ice/base/ice_dcb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_dcb.c +2 -3
@@ -1559,12 +1559,11 @@ ice_aq_query_port_ets(struct ice_port_info *pi,struct ice_aq_desc desc;int status; -if (!pi) +if (!pi || !pi->root)return ICE_ERR_PARAM ; cmd = &desc.params.port_ets;ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_query_port_ets); -if (pi->root) - cmd->port_teid = pi->root->info.node_teid; + cmd->port_teid = pi->root->info.node_teid; status =ice_aq_send_cmd (pi->hw, &desc, buf, buf_size, cd);return status;
Signature · 1 line
2.43.0
Re: [PATCH v2 137/148] net/ice/base: support DCF query port ETS adminq
Quoted 9 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
In the adminq command query port ETS function, the root node teid is needed. However, for DCF, the root node is not initialized at parent HW init stage, which will cause error when we refer to the variable. In this patch, we will check whether the root node is available or not first. If not available in DCF case, after receiving virtchnl message, PF will add the root node info before sending adminq command to FW.
Quoted 3 lines
Signed-off-by Ting Xu <[email protected]>Signed-off-by Ian Stokes <[email protected]>---
Validation has thrown up some issues with this change when used with our DCF driver, so this patch should be dropped from the patchset for 24.07.
/Bruce
Quoted 25 lines
drivers/net/ice/base/ice_dcb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/net/ice/base/ice_dcb.c +2
-3@@ -1559,12 +1559,11 @@ ice_aq_query_port_ets(struct ice_port_info *pi,struct ice_aq_desc desc;int status; -if (!pi) +if (!pi || !pi->root)return ICE_ERR_PARAM ; cmd = &desc.params.port_ets;ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_query_port_ets); -if (pi->root) - cmd->port_teid = pi->root->info.node_teid; + cmd->port_teid = pi->root->info.node_teid; status =ice_aq_send_cmd (pi->hw, &desc, buf, buf_size, cd);return status;Signature · 1 line
2.43.0
PATCH v2 138/148 net/ice/base: update boost struct for traffic types
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Update boost struc to support both udp and vlan based on union.
--- drivers/net/ice/base/ice_flex_type.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_flex_type.h +10 -2
@@ -382,8 +382,16 @@ struct ice_sw_fv_list_entry {struct ice_boost_key_value {#define ICE_BOOST_REMAINING_HV_KEY 15u8 remaining_hv_key[ICE_BOOST_REMAINING_HV_KEY ]; -__le16 hv_dst_port_key; -__le16 hv_src_port_key; +union { +struct { +__le16 hv_dst_port_key; +__le16 hv_src_port_key; + }/* udp_tunnel */ ; +struct { +__le16 hv_vlan_id_key; +__le16 hv_etype_key; + } vlan; + };u8 tcam_search_key; };#pragma pack()
Signature · 1 line
2.43.0
PATCH v2 139/148 net/ice/base: clean up ice_lan_tx_rx
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
ice_lan_tx_rx currently is missing various defines and structs. These must be in place to match sharedcode for ice devices. Add these defines which include
- TIMESYNC defines
- Doorbell CTX defines and struct
--- drivers/net/ice/base/ice_lan_tx_rx.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_lan_tx_rx.h +26 -2
@@ -162,7 +162,6 @@ struct ice_fltr_desc {#define ICE_FXD_FLTR_QW1_FDID_PRI_S 25#define ICE_FXD_FLTR_QW1_FDID_PRI_M (0x7ULL << ICE_FXD_FLTR_QW1_FDID_PRI_S) -#define ICE_FXD_FLTR_QW1_FDID_PRI_ZERO 0x0ULL#define ICE_FXD_FLTR_QW1_FDID_PRI_ONE 0x1ULL#define ICE_FXD_FLTR_QW1_FDID_PRI_THREE 0x3ULL
@@ -284,6 +283,7 @@ enum ice_rx_desc_error_l3l4e_masks {enum ice_rx_l2_ptype {ICE_RX_PTYPE_L2_RESERVED =0 ,ICE_RX_PTYPE_L2_MAC_PAY2 =1 , +ICE_RX_PTYPE_L2_TIMESYNC_PAY2 =2 ,ICE_RX_PTYPE_L2_FIP_PAY2 =3 ,ICE_RX_PTYPE_L2_OUI_PAY2 =4 ,ICE_RX_PTYPE_L2_MACCNTRL_PAY2 =5 ,
@@ -343,6 +343,7 @@ enum ice_rx_ptype_inner_prot {ICE_RX_PTYPE_INNER_PROT_TCP =2 ,ICE_RX_PTYPE_INNER_PROT_SCTP =3 ,ICE_RX_PTYPE_INNER_PROT_ICMP =4 , + ICE_RX_PTYPE_INNER_PROT_TIMESYNC = 5, }; enum ice_rx_ptype_payload_layer {
@@ -931,6 +932,8 @@ enum ice_rx_flex_desc_exstat_bits {#define ICE_RXQ_CTX_SIZE_DWORDS 8#define ICE_RXQ_CTX_SZ (ICE_RXQ_CTX_SIZE_DWORDS * sizeof(u32)) +#define ICE_TXQ_CTX_SIZE_DWORDS 10 +#define ICE_TXQ_CTX_SZ (ICE_TXQ_CTX_SIZE_DWORDS * sizeof(u32))#define ICE_TX_CMPLTNQ_CTX_SIZE_DWORDS 22#define ICE_TX_DRBELL_Q_CTX_SIZE_DWORDS 5#define GLTCLAN_CQ_CNTX (i,CQ ) (GLTCLAN_CQ_CNTX0(CQ) + ((i) * 0x0800))
@@ -1071,7 +1074,7 @@ enum ice_tx_desc_len_fields {struct ice_tx_ctx_desc {__le32 tunneling_params;__le16 l2tag2; -__le16 gsc; +__le16 gcs;__le64 qw1; };
@@ -1191,6 +1194,7 @@ struct ice_tlan_ctx {u8 pkt_shaper_prof_idx;u8 gsc_ena;u8 int_q_state;/* width not needed - internal - DO NOT WRITE!!! */ +u16 tail; };/* LAN Tx Completion Queue data */
@@ -1207,6 +1211,7 @@ struct ice_tx_cmpltnq {#pragma pack(1)struct ice_tx_cmpltnq_ctx {u64 base; +#define ICE_TX_CMPLTNQ_CTX_BASE_S 7u32 q_len;#define ICE_TX_CMPLTNQ_CTX_Q_LEN_S 4u8 generation;
@@ -1214,6 +1219,9 @@ struct ice_tx_cmpltnq_ctx {u8 pf_num;u16 vmvf_num;u8 vmvf_type; +#define ICE_TX_CMPLTNQ_CTX_VMVF_TYPE_VF 0 +#define ICE_TX_CMPLTNQ_CTX_VMVF_TYPE_VMQ 1 +#define ICE_TX_CMPLTNQ_CTX_VMVF_TYPE_PF 2u8 tph_desc_wr;u8 cpuid;u32 cmpltn_cache[16 ];
@@ -1228,15 +1236,30 @@ struct ice_tx_drbell_fmt {u32 db; }; +/* FIXME: move to a .c file that references this variable */ +/* LAN Tx Doorbell Descriptor format info */ +static const struct ice_ctx_ele ice_tx_drbell_fmt_info[] = { +/* Field Width LSB */ +ICE_CTX_STORE (ice_tx_drbell_fmt, txq_id,14 ,0 ), +ICE_CTX_STORE (ice_tx_drbell_fmt, dd,1 ,14 ), +ICE_CTX_STORE (ice_tx_drbell_fmt, rs,1 ,15 ), +ICE_CTX_STORE (ice_tx_drbell_fmt, db,32 ,32 ), + {0 } +};/* LAN Tx Doorbell Queue Context */ #pragma pack(1)struct ice_tx_drbell_q_ctx {u64 base; +#define ICE_TX_DRBELL_Q_CTX_BASE_S 7u16 ring_len; +#define ICE_TX_DRBELL_Q_CTX_RING_LEN_S 4u8 pf_num;u16 vf_num;u8 vmvf_type; +#define ICE_TX_DRBELL_Q_CTX_VMVF_TYPE_VF 0 +#define ICE_TX_DRBELL_Q_CTX_VMVF_TYPE_VMQ 1 +#define ICE_TX_DRBELL_Q_CTX_VMVF_TYPE_PF 2u8 cpuid;u8 tph_desc_rd;u8 tph_desc_wr;
@@ -1286,6 +1309,7 @@ struct ice_tx_drbell_q_ctx {/* shorter macros makes the table fit but are terse */ #define ICE_RX_PTYPE_NOF ICE_RX_PTYPE_NOT_FRAG#define ICE_RX_PTYPE_FRG ICE_RX_PTYPE_FRAG +#define ICE_RX_PTYPE_INNER_PROT_TS ICE_RX_PTYPE_INNER_PROT_TIMESYNC/* Lookup table mapping the 10-bit HW PTYPE to the bit field for decoding */ static const struct ice_rx_ptype_decoded ice_ptype_lkup[1024 ] = {
Signature · 1 line
2.43.0
PATCH v2 140/148 net/ice/base: enable CGU error reporting
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Enable CGU error reporting for SyncE and TimeSync issues. Process TimeSync loss of lock event by trying to acquire lock with the default config.
--- drivers/net/ice/base/ice_ptp_hw.c | 49 ++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_ptp_hw.c +48 -1
@@ -787,7 +787,49 @@ static int ice_init_cgu_e82x(struct ice_hw *hw) }/** -* @ice_ptp_tmr_cmd_to_src_reg - Convert to source timer command value +* ice_ptp_cgu_err_reporting - Enable/disable error reporting for CGU +* @hw: pointer to HW struct +* @enable: true if reporting should be enabled +* +* Enable or disable error events to be reported through Admin Queue. +* +* Return: 0 on success, error code otherwise +*/ +static int ice_ptp_cgu_err_reporting (struct ice_hw *hw,bool enable) +{ +int err; + + err =ice_aq_cfg_cgu_err (hw, enable, enable,NULL ); +if (err) { +ice_debug (hw,ICE_DBG_PTP , +"Failed to %s CGU error reporting, err %d\n" , + enable ?"enable" :"disable" , err); +return err; + } + +return 0 ; +} + +/** +* ice_ptp_process_cgu_err - Handle reported CGU error +* @hw: pointer to HW struct +* @event: reported CGU error descriptor +*/ +void ice_ptp_process_cgu_err (struct ice_hw *hw,struct ice_rq_event_info *event) +{ +u8 err_type = event->desc.params.cgu_err.err_type; + +if (err_type &ICE_AQC_CGU_ERR_TIMESYNC_LOCK_LOSS ) { +ice_warn (hw,"TimeSync PLL lock lost. Retrying to acquire lock with default PLL configuration.\n" ); +ice_init_cgu_e82x (hw); + } + +/* Reenable CGU error reporting */ +ice_ptp_cgu_err_reporting (hw, true); +} + +/** +* ice_ptp_tmr_cmd_to_src_reg - Convert to source timer command value * @hw: pointer to HW struct * @cmd: Timer command *
@@ -3014,6 +3056,11 @@ static int ice_ptp_init_phc_e822(struct ice_hw *hw)if (err)return err; +/* Enable CGU error reporting */ + err =ice_ptp_cgu_err_reporting (hw, true); +if (err) +return err; +/* Set window length for all the ports */ return ice_ptp_set_vernier_wl (hw); }
Signature · 1 line
2.43.0
Re: [PATCH v2 140/148] net/ice/base: enable CGU error reporting
Quoted 11 lines · Anatoly Burakov
From: Ian Stokes <[email protected]>
Enable CGU error reporting for SyncE and TimeSync issues. Process TimeSync loss of lock event by trying to acquire lock with the default config.
Signed-off-by Karol Kolacinski <[email protected]>Signed-off-by Ian Stokes <[email protected]>--- drivers/net/ice/base/ice_ptp_hw.c | 49 ++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-)
Possible candidate for merge with patch 136?
/Bruce
PATCH v2 141/148 net/ice/base: cleanup timestamp registers correctly
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
E822 PHY TS registers should not be written and the only way to cleanup them is to reset QUAD memory.
To ensure that the status bit for the timestamp index is cleared, ensure that ice_clear_phy_tstamp implementations first read the timestamp out. Implementations which can write the register continue to do so.
Add a note to indicate this function should only be called on timestamps which have their valid bit set.
--- drivers/net/ice/base/ice_ptp_hw.c | 63 +++++++++++++++++-------------- 1 file changed, 34 insertions(+), 29 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +34 -29
@@ -1554,8 +1554,18 @@ static int ice_clear_phy_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx) { int err; +u64 unused_tstamp;u16 lo_addr; +/* Read the timestamp register to ensure the timestamp status bit is +* cleared. +*/ + err =ice_read_phy_tstamp_eth56g (hw, port, idx, &unused_tstamp); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read the PHY timestamp register for port %u, idx %u, err %d\n" , + port, idx, err); + } + lo_addr = (u16 )PHY_TSTAMP_L (idx); err =ice_phy_port_mem_write_eth56g (hw, port, lo_addr,0 );
@@ -2955,25 +2965,16 @@ ice_read_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx, u64 *tstamp)* This function should only be called on an idx whose bit is set according to * ice_get_phy_tx_tstamp_ready(). */ -static int ice_clear_phy_tstamp_e822 (struct ice_hw *hw,u8 quad,u8 idx) +static int +ice_clear_phy_tstamp_e822 (struct ice_hw *hw,u8 quad,u8 idx) { +u64 unused_tstamp;int err; -u16 lo_addr, hi_addr; - lo_addr = (u16 )TS_L (Q_REG_TX_MEMORY_BANK_START , idx); - hi_addr = (u16 )TS_H (Q_REG_TX_MEMORY_BANK_START , idx); - - err =ice_write_quad_reg_e822 (hw, quad, lo_addr,0 ); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to clear low PTP timestamp register, err %d\n" , - err); -return err; - } - - err =ice_write_quad_reg_e822 (hw, quad, hi_addr,0 ); + err =ice_read_phy_tstamp_e822 (hw, quad, idx, &unused_tstamp);if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to clear high PTP timestamp register, err %d\n" , - err); +ice_debug (hw,ICE_DBG_PTP ,"Failed to read the timestamp register for quad %u, idx %u, err %d\n" , + quad, idx, err);return err; }
@@ -4902,40 +4903,44 @@ ice_read_phy_tstamp_e810(struct ice_hw *hw, u8 lport, u8 idx, u64 *tstamp) }/** -* ice_clear_phy_tstamp - Clear a timestamp from the timestamp block +* ice_clear_phy_tstamp_e810 - Clear a timestamp from the external PHY * @hw: pointer to the HW struct * @lport: the lport to read from * @idx: the timestamp index to reset * -* Clear a timestamp from the timestamp block, discarding its value without -* returning it. This resets the memory err bit for the timestamp index -* allowing it to be reused for another timestamp in the future. +* Read the timestamp and then forcibly overwrite its value to clear the valid +* bit from the timestamp block of the external PHY on the E810 device. * -* For E822 devices, the block number is the PHY quad to clear from. For E810 -* devices, the block number is the logical port to clear from. -* -* This function must only be called on a timestamp index whose valid bit is -* set according to ice_get_phy_tx_tstamp_ready(). +* This function should only be called on an idx whose bit is set according to +* ice_get_phy_tx_tstamp_ready(). */ static int ice_clear_phy_tstamp_e810 (struct ice_hw *hw,u8 lport,u8 idx) { -int err;u32 lo_addr, hi_addr; +u64 unused_tstamp; +int err; + + err =ice_read_phy_tstamp_e810 (hw, lport, idx, &unused_tstamp); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read the timestamp register for lport %u, idx %u, err %d\n" , + lport, idx, err); +return err; + } lo_addr =TS_EXT (LOW_TX_MEMORY_BANK_START , lport, idx); hi_addr =TS_EXT (HIGH_TX_MEMORY_BANK_START , lport, idx); err =ice_write_phy_reg_e810 (hw, lo_addr,0 );if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to clear low PTP timestamp register, err %d\n" , - err); +ice_debug (hw,ICE_DBG_PTP ,"Failed to clear low PTP timestamp register for lport %u, idx %u, err %d\n" , + lport, idx, err);return err; } err =ice_write_phy_reg_e810 (hw, hi_addr,0 );if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to clear high PTP timestamp register, err %d\n" , - err); +ice_debug (hw,ICE_DBG_PTP ,"Failed to clear high PTP timestamp register for lport %u, idx %u, err %d\n" , + lport, idx, err);return err; }
Signature · 1 line
2.43.0
PATCH v2 142/148 net/ice/base: rework multiple functions
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Multpiple functions that have been implemented, rework and removed are contained in this patch. Specifaclly the patch combines the following commits:
- Implement TX interrupt enablement functions.
Introduce functions enabling/disabling TX TS interrupts for the E822 and ETH56G PHYs
- Remove bypass modeRemove bypass mode.
Previous implementation switches between bypass and Vernier mode dynamically. However bypass mode should be removed due to low precision.
- Make Tx and Rx vernier offset calibration independent. The Tx and Rx calibration and timestamp generation blocks are independent. It is not required to wait for both to complete before programming the offsets. Instead, we can program the offset for each independently as soon as they are ready.
Remove the ice_phy_calc_vernier_e822 function. Modify the ice_phy_cfg_tx_offset_e822 and ice_phy_cfg_rx_offset_e822 functions with the following additions:
a) Check the relevant P_REG_*_OR bit first and do nothing if the offset has already been programmed
b) Check the P_REG_*_OV_STATUS bit to determine if the offset status is ready, meaning that the hardware vernier calibration steps have completed. Return ICE_ERR_NOT_READY if the offset is not yet read.
The driver can now simply call ice_phy_cfg_rx_offset_e822 and ice_phy_cfg_tx_offset_e822 periodically until the offsets have been programmed.
In this way, the Tx and Rx blocks will be enabled independently without each waiting on the other block to complete. This can enable faster calibration on some setups which have a low rate of either Tx or Rx traffic.
--- drivers/net/ice/base/ice_ptp_hw.c | 282 +++++++++++------------------- drivers/net/ice/base/ice_ptp_hw.h | 10 +- drivers/net/ice/ice_ethdev.c | 2 +- 3 files changed, 112 insertions(+), 182 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +105 -177
@@ -2040,6 +2040,41 @@ int ice_phy_cfg_rx_offset_eth56g(struct ice_hw *hw, u8 port)return ice_write_phy_reg_eth56g (hw, port,PHY_REG_RX_OFFSET_READY ,1 ); } +/** +* ice_phy_cfg_intr_eth56g - Configure TX timestamp interrupt +* @hw: pointer to the HW struct +* @port: the timestamp port +* @ena: enable or disable interrupt +* @threshold: interrupt threshold +* +* Configure TX timestamp interrupt for the specified port +*/ + +int +ice_phy_cfg_intr_eth56g (struct ice_hw *hw,u8 port,bool ena,u8 threshold) +{ +int err; +u32 val; + + err =ice_read_phy_reg_eth56g (hw, port,PHY_REG_TS_INT_CONFIG , + &val); +if (err) +return err; + +if (ena) { + val |=PHY_TS_INT_CONFIG_ENA_M ; + val &= ~PHY_TS_INT_CONFIG_THRESHOLD_M ; + val |= ((threshold <<PHY_TS_INT_CONFIG_THRESHOLD_S ) & +PHY_TS_INT_CONFIG_THRESHOLD_M ); + }else { + val &= ~PHY_TS_INT_CONFIG_ENA_M ; + } + + err =ice_write_phy_reg_eth56g (hw, port,PHY_REG_TS_INT_CONFIG , + val); +return err; +} +/** * ice_ptp_clear_phy_offset_ready_eth56g - Clear PHY OFFSET_READY registers * @hw: pointer to the HW struct
@@ -2228,7 +2263,6 @@ ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset)* ice_start_phy_timer_eth56g - Start the PHY clock timer * @hw: pointer to the HW struct * @port: the PHY port to start -* @bypass: unused, for compatibility * * Start the clock of a PHY port. This must be done as part of the flow to * re-calibrate Tx and Rx timestamping offsets whenever the clock time is
@@ -2236,7 +2270,7 @@ ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset)* */ int -ice_start_phy_timer_eth56g (struct ice_hw *hw,u8 port,bool bypass) +ice_start_phy_timer_eth56g (struct ice_hw *hw,u8 port) {int err;u32 lo, hi;
@@ -3837,6 +3871,28 @@ int ice_phy_cfg_tx_offset_e822(struct ice_hw *hw, u8 port)enum ice_ptp_fec_mode fec_mode;u64 total_offset, val;int err; +u32 reg; + +/* Nothing to do if we've already programmed the offset */ + err =ice_read_phy_reg_e822 (hw, port,P_REG_TX_OR , ®); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read TX_OR for port %u, err %d\n" , + port, err); +return err; + } + +if (reg) +return 0 ; + + err =ice_read_phy_reg_e822 (hw, port,P_REG_TX_OV_STATUS , ®); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read TX_OV_STATUS for port %u, err %d\n" , + port, err); +return err; + } + +if (!(reg &P_REG_TX_OV_STATUS_OV_M )) +return ICE_ERR_NOT_READY ; err =ice_phy_get_speed_and_fec_e822 (hw, port, &link_spd, &fec_mode);if (err)
@@ -3894,47 +3950,6 @@ int ice_phy_cfg_tx_offset_e822(struct ice_hw *hw, u8 port)return 0 ; } -/** -* ice_phy_cfg_fixed_tx_offset_e822 - Configure Tx offset for bypass mode -* @hw: pointer to the HW struct -* @port: the PHY port to configure -* -* Calculate and program the fixed Tx offset, and indicate that the offset is -* ready. This can be used when operating in bypass mode. -*/ -static int -ice_phy_cfg_fixed_tx_offset_e822 (struct ice_hw *hw,u8 port) -{ -enum ice_ptp_link_spd link_spd; -enum ice_ptp_fec_mode fec_mode; -int err; -u64 total_offset; - - err =ice_phy_get_speed_and_fec_e822 (hw, port, &link_spd, &fec_mode); -if (err) -return err; - - total_offset =ice_calc_fixed_tx_offset_e822 (hw, link_spd); - -/* Program the fixed Tx offset into the P_REG_TOTAL_TX_OFFSET_L -* register, then indicate that the Tx offset is ready. After this, -* timestamps will be enabled. -* -* Note that this skips including the more precise offsets generated -* by the Vernier calibration. -*/ - err =ice_write_64b_phy_reg_e822 (hw, port,P_REG_TOTAL_TX_OFFSET_L , - total_offset); -if (err) -return err; - - err =ice_write_phy_reg_e822 (hw, port,P_REG_TX_OR ,1 ); -if (err) -return err; - -return 0 ; -} -/** * ice_phy_calc_pmd_adj_e822 - Calculate PMD adjustment for Rx * @hw: pointer to the HW struct
@@ -4157,6 +4172,28 @@ int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port)enum ice_ptp_fec_mode fec_mode;u64 total_offset, pmd, val;int err; +u32 reg; + +/* Nothing to do if we've already programmed the offset */ + err =ice_read_phy_reg_e822 (hw, port,P_REG_RX_OR , ®); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read RX_OR for port %u, err %d\n" , + port, err); +return err; + } + +if (reg) +return 0 ; + + err =ice_read_phy_reg_e822 (hw, port,P_REG_RX_OV_STATUS , ®); +if (err) { +ice_debug (hw,ICE_DBG_PTP ,"Failed to read RX_OV_STATUS for port %u, err %d\n" , + port, err); +return err; + } + +if (!(reg &P_REG_RX_OV_STATUS_OV_M )) +return ICE_ERR_NOT_READY ; err =ice_phy_get_speed_and_fec_e822 (hw, port, &link_spd, &fec_mode);if (err)
@@ -4253,47 +4290,6 @@ static int ice_ptp_clear_phy_offset_ready_e822(struct ice_hw *hw)return 0 ; } -/** -* ice_phy_cfg_fixed_rx_offset_e822 - Configure fixed Rx offset for bypass mode -* @hw: pointer to the HW struct -* @port: the PHY port to configure -* -* Calculate and program the fixed Rx offset, and indicate that the offset is -* ready. This can be used when operating in bypass mode. -*/ -static int -ice_phy_cfg_fixed_rx_offset_e822 (struct ice_hw *hw,u8 port) -{ -enum ice_ptp_link_spd link_spd; -enum ice_ptp_fec_mode fec_mode; -int err; -u64 total_offset; - - err =ice_phy_get_speed_and_fec_e822 (hw, port, &link_spd, &fec_mode); -if (err) -return err; - - total_offset =ice_calc_fixed_rx_offset_e822 (hw, link_spd); - -/* Program the fixed Rx offset into the P_REG_TOTAL_RX_OFFSET_L -* register, then indicate that the Rx offset is ready. After this, -* timestamps will be enabled. -* -* Note that this skips including the more precise offsets generated -* by Vernier calibration. -*/ - err =ice_write_64b_phy_reg_e822 (hw, port,P_REG_TOTAL_RX_OFFSET_L , - total_offset); -if (err) -return err; - - err =ice_write_phy_reg_e822 (hw, port,P_REG_RX_OR ,1 ); -if (err) -return err; - -return 0 ; -} -/** * ice_read_phy_and_phc_time_e822 - Simultaneously capture PHC and PHY time * @hw: pointer to the HW struct
@@ -4474,19 +4470,14 @@ ice_stop_phy_timer_e822(struct ice_hw *hw, u8 port, bool soft_reset)* ice_start_phy_timer_e822 - Start the PHY clock timer * @hw: pointer to the HW struct * @port: the PHY port to start -* @bypass: if true, start the PHY in bypass mode * * Start the clock of a PHY port. This must be done as part of the flow to * re-calibrate Tx and Rx timestamping offsets whenever the clock time is * initialized or when link speed changes. * -* Bypass mode enables timestamps immediately without waiting for Vernier -* calibration to complete. Hardware will still continue taking Vernier -* measurements on Tx or Rx of packets, but they will not be applied to -* timestamps. Use ice_phy_exit_bypass_e822 to exit bypass mode once hardware -* has completed offset calculation. +* Hardware will take Vernier measurements on Tx or Rx of packets. */ -int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port,bool bypass) +int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port) {u32 lo, hi, val;u64 incval;
@@ -4567,23 +4558,6 @@ int ice_start_phy_timer_e822(struct ice_hw *hw, u8 port, bool bypass)if (err)return err; -if (bypass) { - val |=P_REG_PS_BYPASS_MODE_M ; -/* Enter BYPASS mode, enabling timestamps immediately. */ - err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val); -if (err) -return err; - -/* Program the fixed Tx offset */ - err =ice_phy_cfg_fixed_tx_offset_e822 (hw, port); -if (err) -return err; - -/* Program the fixed Rx offset */ - err =ice_phy_cfg_fixed_rx_offset_e822 (hw, port); -if (err) -return err; - }ice_debug (hw,ICE_DBG_PTP ,"Enabled clock on PHY port %u\n" , port);
@@ -4626,87 +4600,41 @@ ice_get_phy_tx_tstamp_ready_e822(struct ice_hw *hw, u8 quad, u64 *tstamp_ready) }/** -* ice_phy_exit_bypass_e822 - Exit bypass mode, after vernier calculations +* ice_phy_cfg_intr_e822 - Configure TX timestamp interrupt * @hw: pointer to the HW struct -* @port: the PHY port to configure +* @quad: the timestamp quad +* @ena: enable or disable interrupt +* @threshold: interrupt threshold * -* After hardware finishes vernier calculations for the Tx and Rx offset, this -* function can be used to exit bypass mode by updating the total Tx and Rx -* offsets, and then disabling bypass. This will enable hardware to include -* the more precise offset calibrations, increasing precision of the generated -* timestamps. -* -* This cannot be done until hardware has measured the offsets, which requires -* waiting until at least one packet has been sent and received by the device. +* Configure TX timestamp interrupt for the specified quad */ -int ice_phy_exit_bypass_e822 (struct ice_hw *hw,u8 port) + +int +ice_phy_cfg_intr_e822 (struct ice_hw *hw,u8 quad,bool ena,u8 threshold) {int err;u32 val; - err =ice_read_phy_reg_e822 (hw, port,P_REG_TX_OV_STATUS , &val); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to read TX_OV_STATUS for port %u, err %d\n" , - port, err); + err =ice_read_quad_reg_e822 (hw, quad, +Q_REG_TX_MEM_GBL_CFG , + &val); +if (err)return err; - } - -if (!(val &P_REG_TX_OV_STATUS_OV_M )) { -ice_debug (hw,ICE_DBG_PTP ,"Tx offset is not yet valid for port %u\n" , - port); -return ICE_ERR_NOT_READY ; - } - - err =ice_read_phy_reg_e822 (hw, port,P_REG_RX_OV_STATUS , &val); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to read RX_OV_STATUS for port %u, err %d\n" , - port, err); -return err; - } - -if (!(val &P_REG_TX_OV_STATUS_OV_M )) { -ice_debug (hw,ICE_DBG_PTP ,"Rx offset is not yet valid for port %u\n" , - port); -return ICE_ERR_NOT_READY ; - } - err =ice_phy_cfg_tx_offset_e822 (hw, port); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to program total Tx offset for port %u, err %d\n" , - port, err); -return err; - } - - err =ice_phy_cfg_rx_offset_e822 (hw, port); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to program total Rx offset for port %u, err %d\n" , - port, err); -return err; - } - -/* Exit bypass mode now that the offset has been updated */ - err =ice_read_phy_reg_e822 (hw, port,P_REG_PS , &val); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to read P_REG_PS for port %u, err %d\n" , - port, err); -return err; - } - -if (!(val &P_REG_PS_BYPASS_MODE_M )) -ice_debug (hw,ICE_DBG_PTP ,"Port %u not in bypass mode\n" , - port); - - val &= ~P_REG_PS_BYPASS_MODE_M ; - err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val); -if (err) { -ice_debug (hw,ICE_DBG_PTP ,"Failed to disable bypass for port %u, err %d\n" , - port, err); -return err; +if (ena) { + val |=Q_REG_TX_MEM_GBL_CFG_INTR_ENA_M ; + val &= ~Q_REG_TX_MEM_GBL_CFG_INTR_THR_M ; + val |= ((threshold <<Q_REG_TX_MEM_GBL_CFG_INTR_THR_S ) & +Q_REG_TX_MEM_GBL_CFG_INTR_THR_M ); + }else { + val &= ~Q_REG_TX_MEM_GBL_CFG_INTR_ENA_M ; } -ice_info (hw,"Exiting bypass mode on PHY port %u\n" , port); + err =ice_write_quad_reg_e822 (hw, quad, +Q_REG_TX_MEM_GBL_CFG , + val); -return 0 ; +return err; }/* E810 functions
drivers/net/ice/base/ice_ptp_hw.h +6 -4
@@ -256,11 +256,11 @@ ice_phy_get_speed_and_fec_e822(struct ice_hw *hw, u8 port,void ice_phy_cfg_lane_e822 (struct ice_hw *hw,u8 port);int ice_stop_phy_timer_e822 (struct ice_hw *hw,u8 port,bool soft_reset); -int -ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port,bool bypass); +int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port);int ice_phy_cfg_tx_offset_e822 (struct ice_hw *hw,u8 port);int ice_phy_cfg_rx_offset_e822 (struct ice_hw *hw,u8 port); -int ice_phy_exit_bypass_e822 (struct ice_hw *hw,u8 port); +int +ice_phy_cfg_intr_e822 (struct ice_hw *hw,u8 quad,bool ena,u8 threshold);/* E810 family functions */ int ice_ptp_init_phy_e810 (struct ice_hw *hw);
@@ -301,9 +301,11 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status);int ice_stop_phy_timer_eth56g (struct ice_hw *hw,u8 port,bool soft_reset);int -ice_start_phy_timer_eth56g (struct ice_hw *hw,u8 port,bool bypass); +ice_start_phy_timer_eth56g (struct ice_hw *hw,u8 port);int ice_phy_cfg_tx_offset_eth56g (struct ice_hw *hw,u8 port);int ice_phy_cfg_rx_offset_eth56g (struct ice_hw *hw,u8 port); +int +ice_phy_cfg_intr_eth56g (struct ice_hw *hw,u8 port,bool ena,u8 threshold);#define ICE_ETH56G_PLL_FREQ 800000000#define ICE_ETH56G_NOMINAL_INCVAL 0x140000000ULL
drivers/net/ice/ice_ethdev.c +1 -1
@@ -2504,7 +2504,7 @@ ice_dev_init(struct rte_eth_dev *dev) hw->phy_model =ICE_PHY_E822 ;if (hw->phy_model ==ICE_PHY_E822 ) { - ret =ice_start_phy_timer_e822 (hw, hw->pf_id, true); + ret =ice_start_phy_timer_e822 (hw, hw->pf_id);if (ret)PMD_INIT_LOG (ERR ,"Failed to start phy timer\n" ); }
Signature · 1 line
2.43.0
PATCH v2 143/148 net/ice/base: change a method to get pca9575 handle
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
More universal method for getting pca9575 handle is introduced. The first step is to look for CLK_MUX handle. Having that it is possible to find CLK_MUX GPIO pin. Provided data let check what is driving the pin - the expectation is that pca9575 node part number is returned.
--- drivers/net/ice/base/ice_ptp_hw.c | 46 +++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +41 -5
@@ -5123,10 +5123,11 @@ ice_get_phy_tx_tstamp_ready_e810(struct ice_hw *hw, u8 port, u64 *tstamp_ready)static int ice_get_pca9575_handle (struct ice_hw *hw,u16 *pca9575_handle) { +u8 node_part_number, idx, node_type_ctx_clk_mux, node_part_num_clk_mux; +struct ice_aqc_get_link_topo_pin cmd_pin; +u16 node_handle, clock_mux_handle;struct ice_aqc_get_link_topo cmd; -u8 node_part_number, idx;int status; -u16 node_handle;if (!hw || !pca9575_handle)return ICE_ERR_PARAM ;
@@ -5138,11 +5139,46 @@ ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle) }memset (&cmd,0 ,sizeof (cmd)); +memset (&cmd_pin,0 ,sizeof (cmd_pin)); -/* Set node type to GPIO controller */ + node_type_ctx_clk_mux = (ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX << +ICE_AQC_LINK_TOPO_NODE_TYPE_S ); + node_type_ctx_clk_mux |= (ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL << +ICE_AQC_LINK_TOPO_NODE_CTX_S ); + node_part_num_clk_mux =ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX ; + +/* Look for CLOCK MUX handle in the netlist */ + status =ice_find_netlist_node (hw, node_type_ctx_clk_mux, + node_part_num_clk_mux, + &clock_mux_handle); +if (status) +return ICE_ERR_NOT_SUPPORTED ; + +/* Take CLOCK MUX GPIO pin */ + cmd_pin.input_io_params = (ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_GPIO << +ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S ); + cmd_pin.input_io_params |= (ICE_AQC_LINK_TOPO_IO_FUNC_CLK_IN << +ICE_AQC_LINK_TOPO_INPUT_IO_FUNC_S ); + cmd_pin.addr.handle =CPU_TO_LE16 (clock_mux_handle); + cmd_pin.addr.topo_params.node_type_ctx = + (ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX << +ICE_AQC_LINK_TOPO_NODE_TYPE_S ); + cmd_pin.addr.topo_params.node_type_ctx |= + (ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED << +ICE_AQC_LINK_TOPO_NODE_CTX_S ); + + status =ice_aq_get_netlist_node_pin (hw, &cmd_pin, &node_handle); +if (status) +return ICE_ERR_NOT_SUPPORTED ; + +/* Check what is driving the pin */ cmd.addr.topo_params.node_type_ctx = - (ICE_AQC_LINK_TOPO_NODE_TYPE_M & -ICE_AQC_LINK_TOPO_NODE_TYPE_GPIO_CTRL ); + (ICE_AQC_LINK_TOPO_NODE_TYPE_GPIO_CTRL << +ICE_AQC_LINK_TOPO_NODE_TYPE_S ); + cmd.addr.topo_params.node_type_ctx |= + (ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL << +ICE_AQC_LINK_TOPO_NODE_CTX_S ); + cmd.addr.handle =CPU_TO_LE16 (node_handle);#define SW_PCA9575_SFP_TOPO_IDX 2#define SW_PCA9575_QSFP_TOPO_IDX 1
Signature · 1 line
2.43.0
PATCH v2 144/148 net/ice/base: rename SMA register macros to match Linux upstream
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
The macros used to define the bits for controlling the SMA are different to what we published upstream. We don't have a strong justification to change the upstream names, so fix the out-of-tree shared code to use the names as published upstream.
--- drivers/net/ice/base/ice_ptp_hw.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/net/ice/base/ice_ptp_hw.h +15 -5
@@ -646,6 +646,21 @@ ice_get_base_incval(struct ice_hw *hw, enum ice_src_tmr_mode src_tmr_mode)#define E830_HIGH_TX_MEMORY_BANK (slot, port) \ (E830_PRTTSYN_TXTIME_H(slot) + 0x8 * (port)) +/* E810T SMA controller pin control */ +#define ICE_SMA1_DIR_EN_E810T BIT(4) +#define ICE_SMA1_TX_EN_E810T BIT(5) +#define ICE_SMA2_UFL2_RX_DIS_E810T BIT(3) +#define ICE_SMA2_DIR_EN_E810T BIT(6) +#define ICE_SMA2_TX_EN_E810T BIT(7) + +#define ICE_SMA1_MASK_E810T (ICE_SMA1_DIR_EN_E810T | \ + ICE_SMA1_TX_EN_E810T) +#define ICE_SMA2_MASK_E810T (ICE_SMA2_UFL2_RX_DIS_E810T | \ + ICE_SMA2_DIR_EN_E810T | \ + ICE_SMA2_TX_EN_E810T) +#define ICE_ALL_SMA_MASK_E810T (ICE_SMA1_MASK_E810T | \ + ICE_SMA2_MASK_E810T) +#define ICE_SMA_MIN_BIT_E810T 3#define ICE_SMA_MAX_BIT_E810T 7#define ICE_PCA9575_P1_OFFSET 8
@@ -660,11 +675,6 @@ ice_get_base_incval(struct ice_hw *hw, enum ice_src_tmr_mode src_tmr_mode)/* E810T PCA9575 IO controller pin control */ #define ICE_E810T_P0_GNSS_PRSNT_N BIT(4) -#define ICE_E810T_P1_SMA1_DIR_EN BIT(4) -#define ICE_E810T_P1_SMA1_TX_EN BIT(5) -#define ICE_E810T_P1_SMA2_UFL2_RX_DIS BIT(3) -#define ICE_E810T_P1_SMA2_DIR_EN BIT(6) -#define ICE_E810T_P1_SMA2_TX_EN BIT(7)/* 56G PHY quad register base addresses */ #define ICE_PHY0_BASE 0x092000
Signature · 1 line
2.43.0
PATCH v2 145/148 net/ice/base: introduce new functions in ice_sched_node
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add new functions to configure the hardware with new parameters.
--- drivers/net/ice/base/ice_sched.c | 52 ++++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_sched.h | 9 ++++++ 2 files changed, 61 insertions(+)
drivers/net/ice/base/ice_sched.c +52 -0
@@ -4418,6 +4418,58 @@ ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node, ICE_AQC_RL_PROFILE_TYPE_M, old_id); } +/** +* ice_sched_set_node_priority - set node's priority +* @pi: port information structure +* @node: tree node +* @priority: number 0-7 representing priority among siblings +* +* This function sets priority of a node among it's siblings. +*/ +int +ice_sched_set_node_priority (struct ice_port_info *pi,struct ice_sched_node *node, +u16 priority) +{ +struct ice_aqc_txsched_elem_data buf; +struct ice_aqc_txsched_elem *data; + + buf = node->info; + data = &buf.data; + + data->valid_sections |=ICE_AQC_ELEM_VALID_GENERIC ; + data->generic |=ICE_AQC_ELEM_GENERIC_PRIO_M & + (priority <<ICE_AQC_ELEM_GENERIC_PRIO_S ); + +return ice_sched_update_elem (pi->hw, node, &buf); +} + +/** +* ice_sched_set_node_weight - set node's weight +* @pi: port information structure +* @node: tree node +* @weight: number 1-200 representing weight for WFQ +* +* This function sets weight of the node for WFQ algorithm. +*/ +int +ice_sched_set_node_weight (struct ice_port_info *pi,struct ice_sched_node *node,u16 weight) +{ +struct ice_aqc_txsched_elem_data buf; +struct ice_aqc_txsched_elem *data; + + buf = node->info; + data = &buf.data; + + data->valid_sections =ICE_AQC_ELEM_VALID_CIR |ICE_AQC_ELEM_VALID_EIR | +ICE_AQC_ELEM_VALID_GENERIC ; + data->cir_bw.bw_alloc =CPU_TO_LE16 (weight); + data->eir_bw.bw_alloc =CPU_TO_LE16 (weight); + data->generic |=ICE_AQC_ELEM_GENERIC_SP_M & + (0x0 <<ICE_AQC_ELEM_GENERIC_SP_S ); + +return ice_sched_update_elem (pi->hw, node, &buf); +} +/** * ice_sched_set_node_bw_lmt - set node's BW limit * @pi: port information structure
drivers/net/ice/base/ice_sched.h +9 -0
@@ -7,6 +7,8 @@#include "ice_common.h" +#define SCHED_NODE_NAME_MAX_LEN 32 +#define ICE_SCHED_5_LAYERS 5#define ICE_SCHED_9_LAYERS 9
@@ -120,6 +122,13 @@ int ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent, u16 num_items, u32 *list); +int +ice_sched_set_node_priority (struct ice_port_info *pi,struct ice_sched_node *node, +u16 priority); +int +ice_sched_set_node_weight (struct ice_port_info *pi,struct ice_sched_node *node, +u16 weight); +int ice_sched_init_port (struct ice_port_info *pi);int ice_sched_query_res_alloc (struct ice_hw *hw);void ice_sched_get_psm_clk_freq (struct ice_hw *hw);
Signature · 1 line
2.43.0
PATCH v2 146/148 net/ice/base: misc header file clean up
In reply to Anatoly BurakovFrom: Ian Stokes <[email protected]>
Add last remaining changes that include defines, structs etc to allign with shared code snapshot.
Add a new function called ice_fls() to the shared code.
The unsigned int ice_fls(u64 n) function finds the Most Significant Bit (MSB) and returns the 1-based index of the bit that was set.
This means if no bits are set it returns 0. If the largest bit set is the last bit in a 64 bit unsigned value, it will return 64.
--- drivers/net/ice/base/ice_type.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
drivers/net/ice/base/ice_type.h +30 -0
@@ -43,6 +43,24 @@ static inline int ice_ilog2(u64 n)return -1 ; } +/** +* ice_fls - find the most significant bit set in a u64 +* @n: u64 value to scan for a bit +* +* Returns: 0 if no bits found, otherwise the index of the highest bit that was +* set, like ice_fls(0x20) == 6. This means this is returning a *1 based* +* count, and that the maximum largest value returned is 64! +*/ +static inline unsigned int ice_fls (u64 n) +{ +int ret; + + ret =ice_ilog2 (n); + +/* add one to turn to the ilog2 value into a 1 based index */ +return ret >=0 ? ret +1 :0 ; +} +static inline bool ice_is_tc_ena (ice_bitmap_t bitmap,u8 tc) {return ice_is_bit_set (&bitmap, tc);
@@ -98,6 +116,8 @@ static inline u32 ice_round_to_num(u32 N, u32 R)#define ICE_LO_DWORD (x) ((u32)((x) & 0xFFFFFFFF))#define ICE_HI_WORD (x) ((u16)(((x) >> 16) & 0xFFFF))#define ICE_LO_WORD (x) ((u16)((x) & 0xFFFF)) +#define ICE_HI_BYTE (x) ((u8)(((x) >> 8) & 0xFF)) +#define ICE_LO_BYTE (x) ((u8)((x) & 0xFF))/* debug masks - set these bits in hw->debug_mask to control output */ #define ICE_DBG_TRACE BIT_ULL(0)/* for function-trace only */
@@ -918,6 +938,14 @@ struct ice_nvm_info {u8 minor; }; +/* Minimum Security Revision information */ +struct ice_minsrev_info { +u32 nvm; +u32 orom; +u8 nvm_valid :1 ; +u8 orom_valid :1 ; +}; +/* Enumeration of possible flash banks for the NVM, OROM, and Netlist modules * of the flash image. */
@@ -1231,6 +1259,7 @@ struct ice_port_info {struct ice_bw_type_info tc_node_bw_t_info[ICE_MAX_TRAFFIC_CLASS ];struct ice_qos_cfg qos_cfg; u8 is_vf:1; + u8 is_custom_tx_enabled:1; };struct ice_switch_info {
@@ -1513,6 +1542,7 @@ enum ice_sw_fwd_act_type {ICE_FWD_TO_QGRP ,ICE_SET_MARK ,ICE_DROP_PACKET , +ICE_LG_ACTION , ICE_INVAL_ACT };
Signature · 1 line
2.43.0
PATCH v2 147/148 net/ice: update rss lut value for RSS init
In reply to Anatoly BurakovFrom: istokes <[email protected]>
Latest shared code update changes the requirements for size definition of rss_lut which now varies by type.
Previously it was limited to 512 even if the capabalities were greater. With the lastest shared code update for PF type this will be 2048 and will fail to initialise if less than this.
--- drivers/net/ice/ice_ethdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ice/ice_ethdev.c +1 -3
@@ -1609,9 +1609,7 @@ ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type)TAILQ_INIT (&vsi->vlan_list);/* Be sync with RTE_ETH_RSS_RETA_SIZE_x maximum value definition */ - pf->hash_lut_size = hw->func_caps.common_cap.rss_table_size > -RTE_ETH_RSS_RETA_SIZE_512 ?RTE_ETH_RSS_RETA_SIZE_512 : - hw->func_caps.common_cap.rss_table_size; + pf->hash_lut_size = hw->func_caps.common_cap.rss_table_size; pf->flags |=ICE_FLAG_RSS_AQ_CAPABLE ;/* Defines the type of outer tag expected */
Signature · 1 line
2.43.0
PATCH v2 148/148 net/ice: add new device ids
In reply to Anatoly BurakovFrom: Bruce Richardson <[email protected]>
Add new device ids for latest gen NICs.
--- drivers/net/ice/ice_ethdev.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/ice/ice_ethdev.c +9 -0
@@ -217,6 +217,15 @@ static const struct rte_pci_id pci_id_ice_map[] = { { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_SFP) }, { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_C825X) }, { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_SGMII) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_BACKPLANE) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_QSFP56) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_SFP) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_BACKPLANE) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_BACKPLANE) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_QSFP) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_QSFP) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_SFP) }, + { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_SFP) }, { .vendor_id = 0, /* sentinel */ }, };
Signature · 1 line
2.43.0
Re: [PATCH v2 000/148] Update net/ice base driver to latest upstream snapshot
In reply to Anatoly BurakovQuoted 7 lines · Anatoly Burakov
This is a patchset loosely based on internal development tree which tracked ICE driver development over a period of time since last snapshot update.
RFC -> v1:
- From one, many
Apologies, this was meant to be a v1 but it was sent as a v2 due to my patch submission automation mishap.
Signature · 2 lines
Thanks, Anatoly
Re: [PATCH v2 000/148] Update net/ice base driver to latest upstream snapshot
Quoted 11 lines · Anatoly
Quoted 7 lines · Anatoly Burakov
This is a patchset loosely based on internal development tree which tracked ICE driver development over a period of time since last snapshot update.
RFC -> v1:
- From one, manyApologies, this was meant to be a v1 but it was sent as a v2 due to my patch submission automation mishap.
*Just* 148 patches, Anatoly? I feel sympathy for the reviewer.
RE: [PATCH v2 000/148] Update net/ice base driver to latest upstream snapshot
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
This is a patchset loosely based on internal development tree which tracked ICE driver development over a period of time since last snapshot update.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
RFC -> v1:
- From one, manyApologies, this was meant to be a v1 but it was sent as a v2 due to my patch submission automation mishap.
*Just* 148 patches, Anatoly? I feel sympathy for the reviewer.
And that's *after* a lot of effort have been expended to squash changes together!
Of course, this isn't meant to be the final version, so it may very well happen that the number of patches may be reduced.
Thanks,
Anatoly
v3 cover Update net/ice base driver to latest upstream snapshot
In reply to Anatoly BurakovThis is a patchset loosely based on internal development tree which tracked ICE driver development over a period of time since last snapshot update.
v2-> v3:
- Fixed commit authorship for commits where it was feasible to do so
- Addressed review comments
- Clarified and corrected a few commit messages
- Squashed more style changes into one giant "align code to base driver" patch (process still ongoing)
- Split a few patches into more meaningful chunks
- Dropped a few patches due to validation discovering issues with them
[v1 went out as v2 by accident so it is v2 now]
RFC -> v1:
- From one, many
Adrian Pielech (1):
net/ice/base: remove dead code from ice_get_ddp_pkg_state
Anatoly Burakov (7):
net/ice/base: move ice_ptp_init_phy_model to align with upstream net/ice/base: add port option commands
net/ice/base: align code to base driver
net/ice/base: fix compile issues on some targets net/ice/base: move code to common headers
net/ice/base: make some switch-related functions static net/ice/base: make Tx and Rx vernier offset calibration independent
Ashish Shah (1):
net/ice/base: update flow seg fields to declared bitmaps
Aviraj CJ (1):
net/ice/base: allow passing flags to sbq command
Bartosz Staszewski (1):
net/ice/base: improve read retry value calculation
Ben Shelton (2):
net/ice/base: add AQ function to configure SyncE error reporting net/ice/base: clean up ice_lan_tx_rx
Benjamin Mikailenko (1):
net/ice/base: increase PF reset wait timeout to 500 milliseconds
Bruce Richardson (1):
net/ice: add new device ids
Chinh Cao (1):
net/ice/base: correct the return type of ice_bitmap_hweight
Dan Nowlin (6):
net/ice/base: fix package download algorithm net/ice/base: allows packages with mixed signature presence net/ice/base: allow different FW API versions based on MAC type net/ice/base: add 32 GT bus speed enumerated value net/ice/base: add 200G speeds to PHY types decoding net/ice/base: support E830 in Topology AQ command
Dave Ertman (1):
net/ice/base: update strict status when assigning BW limits
Dawid Zielinski (2):
net/ice/base: update interface in ice_parse_common_caps net/ice/base: copy output IO params from command descriptor
Eric Joyner (4):
net/ice/base: fix memory leak when checking firmware version net/ice/base: adapt No FEC in Auto support check to add E82X devices net/ice/base: fix GCS descriptor field offsets net/ice/base: detect and store device sensor reading capability
Fabio Pricoco (8):
net/ice/base: add mgmt netlist auth support command net/ice/base: avoid undefined variables net/ice/base: support for OROM update in recovery mode net/ice/base: fix resource leak
net/ice/base: add fw log file
net/ice/base: use correct type
net/ice/base: support for firmware sanitization net/ice/base: use a variable to store reset count
Grzegorz Nitka (1):
net/ice/base: improve find recipe routine
Ian Stokes (3):
net/ice/base: add E830 debug dump cluster ID values net/ice/base: add missing files for shared code update net/ice/base: add missing defines and misc cleanup
Jacob Keller (15):
net/ice/base: improve ice_debug_cq messages net/ice/base: remove unnecessary control queue cmd_buf arrays net/ice/base: refactor control queue send delay net/ice/base: fix incorrect size when allocating children arrays net/ice/base: fix ice_ptp_one_port_cmd to avoid stale PHY commands net/ice/base: use ICE_PTP_NOP to better indicate no action net/ice/base: use "err" instead of "status" in ice_ptp_hw.c net/ice/base: re-number E810-T subdevice IDs to match upstream net/ice/base: enable RDMA Act-Act unload paths net/ice/base: be more verbose when preparing timer sync net/ice/base: return high address for multi-read eth56g registers net/ice/base: add function to read Tx timestamp status register net/ice/base: squash multiple fixes for e56g device net/ice/base: rename netlist check functions to match upstream net/ice/base: rename SMA register macros to match Linux upstream
Jaroslaw Ilgiewicz (1):
net/ice/base: read OROM in a loop
Jesse Brandeburg (7):
net/ice/base: add missing include
net/ice/base: refactor (non) bitmap declarations net/ice/base: update code with flex array safe allocations net/ice/base: move lock outside of if-else net/ice/base: fix sign-extension
net/ice/base: switch speed conversions to static lookups net/ice/base: misc header file clean up
Karol Kolacinski (7):
net/ice/base: add LL Tx timestamp interrupt read net/ice/base: remove PTP aqc_driver_params net/ice/base: fall back to safe CGU params net/ice/base: add PHY OFFSET_READY register clearing net/ice/base: implement interface to reset timestamp memory net/ice/base: enable CGU error reporting net/ice/base: cleanup timestamp registers correctly
Lukasz Plachno (3):
net/ice/base: prevent potential integer overflow net/ice/base: replace array initialization with macros net/ice/base: use const char* array for storing link modes
Mateusz Pacuszka (3):
net/ice/base: use ice_bitmap_t in promisc functions net/ice/base: fix rx-only unicast promiscuous mode net/ice/base: fix check for existing switch rule
Michal Michalik (2):
net/ice/base: add support for E825-C TX clock changing net/ice/base: implement initial PTP support for E830
Michal Swiatkowski (1):
net/ice/base: alloc port_info only once
Michal Wilczynski (1):
net/ice/base: introduce new functions in ice_sched_node
Milena Olech (2):
net/ice/base: remove PHY port timer bypass mode net/ice/base: change a method to get pca9575 handle
Norbert Ciosek (1):
net/ice/base: check if recipe buffer was already allocated
Pabitra Dalai (1):
net/ice/base: add defines for loopback mode
Paul Greenwalt (5):
net/ice/base: add E830 definitions net/ice/base: improve media type handling for phy caps net/ice/base: fix potential TLV length overflow net/ice/base: add Get Link Status Data version 2 net/ice/base: add E830 PTP init
Pawel Sobczyk (1):
net/ice/base: add Floating VEB support
Piotr Raczynski (1):
net/ice/base: add VSI type for subfunctions
Prathisna Padmasanan (1):
net/ice/base: added informational message for NAC topology
Przemek Kitszel (3):
net/ice/base: convert enum ice_status to int net/ice/base: replace ICE_SUCCESS with int net/ice/base: update boost struct for traffic types
Remigiusz Konca (1):
net/ice/base: enable Next Cluster ID capability
Robert Malz (1):
net/ice/base: fix for applying multiple cloud filters
Scott W Taylor (1):
net/ice/base: merge unified E830 headers
Sergey Temerkhanov (10):
net/ice/base: use model-dependent number of PHY ports net/ice/base: parse 1PPS GPIO in 1588 function caps net/ice/base: rename PHY model designator fields and functions net/ice/base: enable SB access explicitly before 1st PHY access net/ice/base: refactor ETH56G PHY initialization net/ice/base: refactor ETH56G support for multiple PHYs per MAC net/ice/base: implement upper-level PHY control functions net/ice/base: support E830 in DDP pkg handling net/ice/base: allow skipping main timer programming net/ice/base: implement TX interrupt enablement functions
Siddaraju DH (1):
net/ice/base: update phy config during link restart
Stefan Wegrzyn (6):
net/ice/base: fix for pointer to variable outside scope net/ice/base: allow for dumping all clusters net/ice/base: allow skipping PF clear net/ice/base: make ice_clear_vsi_q_ctx() non-static net/ice/base: fix ice_memcpy type specifiers net/ice/base: adjust memcpy type
Ting Xu (1):
net/ice/base: support DCF query port ETS adminq
Tomaszx Wakula (2):
net/ice/base: add function to read SDP section from NVM net/ice/base: fix for preparing PHY for timesync command
Waldemar Dworakowski (3):
net/ice/base: ignore snprintf return value net/ice/base: check array bounds net/ice/base: fix in the definition of the Board Type
Wojciech Drewek (2):
net/ice/base: add Cage Max Power override NVM module net/ice/base: add L2TPv3 support for adv rules
Yahui Cao (1):
net/ice/base: fix ice_get_ctx() issue
Yochai Hagvi (3):
net/ice/base: change data buffer in i2c write to be const net/ice/base: add helper function for refsync net/ice/base: change tmr_idx to u32
Zhirun Yan (1):
net/ice/base: add ability to set markid via switch filter
drivers/net/ice/base/ice_acl.c | 58 +-
drivers/net/ice/base/ice_acl.h | 50 +-
drivers/net/ice/base/ice_acl_ctrl.c | 44 +-
drivers/net/ice/base/ice_adminq_cmd.h | 429 +-
drivers/net/ice/base/ice_bitops.h | 8 +-
drivers/net/ice/base/ice_cgu_regs.h | 90 +
drivers/net/ice/base/ice_common.c | 1494 +++---
drivers/net/ice/base/ice_common.h | 188 +-
drivers/net/ice/base/ice_controlq.c | 213 +-
drivers/net/ice/base/ice_controlq.h | 28 +-
drivers/net/ice/base/ice_dcb.c | 77 +-
drivers/net/ice/base/ice_dcb.h | 32 +-
drivers/net/ice/base/ice_ddp.c | 117 +-
drivers/net/ice/base/ice_ddp.h | 15 +-
drivers/net/ice/base/ice_devids.h | 36 +-
drivers/net/ice/base/ice_fdir.c | 46 +-
drivers/net/ice/base/ice_fdir.h | 18 +-
drivers/net/ice/base/ice_flex_pipe.c | 376 +-
drivers/net/ice/base/ice_flex_pipe.h | 30 +-
drivers/net/ice/base/ice_flex_type.h | 13 +-
drivers/net/ice/base/ice_flow.c | 328 +-
drivers/net/ice/base/ice_flow.h | 52 +-
drivers/net/ice/base/ice_fwlog.c | 5 +
.../base/ice_fwlog.h} | 2 +-
drivers/net/ice/base/ice_hw_autogen.h | 2556 +++++++--
drivers/net/ice/base/ice_lan_tx_rx.h | 40 +-
drivers/net/ice/base/ice_nvm.c | 320 +-
drivers/net/ice/base/ice_nvm.h | 36 +-
drivers/net/ice/base/ice_parser.c | 47 +-
drivers/net/ice/base/ice_parser.h | 30 +-
drivers/net/ice/base/ice_parser_rt.c | 30 +-
drivers/net/ice/base/ice_parser_rt.h | 4 +-
drivers/net/ice/base/ice_phy_regs.h | 84 +
drivers/net/ice/base/ice_protocol_type.h | 11 +-
drivers/net/ice/base/ice_ptp_consts.h | 3 +-
drivers/net/ice/base/ice_ptp_hw.c | 4608 ++++++++++-------
drivers/net/ice/base/ice_ptp_hw.h | 274 +-
drivers/net/ice/base/ice_sbq_cmd.h | 3 +-
drivers/net/ice/base/ice_sched.c | 548 +-
drivers/net/ice/base/ice_sched.h | 129 +-
drivers/net/ice/base/ice_status.h | 2 +
drivers/net/ice/base/ice_switch.c | 1528 +++---
drivers/net/ice/base/ice_switch.h | 234 +-
drivers/net/ice/base/ice_type.h | 196 +-
.../base/ice_vf_mbx.c} | 2 +-
.../base/ice_vf_mbx.h} | 2 +-
drivers/net/ice/base/ice_vlan_mode.c | 38 +-
drivers/net/ice/base/ice_vlan_mode.h | 2 +-
drivers/net/ice/base/ice_xlt_kb.c | 4 +-
drivers/net/ice/base/meson.build | 2 +
drivers/net/ice/ice_dcf_parent.c | 2 +-
drivers/net/ice/ice_diagnose.c | 14 +-
drivers/net/ice/ice_ethdev.c | 94 +-
drivers/net/ice/ice_rxtx.c | 12 +-
drivers/net/ice/ice_tm.c | 5 +-
55 files changed, 9446 insertions(+), 5163 deletions(-)
create mode 100644 drivers/net/ice/base/ice_fwlog.c
copy drivers/net/{vmxnet3/base/vmware_pack_end.h => ice/base/ice_fwlog.h} (50%)
create mode 100644 drivers/net/ice/base/ice_phy_regs.h
copy drivers/net/{vmxnet3/base/vmware_pack_end.h => ice/base/ice_vf_mbx.c} (50%)
copy drivers/net/{vmxnet3/base/vmware_pack_end.h => ice/base/ice_vf_mbx.h} (50%)Signature · 1 line
2.43.0
PATCH v3 1/129 net/ice/base: convert enum ice_status to int
From: Przemek Kitszel <[email protected]>
Convert enum ice_status variables/return type to just int.
Do so by applying following:
grep -Inrl ice_status |
grep -v ice_status.h |
xargs -r gawk -i inplace '/[Ii]nclude/ || gsub(/(enum )?ice_status/, "int") || 1'
--- drivers/net/ice/base/ice_acl.c | 58 ++-- drivers/net/ice/base/ice_acl.h | 50 ++-- drivers/net/ice/base/ice_acl_ctrl.c | 36 +-- drivers/net/ice/base/ice_common.c | 267 +++++++++-------- drivers/net/ice/base/ice_common.h | 150 +++++----- drivers/net/ice/base/ice_controlq.c | 58 ++-- drivers/net/ice/base/ice_dcb.c | 60 ++-- drivers/net/ice/base/ice_dcb.h | 32 +-- drivers/net/ice/base/ice_ddp.c | 48 ++-- drivers/net/ice/base/ice_ddp.h | 14 +- drivers/net/ice/base/ice_fdir.c | 20 +- drivers/net/ice/base/ice_fdir.h | 18 +- drivers/net/ice/base/ice_flex_pipe.c | 176 ++++++------ drivers/net/ice/base/ice_flex_pipe.h | 30 +- drivers/net/ice/base/ice_flow.c | 136 ++++----- drivers/net/ice/base/ice_flow.h | 28 +- drivers/net/ice/base/ice_nvm.c | 119 ++++---- drivers/net/ice/base/ice_nvm.h | 33 +-- drivers/net/ice/base/ice_parser.c | 16 +- drivers/net/ice/base/ice_parser.h | 12 +- drivers/net/ice/base/ice_parser_rt.c | 4 +- drivers/net/ice/base/ice_parser_rt.h | 2 +- drivers/net/ice/base/ice_ptp_hw.c | 414 +++++++++++++-------------- drivers/net/ice/base/ice_ptp_hw.h | 86 +++--- drivers/net/ice/base/ice_sched.c | 372 ++++++++++++------------ drivers/net/ice/base/ice_sched.h | 96 +++---- drivers/net/ice/base/ice_switch.c | 325 ++++++++++----------- drivers/net/ice/base/ice_switch.h | 106 +++---- drivers/net/ice/base/ice_vlan_mode.c | 28 +- drivers/net/ice/base/ice_vlan_mode.h | 2 +- drivers/net/ice/ice_dcf_parent.c | 2 +- drivers/net/ice/ice_diagnose.c | 5 +- drivers/net/ice/ice_ethdev.c | 51 ++-- drivers/net/ice/ice_rxtx.c | 12 +- drivers/net/ice/ice_tm.c | 5 +- 35 files changed, 1428 insertions(+), 1443 deletions(-)
drivers/net/ice/base/ice_acl.c +29 -29
@@ -13,7 +13,7 @@* * Allocate ACL table (indirect 0x0C10) */ -enum ice_status +int ice_aq_alloc_acl_tbl (struct ice_hw *hw,struct ice_acl_alloc_tbl *tbl,struct ice_sq_cd *cd) {
@@ -64,7 +64,7 @@ ice_aq_alloc_acl_tbl(struct ice_hw *hw, struct ice_acl_alloc_tbl *tbl,* format is 'struct ice_aqc_acl_generic', pass ptr to that struct * as 'buf' and its size as 'buf_size' */ -enum ice_status +int ice_aq_dealloc_acl_tbl (struct ice_hw *hw,u16 alloc_id,struct ice_aqc_acl_generic *buf,struct ice_sq_cd *cd) {
@@ -78,7 +78,7 @@ ice_aq_dealloc_acl_tbl(struct ice_hw *hw, u16 alloc_id,return ice_aq_send_cmd (hw, &desc, buf,sizeof (*buf), cd); } -static enum ice_status +static int ice_aq_acl_entry (struct ice_hw *hw,u16 opcode,u8 tcam_idx,u16 entry_idx,struct ice_aqc_acl_data *buf,struct ice_sq_cd *cd) {
@@ -107,7 +107,7 @@ ice_aq_acl_entry(struct ice_hw *hw, u16 opcode, u8 tcam_idx, u16 entry_idx,* * Program ACL entry (direct 0x0C20) */ -enum ice_status +int ice_aq_program_acl_entry (struct ice_hw *hw,u8 tcam_idx,u16 entry_idx,struct ice_aqc_acl_data *buf,struct ice_sq_cd *cd) {
@@ -128,7 +128,7 @@ ice_aq_program_acl_entry(struct ice_hw *hw, u8 tcam_idx, u16 entry_idx,* NOTE: Caller of this API to parse 'buf' appropriately since it contains * response (key and key invert) */ -enum ice_status +int ice_aq_query_acl_entry (struct ice_hw *hw,u8 tcam_idx,u16 entry_idx,struct ice_aqc_acl_data *buf,struct ice_sq_cd *cd) {
@@ -137,7 +137,7 @@ ice_aq_query_acl_entry(struct ice_hw *hw, u8 tcam_idx, u16 entry_idx, }/* Helper function to alloc/dealloc ACL action pair */ -static enum ice_status +static int ice_aq_actpair_a_d (struct ice_hw *hw,u16 opcode,u16 alloc_id,struct ice_aqc_acl_generic *buf,struct ice_sq_cd *cd) {
@@ -163,7 +163,7 @@ ice_aq_actpair_a_d(struct ice_hw *hw, u16 opcode, u16 alloc_id,* This command doesn't need and doesn't have its own command buffer * but for response format is as specified in 'struct ice_aqc_acl_generic' */ -enum ice_status +int ice_aq_alloc_actpair (struct ice_hw *hw,u16 alloc_id,struct ice_aqc_acl_generic *buf,struct ice_sq_cd *cd) {
@@ -180,7 +180,7 @@ ice_aq_alloc_actpair(struct ice_hw *hw, u16 alloc_id,* * Deallocate ACL actionpair (direct 0x0C13) */ -enum ice_status +int ice_aq_dealloc_actpair (struct ice_hw *hw,u16 alloc_id,struct ice_aqc_acl_generic *buf,struct ice_sq_cd *cd) {
@@ -189,7 +189,7 @@ ice_aq_dealloc_actpair(struct ice_hw *hw, u16 alloc_id, }/* Helper function to program/query ACL action pair */ -static enum ice_status +static int ice_aq_actpair_p_q (struct ice_hw *hw,u16 opcode,u8 act_mem_idx,u16 act_entry_idx,struct ice_aqc_actpair *buf,struct ice_sq_cd *cd)
@@ -219,7 +219,7 @@ ice_aq_actpair_p_q(struct ice_hw *hw, u16 opcode, u8 act_mem_idx,* * Program action entries (indirect 0x0C1C) */ -enum ice_status +int ice_aq_program_actpair (struct ice_hw *hw,u8 act_mem_idx,u16 act_entry_idx,struct ice_aqc_actpair *buf,struct ice_sq_cd *cd) {
@@ -237,7 +237,7 @@ ice_aq_program_actpair(struct ice_hw *hw, u8 act_mem_idx, u16 act_entry_idx,* * Query ACL actionpair (indirect 0x0C25) */ -enum ice_status +int ice_aq_query_actpair (struct ice_hw *hw,u8 act_mem_idx,u16 act_entry_idx,struct ice_aqc_actpair *buf,struct ice_sq_cd *cd) {
@@ -253,7 +253,7 @@ ice_aq_query_actpair(struct ice_hw *hw, u8 act_mem_idx, u16 act_entry_idx,* De-allocate ACL resources (direct 0x0C1A). Used by SW to release all the * resources allocated for it using a single command */ -enum ice_status ice_aq_dealloc_acl_res (struct ice_hw *hw,struct ice_sq_cd *cd) +int ice_aq_dealloc_acl_res (struct ice_hw *hw,struct ice_sq_cd *cd) {struct ice_aq_desc desc;
@@ -272,7 +272,7 @@ enum ice_status ice_aq_dealloc_acl_res(struct ice_hw *hw, struct ice_sq_cd *cd)* * This function sends ACL profile commands */ -static enum ice_status +static int ice_acl_prof_aq_send (struct ice_hw *hw,u16 opc,u8 prof_id,struct ice_aqc_acl_prof_generic_frmt *buf,struct ice_sq_cd *cd)
@@ -296,7 +296,7 @@ ice_acl_prof_aq_send(struct ice_hw *hw, u16 opc, u8 prof_id,* * Program ACL profile extraction (indirect 0x0C1D) */ -enum ice_status +int ice_prgm_acl_prof_xtrct (struct ice_hw *hw,u8 prof_id,struct ice_aqc_acl_prof_generic_frmt *buf,struct ice_sq_cd *cd)
@@ -314,7 +314,7 @@ ice_prgm_acl_prof_xtrct(struct ice_hw *hw, u8 prof_id,* * Query ACL profile (indirect 0x0C21) */ -enum ice_status +int ice_query_acl_prof (struct ice_hw *hw,u8 prof_id,struct ice_aqc_acl_prof_generic_frmt *buf,struct ice_sq_cd *cd)
@@ -330,9 +330,9 @@ ice_query_acl_prof(struct ice_hw *hw, u8 prof_id,* This function checks the counter bank range for counter type and returns * success or failure. */ -static enum ice_status ice_aq_acl_cntrs_chk_params (struct ice_acl_cntrs *cntrs) +static int ice_aq_acl_cntrs_chk_params (struct ice_acl_cntrs *cntrs) { -enum ice_status status =ICE_SUCCESS ; +int status =ICE_SUCCESS ;if (!cntrs || !cntrs->amount)return ICE_ERR_PARAM ;
@@ -373,14 +373,14 @@ static enum ice_status ice_aq_acl_cntrs_chk_params(struct ice_acl_cntrs *cntrs)* unsuccessful if returned counter value is invalid. In this case it returns * an error otherwise success. */ -enum ice_status +int ice_aq_alloc_acl_cntrs (struct ice_hw *hw,struct ice_acl_cntrs *cntrs,struct ice_sq_cd *cd) {struct ice_aqc_acl_alloc_counters *cmd;u16 first_cntr, last_cntr;struct ice_aq_desc desc; -enum ice_status status; +int status;/* check for invalid params */ status =ice_aq_acl_cntrs_chk_params (cntrs);
@@ -412,13 +412,13 @@ ice_aq_alloc_acl_cntrs(struct ice_hw *hw, struct ice_acl_cntrs *cntrs,* * De-allocate ACL counters (direct 0x0C17) */ -enum ice_status +int ice_aq_dealloc_acl_cntrs (struct ice_hw *hw,struct ice_acl_cntrs *cntrs,struct ice_sq_cd *cd) {struct ice_aqc_acl_dealloc_counters *cmd;struct ice_aq_desc desc; -enum ice_status status; +int status;/* check for invalid params */ status =ice_aq_acl_cntrs_chk_params (cntrs);
@@ -443,7 +443,7 @@ ice_aq_dealloc_acl_cntrs(struct ice_hw *hw, struct ice_acl_cntrs *cntrs,* * Program ACL profile ranges (indirect 0x0C1E) */ -enum ice_status +int ice_prog_acl_prof_ranges (struct ice_hw *hw,u8 prof_id,struct ice_aqc_acl_profile_ranges *buf,struct ice_sq_cd *cd)
@@ -466,7 +466,7 @@ ice_prog_acl_prof_ranges(struct ice_hw *hw, u8 prof_id,* * Query ACL profile ranges (indirect 0x0C22) */ -enum ice_status +int ice_query_acl_prof_ranges (struct ice_hw *hw,u8 prof_id,struct ice_aqc_acl_profile_ranges *buf,struct ice_sq_cd *cd)
@@ -488,13 +488,13 @@ ice_query_acl_prof_ranges(struct ice_hw *hw, u8 prof_id,* * Allocate ACL scenario (indirect 0x0C14) */ -enum ice_status +int ice_aq_alloc_acl_scen (struct ice_hw *hw,u16 *scen_id,struct ice_aqc_acl_scen *buf,struct ice_sq_cd *cd) {struct ice_aqc_acl_alloc_scen *cmd;struct ice_aq_desc desc; -enum ice_status status; +int status;if (!scen_id)return ICE_ERR_PARAM ;
@@ -518,7 +518,7 @@ ice_aq_alloc_acl_scen(struct ice_hw *hw, u16 *scen_id,* * Deallocate ACL scenario (direct 0x0C15) */ -enum ice_status +int ice_aq_dealloc_acl_scen (struct ice_hw *hw,u16 scen_id,struct ice_sq_cd *cd) {struct ice_aqc_acl_dealloc_scen *cmd;
@@ -541,7 +541,7 @@ ice_aq_dealloc_acl_scen(struct ice_hw *hw, u16 scen_id, struct ice_sq_cd *cd)* * Calls update or query ACL scenario */ -static enum ice_status +static int ice_aq_update_query_scen (struct ice_hw *hw,u16 opcode,u16 scen_id,struct ice_aqc_acl_scen *buf,struct ice_sq_cd *cd) {
@@ -566,7 +566,7 @@ ice_aq_update_query_scen(struct ice_hw *hw, u16 opcode, u16 scen_id,* * Update ACL scenario (indirect 0x0C1B) */ -enum ice_status +int ice_aq_update_acl_scen (struct ice_hw *hw,u16 scen_id,struct ice_aqc_acl_scen *buf,struct ice_sq_cd *cd) {
@@ -583,7 +583,7 @@ ice_aq_update_acl_scen(struct ice_hw *hw, u16 scen_id,* * Query ACL scenario (indirect 0x0C23) */ -enum ice_status +int ice_aq_query_acl_scen (struct ice_hw *hw,u16 scen_id,struct ice_aqc_acl_scen *buf,struct ice_sq_cd *cd) {
drivers/net/ice/base/ice_acl.h +25 -25
102 lines not on this page · raw message
drivers/net/ice/base/ice_acl_ctrl.c +18 -18
@@ -74,7 +74,7 @@ ice_acl_scen_assign_entry_idx(struct ice_acl_scen *scen,* * To mark an entry available in scenario */ -static enum ice_status +static int ice_acl_scen_free_entry_idx (struct ice_acl_scen *scen,u16 idx) {if (idx >= scen->num_entry)
@@ -141,11 +141,11 @@ static u16 ice_acl_tbl_calc_end_idx(u16 start, u16 num_entries, u16 width)* * Initialize the ACL table by invalidating TCAM entries and action pairs. */ -static enum ice_status ice_acl_init_tbl (struct ice_hw *hw) +static int ice_acl_init_tbl (struct ice_hw *hw) {struct ice_aqc_actpair act_buf;struct ice_aqc_acl_data buf; -enum ice_status status =ICE_SUCCESS ; +int status =ICE_SUCCESS ;struct ice_acl_tbl *tbl;u8 tcam_idx, i;u16 idx;
@@ -303,14 +303,14 @@ static void ice_acl_divide_act_mems_to_tcams(struct ice_acl_tbl *tbl)* values for the size of the table, but this will need to grow as more flow * entries are added by the user level. */ -enum ice_status +int ice_acl_create_tbl (struct ice_hw *hw,struct ice_acl_tbl_params *params) {u16 width, depth, first_e, last_e, i;struct ice_aqc_acl_generic *resp_buf;struct ice_acl_alloc_tbl tbl_alloc;struct ice_acl_tbl *tbl; -enum ice_status status; +int status;if (hw->acl_tbl)return ICE_ERR_ALREADY_EXISTS ;
@@ -423,7 +423,7 @@ ice_acl_create_tbl(struct ice_hw *hw, struct ice_acl_tbl_params *params)* @hw: pointer to the hardware structure * @req: info of partition being allocated */ -static enum ice_status +static int ice_acl_alloc_partition (struct ice_hw *hw,struct ice_acl_scen *req) {u16 start =0 , cnt =0 , off =0 ;
@@ -737,14 +737,14 @@ ice_acl_commit_partition(struct ice_hw *hw, struct ice_acl_scen *scen,* @num_entries: number of entries to be allocated for the scenario * @scen_id: holds returned scenario ID if successful */ -enum ice_status +int ice_acl_create_scen (struct ice_hw *hw,u16 match_width,u16 num_entries,u16 *scen_id) {u8 cascade_cnt, first_tcam, last_tcam, i, k;struct ice_aqc_acl_scen scen_buf;struct ice_acl_scen *scen; -enum ice_status status; +int status;if (!hw->acl_tbl)return ICE_ERR_DOES_NOT_EXIST ;
@@ -845,11 +845,11 @@ ice_acl_create_scen(struct ice_hw *hw, u16 match_width, u16 num_entries,* @hw: pointer to the HW struct * @scen_id: ID of the remove scenario */ -static enum ice_status ice_acl_destroy_scen (struct ice_hw *hw,u16 scen_id) +static int ice_acl_destroy_scen (struct ice_hw *hw,u16 scen_id) {struct ice_acl_scen *scen, *tmp_scen;struct ice_flow_prof *p, *tmp; -enum ice_status status; +int status;if (!hw->acl_tbl)return ICE_ERR_DOES_NOT_EXIST ;
@@ -889,12 +889,12 @@ static enum ice_status ice_acl_destroy_scen(struct ice_hw *hw, u16 scen_id)* ice_acl_destroy_tbl - Destroy a previously created LEM table for ACL * @hw: pointer to the HW struct */ -enum ice_status ice_acl_destroy_tbl (struct ice_hw *hw) +int ice_acl_destroy_tbl (struct ice_hw *hw) {struct ice_acl_scen *pos_scen, *tmp_scen;struct ice_aqc_acl_generic resp_buf;struct ice_aqc_acl_scen buf; -enum ice_status status; +int status;u8 i;if (!hw->acl_tbl)
@@ -966,7 +966,7 @@ enum ice_status ice_acl_destroy_tbl(struct ice_hw *hw)* The "keys" and "inverts" buffers must be of the size which is the same as * the scenario's width */ -enum ice_status +int ice_acl_add_entry (struct ice_hw *hw,struct ice_acl_scen *scen,enum ice_acl_entry_prio prio,u8 *keys,u8 *inverts,struct ice_acl_act_entry *acts,u8 acts_cnt,u16 *entry_idx)
@@ -974,7 +974,7 @@ ice_acl_add_entry(struct ice_hw *hw, struct ice_acl_scen *scen,struct ice_aqc_acl_data buf;u8 entry_tcam, offset;u16 i, num_cscd, idx; -enum ice_status status =ICE_SUCCESS ; +int status =ICE_SUCCESS ;if (!scen)return ICE_ERR_DOES_NOT_EXIST ;
@@ -1043,14 +1043,14 @@ ice_acl_add_entry(struct ice_hw *hw, struct ice_acl_scen *scen,* * Program a scenario's action memory */ -enum ice_status +int ice_acl_prog_act (struct ice_hw *hw,struct ice_acl_scen *scen,struct ice_acl_act_entry *acts,u8 acts_cnt,u16 entry_idx) {u16 idx, entry_tcam, num_cscd, i, actx_idx =0 ;struct ice_aqc_actpair act_buf; -enum ice_status status =ICE_SUCCESS ; +int status =ICE_SUCCESS ;if (entry_idx >= scen->num_entry)return ICE_ERR_MAX_LIMIT ;
@@ -1105,12 +1105,12 @@ ice_acl_prog_act(struct ice_hw *hw, struct ice_acl_scen *scen,* @scen: scenario to remove the entry from * @entry_idx: the scenario-relative index of the flow entry being removed */ -enum ice_status +int ice_acl_rem_entry (struct ice_hw *hw,struct ice_acl_scen *scen,u16 entry_idx) {struct ice_aqc_actpair act_buf;struct ice_aqc_acl_data buf; -enum ice_status status =ICE_SUCCESS ; +int status =ICE_SUCCESS ;u16 num_cscd, idx, i;u8 entry_tcam;
drivers/net/ice/base/ice_common.c +133 -134
1,020 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +74 -76
328 lines not on this page · raw message
drivers/net/ice/base/ice_controlq.c +29 -29
195 lines not on this page · raw message
drivers/net/ice/base/ice_dcb.c +30 -30
211 lines not on this page · raw message
drivers/net/ice/base/ice_dcb.h +16 -16
@@ -188,48 +188,48 @@ struct ice_dcbx_variables {u32 deftsaassignment; }; -enum ice_status +int ice_aq_get_lldp_mib (struct ice_hw *hw,u8 bridge_type,u8 mib_type,void *buf,u16 buf_size,u16 *local_len,u16 *remote_len,struct ice_sq_cd *cd); -enum ice_status +int ice_aq_get_cee_dcb_cfg (struct ice_hw *hw,struct ice_aqc_get_cee_dcb_cfg_resp *buff,struct ice_sq_cd *cd); -enum ice_status +int ice_aq_set_pfc_mode (struct ice_hw *hw,u8 pfc_mode,struct ice_sq_cd *cd); -enum ice_status ice_lldp_to_dcb_cfg (u8 *lldpmib,struct ice_dcbx_cfg *dcbcfg); +int ice_lldp_to_dcb_cfg (u8 *lldpmib,struct ice_dcbx_cfg *dcbcfg);u8 ice_get_dcbx_status (struct ice_hw *hw); -enum ice_status +int ice_aq_get_dcb_cfg (struct ice_hw *hw,u8 mib_type,u8 bridgetype,struct ice_dcbx_cfg *dcbcfg); -enum ice_status ice_get_dcb_cfg (struct ice_port_info *pi); -enum ice_status ice_set_dcb_cfg (struct ice_port_info *pi); +int ice_get_dcb_cfg (struct ice_port_info *pi); +int ice_set_dcb_cfg (struct ice_port_info *pi);void ice_get_dcb_cfg_from_mib_change (struct ice_port_info *pi,struct ice_rq_event_info *event); -enum ice_status ice_init_dcb (struct ice_hw *hw,bool enable_mib_change); +int ice_init_dcb (struct ice_hw *hw,bool enable_mib_change);void ice_dcb_cfg_to_lldp (u8 *lldpmib,u16 *miblen,struct ice_dcbx_cfg *dcbcfg); -enum ice_status +int ice_query_port_ets (struct ice_port_info *pi,struct ice_aqc_port_ets_elem *buf,u16 buf_size,struct ice_sq_cd *cmd_details); -enum ice_status +int ice_aq_query_port_ets (struct ice_port_info *pi,struct ice_aqc_port_ets_elem *buf,u16 buf_size,struct ice_sq_cd *cd); -enum ice_status +int ice_update_port_tc_tree_cfg (struct ice_port_info *pi,struct ice_aqc_port_ets_elem *buf); -enum ice_status +int ice_aq_stop_lldp (struct ice_hw *hw,bool shutdown_lldp_agent,bool persist,struct ice_sq_cd *cd); -enum ice_status +int ice_aq_start_lldp (struct ice_hw *hw,bool persist,struct ice_sq_cd *cd); -enum ice_status +int ice_aq_start_stop_dcbx (struct ice_hw *hw,bool start_dcbx_agent,bool *dcbx_agent_status,struct ice_sq_cd *cd); -enum ice_status ice_cfg_lldp_mib_change (struct ice_hw *hw,bool ena_mib); -enum ice_status +int ice_cfg_lldp_mib_change (struct ice_hw *hw,bool ena_mib); +int ice_aq_cfg_lldp_mib_change (struct ice_hw *hw,bool ena_update,struct ice_sq_cd *cd);#endif /* _ICE_DCB_H_ */
drivers/net/ice/base/ice_ddp.c +24 -24
182 lines not on this page · raw message
drivers/net/ice/base/ice_ddp.h +7 -7
@@ -405,23 +405,23 @@ struct ice_marker_ptype_tcam_section {struct ice_hw ; -enum ice_status +int ice_acquire_change_lock (struct ice_hw *hw,enum ice_aq_res_access_type access);void ice_release_change_lock (struct ice_hw *hw);struct ice_buf_build *ice_pkg_buf_alloc (struct ice_hw *hw);void *ice_pkg_buf_alloc_section (struct ice_buf_build *bld,u32 type,u16 size); -enum ice_status +int ice_pkg_buf_reserve_section (struct ice_buf_build *bld,u16 count); -enum ice_status +int ice_get_sw_fv_list (struct ice_hw *hw,struct ice_prot_lkup_ext *lkups,ice_bitmap_t *bm,struct LIST_HEAD_TYPE *fv_list);u16 ice_pkg_buf_get_active_sections (struct ice_buf_build *bld); -enum ice_status +int ice_update_pkg (struct ice_hw *hw,struct ice_buf *bufs,u32 count); -enum ice_status +int ice_update_pkg_no_lock (struct ice_hw *hw,struct ice_buf *bufs,u32 count);void ice_release_global_cfg_lock (struct ice_hw *hw); struct ice_generic_seg_hdr *
@@ -433,7 +433,7 @@ enum ice_ddp_state ice_get_pkg_info(struct ice_hw *hw);void ice_init_pkg_hints (struct ice_hw *hw,struct ice_seg *ice_seg);struct ice_buf_table *ice_find_buf_table (struct ice_seg *ice_seg); -enum ice_status +int ice_acquire_global_cfg_lock (struct ice_hw *hw,enum ice_aq_res_access_type access);
@@ -462,6 +462,6 @@ ice_pkg_buf_alloc_single_section(struct ice_hw *hw, u32 type, u16 size,struct ice_buf *ice_pkg_buf (struct ice_buf_build *bld);void ice_pkg_buf_free (struct ice_hw *hw,struct ice_buf_build *bld); -enum ice_status ice_cfg_tx_topo (struct ice_hw *hw,u8 *buf,u32 len); +int ice_cfg_tx_topo (struct ice_hw *hw,u8 *buf,u32 len);#endif /* _ICE_DDP_H_ */
drivers/net/ice/base/ice_fdir.c +10 -10
@@ -3502,7 +3502,7 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,* @hw: pointer to the hardware structure * @cntr_id: returns counter index */ -enum ice_status ice_alloc_fd_res_cntr (struct ice_hw *hw,u16 *cntr_id) +int ice_alloc_fd_res_cntr (struct ice_hw *hw,u16 *cntr_id) {return ice_alloc_res_cntr (hw,ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK ,ICE_AQC_RES_TYPE_FLAG_DEDICATED ,1 , cntr_id);
@@ -3513,7 +3513,7 @@ enum ice_status ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id)* @hw: pointer to the hardware structure * @cntr_id: counter index to be freed */ -enum ice_status ice_free_fd_res_cntr (struct ice_hw *hw,u16 cntr_id) +int ice_free_fd_res_cntr (struct ice_hw *hw,u16 cntr_id) {return ice_free_res_cntr (hw,ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK ,ICE_AQC_RES_TYPE_FLAG_DEDICATED ,1 , cntr_id);
@@ -3525,7 +3525,7 @@ enum ice_status ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id)* @cntr_id: returns counter index * @num_fltr: number of filter entries to be allocated */ -enum ice_status +int ice_alloc_fd_guar_item (struct ice_hw *hw,u16 *cntr_id,u16 num_fltr) { return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES,
@@ -3539,7 +3539,7 @@ ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr)* @cntr_id: counter index that needs to be freed * @num_fltr: number of filters to be freed */ -enum ice_status +int ice_free_fd_guar_item (struct ice_hw *hw,u16 cntr_id,u16 num_fltr) { return ice_free_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES,
@@ -3553,7 +3553,7 @@ ice_free_fd_guar_item(struct ice_hw *hw, u16 cntr_id, u16 num_fltr)* @cntr_id: returns counter index * @num_fltr: number of filter entries to be allocated */ -enum ice_status +int ice_alloc_fd_shrd_item (struct ice_hw *hw,u16 *cntr_id,u16 num_fltr) { return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES,
@@ -3567,7 +3567,7 @@ ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr)* @cntr_id: counter index that needs to be freed * @num_fltr: number of filters to be freed */ -enum ice_status +int ice_free_fd_shrd_item (struct ice_hw *hw,u16 cntr_id,u16 num_fltr) { return ice_free_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES,
@@ -3690,7 +3690,7 @@ static void ice_pkt_insert_mac_addr(u8 *pkt, u8 *addr)* * returns an open tunnel port specified for this flow type */ -static enum ice_status +static int ice_fdir_get_open_tunnel_port (struct ice_hw *hw,enum ice_fltr_ptype flow,u16 *port) {
@@ -3822,7 +3822,7 @@ ice_fdir_gen_l2tpv2_pkt(u8 *pkt, struct ice_fdir_l2tpv2 *l2tpv2_data,* @frag: generate a fragment packet * @tun: true implies generate a tunnel packet */ -enum ice_status +int ice_fdir_get_gen_prgm_pkt (struct ice_hw *hw,struct ice_fdir_fltr *input,u8 *pkt,bool frag,bool tun) {
@@ -4810,7 +4810,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,* @pkt: pointer to return filter packet * @frag: generate a fragment packet */ -enum ice_status +int ice_fdir_get_prgm_pkt (struct ice_fdir_fltr *input,u8 *pkt,bool frag) {return ice_fdir_get_gen_prgm_pkt (NULL , input, pkt, frag, false);
@@ -4995,7 +4995,7 @@ bool ice_fdir_is_dup_fltr(struct ice_hw *hw, struct ice_fdir_fltr *input)* * Clears FD table entries for a PF by issuing admin command (direct, 0x0B06) */ -enum ice_status ice_clear_pf_fd_table (struct ice_hw *hw) +int ice_clear_pf_fd_table (struct ice_hw *hw) {struct ice_aqc_clear_fd_table *cmd;struct ice_aq_desc desc;
drivers/net/ice/base/ice_fdir.h +9 -9
@@ -318,24 +318,24 @@ ice_fdir_comp_rules_basic(struct ice_fdir_fltr *a, struct ice_fdir_fltr *b);bool ice_fdir_comp_rules_extended (struct ice_fdir_fltr *a,struct ice_fdir_fltr *b); -enum ice_status ice_alloc_fd_res_cntr (struct ice_hw *hw,u16 *cntr_id); -enum ice_status ice_free_fd_res_cntr (struct ice_hw *hw,u16 cntr_id); -enum ice_status +int ice_alloc_fd_res_cntr (struct ice_hw *hw,u16 *cntr_id); +int ice_free_fd_res_cntr (struct ice_hw *hw,u16 cntr_id); +int ice_alloc_fd_guar_item (struct ice_hw *hw,u16 *cntr_id,u16 num_fltr); -enum ice_status +int ice_free_fd_guar_item (struct ice_hw *hw,u16 cntr_id,u16 num_fltr); -enum ice_status +int ice_alloc_fd_shrd_item (struct ice_hw *hw,u16 *cntr_id,u16 num_fltr); -enum ice_status +int ice_free_fd_shrd_item (struct ice_hw *hw,u16 cntr_id,u16 num_fltr); -enum ice_status ice_clear_pf_fd_table (struct ice_hw *hw); +int ice_clear_pf_fd_table (struct ice_hw *hw);void ice_fdir_get_prgm_desc (struct ice_hw *hw,struct ice_fdir_fltr *input,struct ice_fltr_desc *fdesc,bool add); -enum ice_status +int ice_fdir_get_gen_prgm_pkt (struct ice_hw *hw,struct ice_fdir_fltr *input,u8 *pkt,bool frag,bool tun); -enum ice_status +int ice_fdir_get_prgm_pkt (struct ice_fdir_fltr *input,u8 *pkt,bool frag);int ice_get_fdir_cnt_all (struct ice_hw *hw);bool ice_fdir_is_dup_fltr (struct ice_hw *hw,struct ice_fdir_fltr *input);
drivers/net/ice/base/ice_flex_pipe.c +88 -88
383 lines not on this page · raw message
drivers/net/ice/base/ice_flow.c +68 -68
136 lines not on this page · raw message
drivers/net/ice/base/ice_nvm.c +59 -60
119 lines not on this page · raw message
drivers/net/ice/base/ice_ptp_hw.c +206 -208
414 lines not on this page · raw message
drivers/net/ice/base/ice_ptp_hw.h +43 -43
86 lines not on this page · raw message
drivers/net/ice/base/ice_sched.c +187 -185
372 lines not on this page · raw message
drivers/net/ice/base/ice_sched.h +48 -48
96 lines not on this page · raw message
drivers/net/ice/base/ice_switch.c +163 -162
325 lines not on this page · raw message
drivers/net/ice/base/ice_switch.h +53 -53
106 lines not on this page · raw message
drivers/net/ice/ice_ethdev.c +20 -31
51 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.0
Part of the diff is not shown here. View the raw message.
PATCH v3 2/129 net/ice/base: replace ICE_SUCCESS with int
In reply to Anatoly BurakovFrom: Przemek Kitszel <[email protected]>
Replace all usages of ICE_SUCCESS with its integer equivalent.
--- drivers/net/ice/base/ice_acl.c | 2 +- drivers/net/ice/base/ice_acl_ctrl.c | 16 +-- drivers/net/ice/base/ice_common.c | 78 +++++++------- drivers/net/ice/base/ice_controlq.c | 26 ++--- drivers/net/ice/base/ice_dcb.c | 22 ++-- drivers/net/ice/base/ice_ddp.c | 20 ++-- drivers/net/ice/base/ice_fdir.c | 4 +- drivers/net/ice/base/ice_flex_pipe.c | 108 +++++++++---------- drivers/net/ice/base/ice_flow.c | 64 +++++------ drivers/net/ice/base/ice_nvm.c | 54 +++++----- drivers/net/ice/base/ice_parser.c | 8 +- drivers/net/ice/base/ice_parser_rt.c | 2 +- drivers/net/ice/base/ice_ptp_hw.c | 152 +++++++++++++-------------- drivers/net/ice/base/ice_sched.c | 142 ++++++++++++------------- drivers/net/ice/base/ice_switch.c | 127 +++++++++++----------- drivers/net/ice/base/ice_vlan_mode.c | 10 +- 16 files changed, 418 insertions(+), 417 deletions(-)
drivers/net/ice/base/ice_acl.c +1 -1
@@ -332,7 +332,7 @@ ice_query_acl_prof(struct ice_hw *hw, u8 prof_id,*/ static int ice_aq_acl_cntrs_chk_params (struct ice_acl_cntrs *cntrs) { -int status =ICE_SUCCESS ; +int status =0 ;if (!cntrs || !cntrs->amount)return ICE_ERR_PARAM ;
drivers/net/ice/base/ice_acl_ctrl.c +8 -8
@@ -83,7 +83,7 @@ ice_acl_scen_free_entry_idx(struct ice_acl_scen *scen, u16 idx)if (!ice_test_and_clear_bit (idx, scen->entry_bitmap))return ICE_ERR_DOES_NOT_EXIST ; -return ICE_SUCCESS ; +return 0 ; }/**
@@ -145,8 +145,8 @@ static int ice_acl_init_tbl(struct ice_hw *hw) {struct ice_aqc_actpair act_buf;struct ice_aqc_acl_data buf; -int status =ICE_SUCCESS ;struct ice_acl_tbl *tbl; +int status =0 ;u8 tcam_idx, i;u16 idx;
@@ -547,7 +547,7 @@ ice_acl_alloc_partition(struct ice_hw *hw, struct ice_acl_scen *req) } }while (!done); -return cnt >= r_entries ?ICE_SUCCESS :ICE_ERR_MAX_LIMIT ; +return cnt >= r_entries ?0 :ICE_ERR_MAX_LIMIT ; }/**
@@ -882,7 +882,7 @@ static int ice_acl_destroy_scen(struct ice_hw *hw, u16 scen_id)ice_free (hw, scen); } -return ICE_SUCCESS ; +return 0 ; }/**
@@ -947,7 +947,7 @@ int ice_acl_destroy_tbl(struct ice_hw *hw)ice_free (hw, hw->acl_tbl); hw->acl_tbl =NULL ; -return ICE_SUCCESS ; +return 0 ; }/**
@@ -974,7 +974,7 @@ ice_acl_add_entry(struct ice_hw *hw, struct ice_acl_scen *scen,struct ice_aqc_acl_data buf;u8 entry_tcam, offset;u16 i, num_cscd, idx; -int status =ICE_SUCCESS ; +int status =0 ;if (!scen)return ICE_ERR_DOES_NOT_EXIST ;
@@ -1050,7 +1050,7 @@ ice_acl_prog_act(struct ice_hw *hw, struct ice_acl_scen *scen, {u16 idx, entry_tcam, num_cscd, i, actx_idx =0 ;struct ice_aqc_actpair act_buf; -int status =ICE_SUCCESS ; +int status =0 ;if (entry_idx >= scen->num_entry)return ICE_ERR_MAX_LIMIT ;
@@ -1110,8 +1110,8 @@ ice_acl_rem_entry(struct ice_hw *hw, struct ice_acl_scen *scen, u16 entry_idx) {struct ice_aqc_actpair act_buf;struct ice_aqc_acl_data buf; -int status =ICE_SUCCESS ;u16 num_cscd, idx, i; +int status =0 ;u8 entry_tcam;if (!scen)
drivers/net/ice/base/ice_common.c +39 -39
312 lines not on this page · raw message
drivers/net/ice/base/ice_controlq.c +13 -13
@@ -108,7 +108,7 @@ ice_alloc_ctrlq_sq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq)return ICE_ERR_NO_MEMORY ; } -return ICE_SUCCESS ; +return 0 ; }/**
@@ -124,7 +124,7 @@ ice_alloc_ctrlq_rq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq) cq->rq.desc_buf.va =ice_alloc_dma_mem (hw, &cq->rq.desc_buf, size);if (!cq->rq.desc_buf.va)return ICE_ERR_NO_MEMORY ; -return ICE_SUCCESS ; +return 0 ; }/**
@@ -190,7 +190,7 @@ ice_alloc_rq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq) desc->params.generic.param0 =0 ; desc->params.generic.param1 =0 ; } -return ICE_SUCCESS ; +return 0 ; unwind_alloc_rq_bufs:/* don't try to free the one that failed... */
@@ -230,7 +230,7 @@ ice_alloc_sq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq)if (!bi->va) goto unwind_alloc_sq_bufs; } -return ICE_SUCCESS ; +return 0 ; unwind_alloc_sq_bufs:/* don't try to free the one that failed... */
@@ -260,7 +260,7 @@ ice_cfg_cq_regs(struct ice_hw *hw, struct ice_ctl_q_ring *ring, u16 num_entries)if (rd32 (hw, ring->bal) !=ICE_LO_DWORD (ring->desc_buf.pa))return ICE_ERR_AQ_ERROR ; -return ICE_SUCCESS ; +return 0 ; }/**
@@ -295,7 +295,7 @@ ice_cfg_rq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq)/* Update tail in the HW to post pre-allocated buffers */ wr32 (hw, cq->rq.tail, (u32)(cq->num_rq_entries -1 )); -return ICE_SUCCESS ; +return 0 ; }#define ICE_FREE_CQ_BUFS (hw, qi, ring) \
@@ -450,7 +450,7 @@ static int ice_init_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq)static int ice_shutdown_sq (struct ice_hw *hw,struct ice_ctl_q_info *cq) { -int ret_code =ICE_SUCCESS ; +int ret_code =0 ;ice_debug (hw,ICE_DBG_TRACE ,"%s\n" , __func__);
@@ -521,7 +521,7 @@ static bool ice_aq_ver_check(struct ice_hw *hw)static int ice_shutdown_rq (struct ice_hw *hw,struct ice_ctl_q_info *cq) { -int ret_code =ICE_SUCCESS ; +int ret_code =0 ;ice_debug (hw,ICE_DBG_TRACE ,"%s\n" , __func__);
@@ -571,7 +571,7 @@ static int ice_init_check_adminq(struct ice_hw *hw) goto init_ctrlq_free_rq; } -return ICE_SUCCESS ; +return 0 ; init_ctrlq_free_rq:ice_shutdown_rq (hw, cq);
@@ -638,7 +638,7 @@ static int ice_init_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type) goto init_ctrlq_free_sq;/* success! */ -return ICE_SUCCESS ; +return 0 ; init_ctrlq_free_sq:ice_shutdown_sq (hw, cq);
@@ -949,9 +949,9 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,struct ice_dma_mem *dma_buf =NULL ;struct ice_aq_desc *desc_on_ring;bool cmd_completed = false; -int status =ICE_SUCCESS ;struct ice_sq_cd *details;u32 total_delay =0 ; +int status =0 ;u16 retval =0 ;u32 val =0 ;
@@ -1125,7 +1125,7 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq, struct ice_aq_desc *desc, void *buf, u16 buf_size, struct ice_sq_cd *cd) { - int status = ICE_SUCCESS; + int status = 0;/* if reset is in progress return a soft error */ if (hw->reset_ongoing)
@@ -1170,9 +1170,9 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq, {u16 ntc = cq->rq.next_to_clean;enum ice_aq_err rq_last_status; -int ret_code =ICE_SUCCESS ;struct ice_aq_desc *desc;struct ice_dma_mem *bi; +int ret_code =0 ;u16 desc_idx;u16 datalen;u16 flags;
drivers/net/ice/base/ice_dcb.c +11 -11
@@ -604,8 +604,8 @@ ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)int ice_lldp_to_dcb_cfg (u8 *lldpmib,struct ice_dcbx_cfg *dcbcfg) {struct ice_lldp_org_tlv *tlv; -int ret =ICE_SUCCESS ;u16 offset =0 ; +int ret =0 ;u16 typelen;u16 type;u16 len;
@@ -655,8 +655,8 @@ int ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, struct ice_dcbx_cfg *dcbcfg) { - int ret; u8 *lldpmib; +int ret;/* Allocate the LLDPDU */ lldpmib = (u8 *)ice_malloc (hw,ICE_LLDPDU_SIZE );
@@ -666,7 +666,7 @@ ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, ret =ice_aq_get_lldp_mib (hw, bridgetype, mib_type, (void *)lldpmib,ICE_LLDPDU_SIZE ,NULL ,NULL ,NULL ); -if (ret ==ICE_SUCCESS ) +if (!ret)/* Parse LLDP MIB to get DCB configuration */ ret =ice_lldp_to_dcb_cfg (lldpmib, dcbcfg);
@@ -686,7 +686,7 @@ ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,* @cd: pointer to command details structure or NULL * * Start/Stop the embedded dcbx Agent. In case that this wrapper function -* returns ICE_SUCCESS, caller will need to check if FW returns back the same +* returns 0, caller will need to check if FW returns back the same * value as stated in dcbx_agent_status, and react accordingly. (0x0A09) */ int
@@ -711,7 +711,7 @@ ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent, *dcbx_agent_status = false; -if (status ==ICE_SUCCESS && +if (!status && cmd->command ==ICE_AQC_START_STOP_AGENT_START_DCBX ) *dcbx_agent_status = true;
@@ -775,7 +775,7 @@ ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd)if (cmd->pfc_mode != pfc_mode)return ICE_ERR_NOT_SUPPORTED ; -return ICE_SUCCESS ; +return 0 ; }/**
@@ -934,7 +934,7 @@ ice_get_ieee_or_cee_dcb_cfg(struct ice_port_info *pi, u8 dcbx_mode) ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID, dcbx_cfg);/* Don't treat ENOENT as an error for Remote MIBs */ if (pi->hw->adminq.sq_last_status ==ICE_AQ_RC_ENOENT ) - ret =ICE_SUCCESS ; + ret =0 ; out:return ret;
@@ -956,7 +956,7 @@ int ice_get_dcb_cfg(struct ice_port_info *pi)return ICE_ERR_PARAM ; ret =ice_aq_get_cee_dcb_cfg (pi->hw, &cee_cfg,NULL ); -if (ret ==ICE_SUCCESS ) { +if (!ret) {/* CEE mode */ ret =ice_get_ieee_or_cee_dcb_cfg (pi,ICE_DCBX_MODE_CEE );ice_cee_to_dcb_cfg (&cee_cfg, pi);
@@ -1017,7 +1017,7 @@ void ice_get_dcb_cfg_from_mib_change(struct ice_port_info *pi,int ice_init_dcb (struct ice_hw *hw,bool enable_mib_change) {struct ice_qos_cfg *qos_cfg = &hw->port_info->qos_cfg; -int ret =ICE_SUCCESS ; +int ret =0 ;if (!hw->func_caps.common_cap.dcb)return ICE_ERR_NOT_SUPPORTED ;
@@ -1512,9 +1512,9 @@ int ice_set_dcb_cfg(struct ice_port_info *pi) {u8 mib_type, *lldpmib =NULL ;struct ice_dcbx_cfg *dcbcfg; -int ret;struct ice_hw *hw;u16 miblen; +int ret;if (!pi)return ICE_ERR_PARAM ;
@@ -1583,8 +1583,8 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi, {struct ice_sched_node *node, *tc_node;struct ice_aqc_txsched_elem_data elem; -int status =ICE_SUCCESS ;u32 teid1, teid2; +int status =0 ;u8 i, j;if (!pi)
drivers/net/ice/base/ice_ddp.c +10 -10
@@ -231,7 +231,7 @@ ice_is_signing_seg_type_at_idx(struct ice_pkg_hdr *pkg_hdr, u32 idx,int ice_update_pkg_no_lock (struct ice_hw *hw,struct ice_buf *bufs,u32 count) { -int status =ICE_SUCCESS ; +int status =0 ;u32 i;for (i =0 ; i < count; i++) {
@@ -1181,7 +1181,7 @@ static int ice_get_prof_index_max(struct ice_hw *hw) hw->switch_info->max_used_prof_index = max_prof_index; -return ICE_SUCCESS ; +return 0 ; }/**
@@ -1584,7 +1584,7 @@ ice_get_sw_fv_list(struct ice_hw *hw, struct ice_prot_lkup_ext *lkups,u32 offset;if (!lkups->n_val_words) -return ICE_SUCCESS ; +return 0 ;ice_memset (&state,0 ,sizeof (state),ICE_NONDMA_MEM );
@@ -1634,7 +1634,7 @@ ice_get_sw_fv_list(struct ice_hw *hw, struct ice_prot_lkup_ext *lkups,ice_warn (hw,"Required profiles not found in currently loaded DDP package" );return ICE_ERR_CFG ; } -return ICE_SUCCESS ; +return 0 ; err: LIST_FOR_EACH_ENTRY_SAFE(fvl, tmp, fv_list, ice_sw_fv_list_entry,
@@ -1738,7 +1738,7 @@ ice_pkg_buf_reserve_section(struct ice_buf_build *bld, u16 count)FLEX_ARRAY_SIZE (buf, section_entry, count); buf->data_end =CPU_TO_LE16 (data_end); -return ICE_SUCCESS ; +return 0 ; }/**
@@ -2148,7 +2148,7 @@ ice_find_boost_entry(struct ice_seg *ice_seg, u16 addr, ice_boost_tcam_handler);if (tcam &&LE16_TO_CPU (tcam->addr) == addr) { *entry = tcam; -return ICE_SUCCESS ; +return 0 ; } ice_seg =NULL ;
@@ -2224,7 +2224,7 @@ void ice_init_pkg_hints(struct ice_hw *hw, struct ice_seg *ice_seg)* or writing of the package. When attempting to obtain write access, the * caller must check for the following two return values: * -* ICE_SUCCESS - Means the caller has acquired the global config lock +* 0 - Means the caller has acquired the global config lock * and can perform writing of the package. * ICE_ERR_AQ_NO_WORK - Indicates another driver has already written the * package or has found that no update was necessary; in
@@ -2321,7 +2321,7 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size,if (!set && flags) *flags = desc.params.get_set_tx_topo.set_flags; -return ICE_SUCCESS ; +return 0 ; }/**
@@ -2463,7 +2463,7 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)/* Reset is in progress, re-init the hw again */ ice_debug (hw,ICE_DBG_INIT ,"Reset is in progress. layer topology might be applied already\n" );ice_check_reset (hw); -return ICE_SUCCESS ; +return 0 ; }/* set new topology */
@@ -2480,5 +2480,5 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)/* CORER will clear the global lock, so no explicit call * required for release */ -return ICE_SUCCESS ; +return 0 ; }
drivers/net/ice/base/ice_fdir.c +2 -2
@@ -3706,7 +3706,7 @@ ice_fdir_get_open_tunnel_port(struct ice_hw *hw, enum ice_fltr_ptype flow,return ICE_ERR_DOES_NOT_EXIST ; } -return ICE_SUCCESS ; +return 0 ; }/**
@@ -4801,7 +4801,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,if (input->flex_fltr)ice_pkt_insert_u16 (loc, input->flex_offset, input->flex_word); -return ICE_SUCCESS ; +return 0 ; }/**
drivers/net/ice/base/ice_flex_pipe.c +54 -54
453 lines not on this page · raw message
drivers/net/ice/base/ice_flow.c +32 -32
258 lines not on this page · raw message
drivers/net/ice/base/ice_nvm.c +27 -27
210 lines not on this page · raw message
drivers/net/ice/base/ice_parser.c +4 -4
@@ -270,7 +270,7 @@ int ice_parser_create(struct ice_hw *hw, struct ice_parser **psr) } *psr = p; -return ICE_SUCCESS ; +return 0 ; err:ice_parser_destroy (p);return status;
@@ -389,7 +389,7 @@ _tunnel_port_set(struct ice_parser *psr, const char *prefix, u16 udp_port, item->key[15 ] = (u8)(0xff - buf[0 ]); item->key[16 ] = (u8)(0xff - buf[1 ]); -return ICE_SUCCESS ; +return 0 ;/* found a matched slot to delete */ }else if (!on && (item->key_inv[15 ] == buf[0 ] || item->key_inv[16 ] == buf[1 ])) {
@@ -398,7 +398,7 @@ _tunnel_port_set(struct ice_parser *psr, const char *prefix, u16 udp_port, item->key[15 ] =0xff ; item->key[16 ] =0xfe ; -return ICE_SUCCESS ; +return 0 ; } i++; }
@@ -528,7 +528,7 @@ int ice_parser_profile_init(struct ice_parser_result *rslt, prof->fv_num++; } -return ICE_SUCCESS ; +return 0 ; }/**
drivers/net/ice/base/ice_parser_rt.c +1 -1
@@ -773,12 +773,12 @@ static void _result_resolve(struct ice_parser_rt *rt,int ice_parser_rt_execute (struct ice_parser_rt *rt,struct ice_parser_result *rslt) { -int status =ICE_SUCCESS ;struct ice_pg_nm_cam_item *pg_nm_cam;struct ice_parser *psr = rt->psr;struct ice_pg_cam_item *pg_cam;struct ice_bst_tcam_item *bst;struct ice_imem_item *imem; +int status =0 ;u16 node;u16 pc;
drivers/net/ice/base/ice_ptp_hw.c +76 -76
608 lines not on this page · raw message
drivers/net/ice/base/ice_sched.c +71 -71
579 lines not on this page · raw message
drivers/net/ice/base/ice_switch.c +64 -63
166 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.0
Part of the diff is not shown here. View the raw message.
PATCH v3 3/129 net/ice/base: add E830 definitions
In reply to Anatoly BurakovFrom: Paul Greenwalt <[email protected]>
Add initial set of E830-related definitions.
--- drivers/net/ice/base/ice_hw_autogen.h | 79 +++++++++++++++++---------- 1 file changed, 50 insertions(+), 29 deletions(-)
drivers/net/ice/base/ice_hw_autogen.h +50 -29
@@ -429,9 +429,11 @@#define PF0INT_OICR_CPM_PAGE_QUEUE_S 1#define PF0INT_OICR_CPM_PAGE_QUEUE_M BIT(1)#define PF0INT_OICR_CPM_PAGE_RSV1_S 2 -#define PF0INT_OICR_CPM_PAGE_RSV1_M MAKEMASK(0xFF, 2) -#define PF0INT_OICR_CPM_PAGE_HH_COMP_S 10 -#define PF0INT_OICR_CPM_PAGE_HH_COMP_M BIT(10) +#define PF0INT_OICR_CPM_PAGE_RSV1_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PF0INT_OICR_CPM_PAGE_RSV1_M : E800_PF0INT_OICR_CPM_PAGE_RSV1_M) +#define E800_PF0INT_OICR_CPM_PAGE_RSV1_M MAKEMASK(0xFF, 2) +#define E830_PF0INT_OICR_CPM_PAGE_RSV1_M MAKEMASK(0x3F, 2) +#define E800_PF0INT_OICR_CPM_PAGE_HH_COMP_S 10 +#define E800_PF0INT_OICR_CPM_PAGE_HH_COMP_M BIT(10)#define PF0INT_OICR_CPM_PAGE_TSYN_TX_S 11#define PF0INT_OICR_CPM_PAGE_TSYN_TX_M BIT(11)#define PF0INT_OICR_CPM_PAGE_TSYN_EVNT_S 12
@@ -493,9 +495,11 @@#define PF0INT_OICR_HLP_PAGE_QUEUE_S 1#define PF0INT_OICR_HLP_PAGE_QUEUE_M BIT(1)#define PF0INT_OICR_HLP_PAGE_RSV1_S 2 -#define PF0INT_OICR_HLP_PAGE_RSV1_M MAKEMASK(0xFF, 2) -#define PF0INT_OICR_HLP_PAGE_HH_COMP_S 10 -#define PF0INT_OICR_HLP_PAGE_HH_COMP_M BIT(10) +#define PF0INT_OICR_HLP_PAGE_RSV1_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PF0INT_OICR_HLP_PAGE_RSV1_M : E800_PF0INT_OICR_HLP_PAGE_RSV1_M) +#define E800_PF0INT_OICR_HLP_PAGE_RSV1_M MAKEMASK(0xFF, 2) +#define E830_PF0INT_OICR_HLP_PAGE_RSV1_M MAKEMASK(0x3F, 2) +#define E800_PF0INT_OICR_HLP_PAGE_HH_COMP_S 10 +#define E800_PF0INT_OICR_HLP_PAGE_HH_COMP_M BIT(10)#define PF0INT_OICR_HLP_PAGE_TSYN_TX_S 11#define PF0INT_OICR_HLP_PAGE_TSYN_TX_M BIT(11)#define PF0INT_OICR_HLP_PAGE_TSYN_EVNT_S 12
@@ -542,9 +546,11 @@#define PF0INT_OICR_PSM_PAGE_QUEUE_S 1#define PF0INT_OICR_PSM_PAGE_QUEUE_M BIT(1)#define PF0INT_OICR_PSM_PAGE_RSV1_S 2 -#define PF0INT_OICR_PSM_PAGE_RSV1_M MAKEMASK(0xFF, 2) -#define PF0INT_OICR_PSM_PAGE_HH_COMP_S 10 -#define PF0INT_OICR_PSM_PAGE_HH_COMP_M BIT(10) +#define PF0INT_OICR_PSM_PAGE_RSV1_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PF0INT_OICR_PSM_PAGE_RSV1_M : E800_PF0INT_OICR_PSM_PAGE_RSV1_M) +#define E800_PF0INT_OICR_PSM_PAGE_RSV1_M MAKEMASK(0xFF, 2) +#define E830_PF0INT_OICR_PSM_PAGE_RSV1_M MAKEMASK(0x3F, 2) +#define E800_PF0INT_OICR_PSM_PAGE_HH_COMP_S 10 +#define E800_PF0INT_OICR_PSM_PAGE_HH_COMP_M BIT(10)#define PF0INT_OICR_PSM_PAGE_TSYN_TX_S 11#define PF0INT_OICR_PSM_PAGE_TSYN_TX_M BIT(11)#define PF0INT_OICR_PSM_PAGE_TSYN_EVNT_S 12
@@ -4397,11 +4403,11 @@#define GLTPB_100G_MAC_FC_THRESH_PORT0_FC_THRESH_M MAKEMASK(0xFFFF, 0)#define GLTPB_100G_MAC_FC_THRESH_PORT1_FC_THRESH_S 16#define GLTPB_100G_MAC_FC_THRESH_PORT1_FC_THRESH_M MAKEMASK(0xFFFF, 16) -#define GLTPB_100G_RPB_FC_THRESH 0x0009963C/* Reset Source: CORER */ -#define GLTPB_100G_RPB_FC_THRESH_PORT0_FC_THRESH_S 0 -#define GLTPB_100G_RPB_FC_THRESH_PORT0_FC_THRESH_M MAKEMASK(0xFFFF, 0) -#define GLTPB_100G_RPB_FC_THRESH_PORT1_FC_THRESH_S 16 -#define GLTPB_100G_RPB_FC_THRESH_PORT1_FC_THRESH_M MAKEMASK(0xFFFF, 16) +#define E800_GLTPB_100G_RPB_FC_THRESH 0x0009963C/* Reset Source: CORER */ +#define E800_GLTPB_100G_RPB_FC_THRESH_PORT0_FC_THRESH_S 0 +#define E800_GLTPB_100G_RPB_FC_THRESH_PORT0_FC_THRESH_M MAKEMASK(0xFFFF, 0) +#define E800_GLTPB_100G_RPB_FC_THRESH_PORT1_FC_THRESH_S 16 +#define E800_GLTPB_100G_RPB_FC_THRESH_PORT1_FC_THRESH_M MAKEMASK(0xFFFF, 16)#define GLTPB_PACING_10G 0x000994E4/* Reset Source: CORER */ #define GLTPB_PACING_10G_N_S 0#define GLTPB_PACING_10G_N_M MAKEMASK(0xFF, 0)
@@ -4545,7 +4551,9 @@#define GLINT_TSYN_PFMSTR_PF_MASTER_M MAKEMASK(0x7, 0)#define GLINT_TSYN_PHY 0x0016CC50/* Reset Source: CORER */ #define GLINT_TSYN_PHY_PHY_INDX_S 0 -#define GLINT_TSYN_PHY_PHY_INDX_M MAKEMASK(0x1F, 0) +#define GLINT_TSYN_PHY_PHY_INDX_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_GLINT_TSYN_PHY_PHY_INDX_M : E800_GLINT_TSYN_PHY_PHY_INDX_M) +#define E800_GLINT_TSYN_PHY_PHY_INDX_M MAKEMASK(0x1F, 0) +#define E830_GLINT_TSYN_PHY_PHY_INDX_M MAKEMASK(0xFF, 0)#define GLINT_VECT2FUNC (_INT) (0x00162000 + ((_INT) * 4))/* _i=0...2047 */ /* Reset Source: CORER */ #define GLINT_VECT2FUNC_MAX_INDEX 2047#define GLINT_VECT2FUNC_VF_NUM_S 0
@@ -4605,9 +4613,11 @@#define PF0INT_OICR_CPM_QUEUE_S 1#define PF0INT_OICR_CPM_QUEUE_M BIT(1)#define PF0INT_OICR_CPM_RSV1_S 2 -#define PF0INT_OICR_CPM_RSV1_M MAKEMASK(0xFF, 2) -#define PF0INT_OICR_CPM_HH_COMP_S 10 -#define PF0INT_OICR_CPM_HH_COMP_M BIT(10) +#define PF0INT_OICR_CPM_RSV1_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PF0INT_OICR_CPM_RSV1_M : E800_PF0INT_OICR_CPM_RSV1_M) +#define E800_PF0INT_OICR_CPM_RSV1_M MAKEMASK(0xFF, 2) +#define E830_PF0INT_OICR_CPM_RSV1_M MAKEMASK(0x3F, 2) +#define E800_PF0INT_OICR_CPM_HH_COMP_S 10 +#define E800_PF0INT_OICR_CPM_HH_COMP_M BIT(10)#define PF0INT_OICR_CPM_TSYN_TX_S 11#define PF0INT_OICR_CPM_TSYN_TX_M BIT(11)#define PF0INT_OICR_CPM_TSYN_EVNT_S 12
@@ -4696,9 +4706,11 @@#define PF0INT_OICR_HLP_QUEUE_S 1#define PF0INT_OICR_HLP_QUEUE_M BIT(1)#define PF0INT_OICR_HLP_RSV1_S 2 -#define PF0INT_OICR_HLP_RSV1_M MAKEMASK(0xFF, 2) -#define PF0INT_OICR_HLP_HH_COMP_S 10 -#define PF0INT_OICR_HLP_HH_COMP_M BIT(10) +#define PF0INT_OICR_HLP_RSV1_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PF0INT_OICR_HLP_RSV1_M : E800_PF0INT_OICR_HLP_RSV1_M) +#define E800_PF0INT_OICR_HLP_RSV1_M MAKEMASK(0xFF, 2) +#define E830_PF0INT_OICR_HLP_RSV1_M MAKEMASK(0x3F, 2) +#define E800_PF0INT_OICR_HLP_HH_COMP_S 10 +#define E800_PF0INT_OICR_HLP_HH_COMP_M BIT(10)#define PF0INT_OICR_HLP_TSYN_TX_S 11#define PF0INT_OICR_HLP_TSYN_TX_M BIT(11)#define PF0INT_OICR_HLP_TSYN_EVNT_S 12
@@ -4745,9 +4757,11 @@#define PF0INT_OICR_PSM_QUEUE_S 1#define PF0INT_OICR_PSM_QUEUE_M BIT(1)#define PF0INT_OICR_PSM_RSV1_S 2 -#define PF0INT_OICR_PSM_RSV1_M MAKEMASK(0xFF, 2) -#define PF0INT_OICR_PSM_HH_COMP_S 10 -#define PF0INT_OICR_PSM_HH_COMP_M BIT(10) +#define PF0INT_OICR_PSM_RSV1_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PF0INT_OICR_PSM_RSV1_M : E800_PF0INT_OICR_PSM_RSV1_M) +#define E800_PF0INT_OICR_PSM_RSV1_M MAKEMASK(0xFF, 2) +#define E830_PF0INT_OICR_PSM_RSV1_M MAKEMASK(0x3F, 2) +#define E800_PF0INT_OICR_PSM_HH_COMP_S 10 +#define E800_PF0INT_OICR_PSM_HH_COMP_M BIT(10)#define PF0INT_OICR_PSM_TSYN_TX_S 11#define PF0INT_OICR_PSM_TSYN_TX_M BIT(11)#define PF0INT_OICR_PSM_TSYN_EVNT_S 12
@@ -4868,9 +4882,11 @@#define PFINT_OICR_QUEUE_S 1#define PFINT_OICR_QUEUE_M BIT(1)#define PFINT_OICR_RSV1_S 2 -#define PFINT_OICR_RSV1_M MAKEMASK(0xFF, 2) -#define PFINT_OICR_HH_COMP_S 10 -#define PFINT_OICR_HH_COMP_M BIT(10) +#define PFINT_OICR_RSV1_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PFINT_OICR_RSV1_M : E800_PFINT_OICR_RSV1_M) +#define E800_PFINT_OICR_RSV1_M MAKEMASK(0xFF, 2) +#define E830_PFINT_OICR_RSV1_M MAKEMASK(0x3F, 2) +#define E800_PFINT_OICR_HH_COMP_S 10 +#define E800_PFINT_OICR_HH_COMP_M BIT(10)#define PFINT_OICR_TSYN_TX_S 11#define PFINT_OICR_TSYN_TX_M BIT(11)#define PFINT_OICR_TSYN_EVNT_S 12
@@ -4936,7 +4952,9 @@#define PFINT_SB_CTL_INTEVENT_M BIT(31)#define PFINT_TSYN_MSK 0x0016C980/* Reset Source: CORER */ #define PFINT_TSYN_MSK_PHY_INDX_S 0 -#define PFINT_TSYN_MSK_PHY_INDX_M MAKEMASK(0x1F, 0) +#define PFINT_TSYN_MSK_PHY_INDX_M_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PFINT_TSYN_MSK_PHY_INDX_M : E800_PFINT_TSYN_MSK_PHY_INDX_M) +#define E800_PFINT_TSYN_MSK_PHY_INDX_M MAKEMASK(0x1F, 0) +#define E830_PFINT_TSYN_MSK_PHY_INDX_M MAKEMASK(0xFF, 0)#define QINT_RQCTL (_QRX) (0x00150000 + ((_QRX) * 4))/* _i=0...2047 */ /* Reset Source: CORER */ #define QINT_RQCTL_MAX_INDEX 2047#define QINT_RQCTL_MSIX_INDX_S 0
@@ -5443,12 +5461,15 @@#define GL_FWRESETCNT 0x00083100/* Reset Source: POR */ #define GL_FWRESETCNT_FWRESETCNT_S 0#define GL_FWRESETCNT_FWRESETCNT_M MAKEMASK(0xFFFFFFFF, 0) -#define GL_MNG_FW_RAM_STAT 0x0008309C/* Reset Source: POR */ +#define GL_MNG_FW_RAM_STAT_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_GL_MNG_FW_RAM_STAT : E800_GL_MNG_FW_RAM_STAT) +#define E800_GL_MNG_FW_RAM_STAT 0x0008309C/* Reset Source: POR */ +#define E830_GL_MNG_FW_RAM_STAT 0x000830F4/* Reset Source: POR */ #define GL_MNG_FW_RAM_STAT_FW_RAM_RST_STAT_S 0#define GL_MNG_FW_RAM_STAT_FW_RAM_RST_STAT_M BIT(0)#define GL_MNG_FW_RAM_STAT_MNG_MEM_ECC_ERR_S 1#define GL_MNG_FW_RAM_STAT_MNG_MEM_ECC_ERR_M BIT(1)#define GL_MNG_FWSM 0x000B6134/* Reset Source: POR */ +#define GL_MNG_FWSM_FW_LOADING_M BIT(30)#define GL_MNG_FWSM_FW_MODES_S 0#define GL_MNG_FWSM_FW_MODES_M MAKEMASK(0x7, 0)#define GL_MNG_FWSM_RSV0_S 3
Signature · 1 line
2.43.0
PATCH v3 4/129 net/ice/base: update phy config during link restart
In reply to Anatoly BurakovFrom: Siddaraju DH <[email protected]>
Update en_link in curr_user_phy_cfg.caps on successful execution of set_link_restart_an operation.
--- drivers/net/ice/base/ice_common.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_common.c +11 -1
@@ -3966,6 +3966,7 @@ int ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, struct ice_sq_cd *cd) { + int status = ICE_ERR_AQ_ERROR;struct ice_aqc_restart_an *cmd;struct ice_aq_desc desc;
@@ -3980,7 +3981,16 @@ ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link,else cmd->cmd_flags &= ~ICE_AQC_RESTART_AN_LINK_ENABLE ; -return ice_aq_send_cmd (pi->hw, &desc,NULL ,0 , cd); + status =ice_aq_send_cmd (pi->hw, &desc,NULL ,0 , cd); +if (status) +return status; + +if (ena_link) + pi->phy.curr_user_phy_cfg.caps |=ICE_AQC_PHY_EN_LINK ; +else + pi->phy.curr_user_phy_cfg.caps &= ~ICE_AQC_PHY_EN_LINK ; + +return 0 ; }/**
Signature · 1 line
2.43.0
PATCH v3 5/129 net/ice/base: fix for pointer to variable outside scope
In reply to Anatoly BurakovFrom: Stefan Wegrzyn <[email protected]>
Currently, the 'temp' variable is in the same scope as 'first_teid_ptr' and we take point to it, which means on new loop iterations the memory goes out of scope and we keep a dangling pointer. Move 'temp' to outside of the loop to fix it.
--- drivers/net/ice/base/ice_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_sched.c +1 -1
@@ -1069,11 +1069,11 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,u32 *first_teid_ptr = first_node_teid;u16 new_num_nodes = num_nodes;int status =0 ; +u32 temp; *num_nodes_added =0 ;while (*num_nodes_added < num_nodes) {u16 max_child_nodes, num_added =0 ; -u32 temp; status = ice_sched_add_nodes_to_hw_layer(pi, tc_node, parent, layer, new_num_nodes,
Signature · 1 line
2.43.0
PATCH v3 6/129 net/ice/base: add missing include
In reply to Anatoly BurakovFrom: Jesse Brandeburg <[email protected]>
When building with certain targets, a missing include was causing a compilation failure. Add the missing include.
--- drivers/net/ice/base/ice_flow.h | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/base/ice_flow.h +1 -0
@@ -7,6 +7,7 @@#include "ice_flex_type.h" #include "ice_acl.h" +#include "ice_parser.h" #define ICE_IPV4_MAKE_PREFIX_MASK (prefix) ((u32)(~0) << (32 - (prefix)))#define ICE_FLOW_PROF_ID_INVAL 0xfffffffffffffffful
Signature · 1 line
2.43.0
PATCH v3 7/129 net/ice/base: add ability to set markid via switch filter
In reply to Anatoly BurakovFrom: Zhirun Yan <[email protected]>
Support to add large action to set 32 bits markid via switch filter.
--- drivers/net/ice/base/ice_switch.c | 22 ++++++++++++---------- drivers/net/ice/base/ice_switch.h | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 22 deletions(-)
drivers/net/ice/base/ice_switch.c +12 -10
@@ -9333,9 +9333,10 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, struct ice_rule_query_data *added_entry) {struct ice_adv_fltr_mgmt_list_entry *m_entry, *adv_fltr =NULL ; -u16 lg_act_size, lg_act_id =ICE_INVAL_LG_ACT_INDEX ; +u16 lg_act_sz, lg_act_id =ICE_INVAL_LG_ACT_INDEX ;u16 rid =0 , i, pkt_len, rule_buf_sz, vsi_handle;const struct ice_dummy_pkt_offsets *pkt_offsets; +struct ice_aqc_sw_rules_elem *lg_rule =NULL ;struct ice_aqc_sw_rules_elem *s_rule =NULL ;struct ice_aqc_sw_rules_elem *rx_tx;struct LIST_HEAD_TYPE *rule_head;
@@ -9457,7 +9458,7 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,ICE_SINGLE_ACT_Q_REGION_M ;break ;case ICE_SET_MARK : -if (rinfo->sw_act.markid != (rinfo->sw_act.markid &0xFFFF )) +if (rinfo->sw_act.markid >0xFFFF ) nb_lg_acts_mark +=1 ;/* Allocate a hardware table entry to hold large act. */ status =ice_alloc_res_lg_act (hw, &lg_act_id, nb_lg_acts_mark);
@@ -9521,18 +9522,19 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, rx_tx = s_rule;if (rinfo->sw_act.fltr_act ==ICE_SET_MARK ) { - lg_act_size = (u16 )ICE_SW_RULE_LG_ACT_SIZE (nb_lg_acts_mark); - s_rule =ice_fill_sw_marker_lg_act (hw, rinfo->sw_act.markid, - lg_act_id, rule_buf_sz, - lg_act_size, nb_lg_acts_mark, - s_rule); -if (!s_rule) + lg_act_sz = (u16 )ICE_SW_RULE_LG_ACT_SIZE (nb_lg_acts_mark); + lg_rule =ice_fill_sw_marker_lg_act (hw, rinfo->sw_act.markid, + lg_act_id, rule_buf_sz, + lg_act_sz, nb_lg_acts_mark, + s_rule); +if (!lg_rule) goto err_ice_add_adv_rule; - rule_buf_sz += lg_act_size; + s_rule = lg_rule; + rule_buf_sz += lg_act_sz; num_rules +=1 ; rx_tx = (struct ice_aqc_sw_rules_elem *) - ((u8 *)s_rule + lg_act_size); + ((u8 *)s_rule + lg_act_sz); } status = ice_aq_sw_rules(hw, (struct ice_aqc_sw_rules *)s_rule,
drivers/net/ice/base/ice_switch.h +12 -12
@@ -219,19 +219,19 @@ struct ice_adv_lkup_elem {union ice_prot_hdr m_u;/* Mask of header values to match */ }; -struct lg_entry_vsi_fwd { +struct entry_vsi_fwd {u16 vsi_list;u8 list;u8 valid; }; -struct lg_entry_to_q { +struct entry_to_q {u16 q_idx;u8 q_region_sz;u8 q_pri; }; -struct lg_entry_prune { +struct entry_prune {u16 vsi_list;u8 list;u8 egr;
@@ -239,27 +239,27 @@ struct lg_entry_prune {u8 prune_t; }; -struct lg_entry_mirror { +struct entry_mirror {u16 mirror_vsi; }; -struct lg_entry_generic_act { +struct entry_generic_act {u16 generic_value;u8 offset;u8 priority; }; -struct lg_entry_statistics { +struct entry_statistics {u8 counter_idx; };union lg_act_entry { -struct lg_entry_vsi_fwd vsi_fwd; -struct lg_entry_to_q to_q; -struct lg_entry_prune prune; -struct lg_entry_mirror mirror; -struct lg_entry_generic_act generic_act; -struct lg_entry_statistics statistics; +struct entry_vsi_fwd vsi_fwd; +struct entry_to_q to_q; +struct entry_prune prune; +struct entry_mirror mirror; +struct entry_generic_act generic_act; +struct entry_statistics statistics; };struct ice_prof_type_entry {u16 prof_id;
Signature · 1 line
2.43.0
PATCH v3 8/129 net/ice/base: improve ice_debug_cq messages
In reply to Anatoly BurakovFrom: Jacob Keller <[email protected]>
The ice_debug_cq function is called to print debug data for a control queue descriptor in multiple places. This includes both before we send a message on a transmit queue, after the writeback completion of a message on the transmit queue, and when we receive a message on a receive queue.
This function does not include data about *which* control queue the message is on, nor whether it was what we sent to the queue or what we received from the queue.
Modify ice_debug_cq to take two extra parameters, a pointer to the control queue and a boolean indicating if this was a response or a command. Improve the debug messages by replacing "CQ CMD" with a string indicating which specific control queue (based on cq->qtype) and whether this was a command sent by the PF or a response from the queue.
This helps make the log output easier to understand and consume when debugging.
Also tidy existing comments.
--- drivers/net/ice/base/ice_controlq.c | 80 +++++++++++++++++++---------- 1 file changed, 53 insertions(+), 27 deletions(-)
drivers/net/ice/base/ice_controlq.c +53 -27
@@ -176,7 +176,7 @@ ice_alloc_rq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq)if (cq->rq_buf_size >ICE_AQ_LG_BUF ) desc->flags |=CPU_TO_LE16 (ICE_AQ_FLAG_LB ); desc->opcode =0 ; -/* This is in accordance with Admin queue design, there is no +/* This is in accordance with control queue design, there is no * register for buffer size configuration */ desc->datalen =CPU_TO_LE16 (bi->size);
@@ -379,11 +379,11 @@ static int ice_init_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) }/** -* ice_init_rq - initialize ARQ +* ice_init_rq - initialize receive side of a control queue * @hw: pointer to the hardware structure * @cq: pointer to the specific Control queue * -* The main initialization routine for the Admin Receive (Event) Queue. +* The main initialization routine for Receive side of a control queue. * Prior to calling this function, the driver *MUST* set the following fields * in the cq->structure: * - cq->num_rq_entries
@@ -441,7 +441,7 @@ static int ice_init_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq) }/** -* ice_shutdown_sq - shutdown the Control ATQ +* ice_shutdown_sq - shutdown the transmit side of a control queue * @hw: pointer to the hardware structure * @cq: pointer to the specific Control queue *
@@ -461,7 +461,7 @@ ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) goto shutdown_sq_out; } -/* Stop firmware AdminQ processing */ +/* Stop processing of the control queue */ wr32 (hw, cq->sq.head,0 );wr32 (hw, cq->sq.tail,0 );wr32 (hw, cq->sq.len,0 );
@@ -834,7 +834,7 @@ void ice_destroy_all_ctrlq(struct ice_hw *hw) }/** -* ice_clean_sq - cleans Admin send queue (ATQ) +* ice_clean_sq - cleans send side of a control queue * @hw: pointer to the hardware structure * @cq: pointer to the specific Control queue *
@@ -866,16 +866,42 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)return ICE_CTL_Q_DESC_UNUSED (sq); } +/** +* ice_ctl_q_str - Convert control queue type to string +* @qtype: the control queue type +* +* Returns: A string name for the given control queue type. +*/ +static const char *ice_ctl_q_str (enum ice_ctl_q qtype) +{ +switch (qtype) { +case ICE_CTL_Q_UNKNOWN : +return "Unknown CQ" ; +case ICE_CTL_Q_ADMIN : +return "AQ" ; +case ICE_CTL_Q_MAILBOX : +return "MBXQ" ; +case ICE_CTL_Q_SB : +return "SBQ" ; +default : +return "Unrecognized CQ" ; + } +} +/** * ice_debug_cq * @hw: pointer to the hardware structure +* @cq: pointer to the specific Control queue * @desc: pointer to control queue descriptor * @buf: pointer to command buffer * @buf_len: max length of buf +* @response: true if this is the writeback response * * Dumps debug log about control command with descriptor contents. */ -static void ice_debug_cq (struct ice_hw *hw,void *desc,void *buf,u16 buf_len) +static void +ice_debug_cq (struct ice_hw *hw,struct ice_ctl_q_info *cq, +void *desc,void *buf,u16 buf_len,bool response) {struct ice_aq_desc *cq_desc = (struct ice_aq_desc *)desc;u16 datalen, flags;
@@ -889,7 +915,8 @@ static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len) datalen =LE16_TO_CPU (cq_desc->datalen); flags =LE16_TO_CPU (cq_desc->flags); -ice_debug (hw,ICE_DBG_AQ_DESC ,"CQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n" , +ice_debug (hw,ICE_DBG_AQ_DESC ,"%s %s: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n" , +ice_ctl_q_str (cq->qtype), response ?"Response" :"Command" ,LE16_TO_CPU (cq_desc->opcode), flags, datalen,LE16_TO_CPU (cq_desc->retval)); ice_debug(hw, ICE_DBG_AQ_DESC, "\tcookie (h,l) 0x%08X 0x%08X\n",
@@ -914,23 +941,23 @@ static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len) }/** -* ice_sq_done - check if FW has processed the Admin Send Queue (ATQ) +* ice_sq_done - check if the last send on a control queue has completed * @hw: pointer to the HW struct * @cq: pointer to the specific Control queue * -* Returns true if the firmware has processed all descriptors on the -* admin send queue. Returns false if there are still requests pending. +* Returns: true if all the descriptors on the send side of a control queue +* are finished processing, false otherwise. */ static bool ice_sq_done (struct ice_hw *hw,struct ice_ctl_q_info *cq) { -/* AQ designers suggest use of head for better +/* control queue designers suggest use of head for better * timing reliability than DD bit */ return rd32 (hw, cq->sq.head) == cq->sq.next_to_use; }/** -* ice_sq_send_cmd_nolock - send command to Control Queue (ATQ) +* ice_sq_send_cmd_nolock - send command to a control queue * @hw: pointer to the HW struct * @cq: pointer to the specific Control queue * @desc: prefilled descriptor describing the command (non DMA mem)
@@ -938,8 +965,9 @@ static bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)* @buf_size: size of buffer for indirect commands (or 0 for direct commands) * @cd: pointer to command details structure * -* This is the main send command routine for the ATQ. It runs the queue, -* cleans the queue, etc. +* This is the main send command routine for a control queue. It prepares the +* command into a descriptor, bumps the send queue tail, waits for the command +* to complete, captures status and data for the command, etc. */ int ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,
@@ -1035,8 +1063,7 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,/* Debug desc and buffer */ ice_debug (hw,ICE_DBG_AQ_DESC ,"ATQ: Control Send queue desc and buffer:\n" ); - -ice_debug_cq (hw, (void *)desc_on_ring, buf, buf_size); +ice_debug_cq (hw, cq, (void *)desc_on_ring, buf, buf_size, false); (cq->sq.next_to_use)++;if (cq->sq.next_to_use == cq->sq.count)
@@ -1084,8 +1111,7 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq, }ice_debug (hw,ICE_DBG_AQ_MSG ,"ATQ: desc and buffer writeback:\n" ); - -ice_debug_cq (hw, (void *)desc, buf, buf_size); +ice_debug_cq (hw, cq, (void *)desc, buf, buf_size, true);/* save writeback AQ if requested */ if (details->wb_desc)
@@ -1109,7 +1135,7 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq, }/** -* ice_sq_send_cmd - send command to Control Queue (ATQ) +* ice_sq_send_cmd - send command to a control queue * @hw: pointer to the HW struct * @cq: pointer to the specific Control queue * @desc: prefilled descriptor describing the command
@@ -1117,8 +1143,9 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,* @buf_size: size of buffer for indirect commands (or 0 for direct commands) * @cd: pointer to command details structure * -* This is the main send command routine for the ATQ. It runs the queue, -* cleans the queue, etc. +* Main command for the transmit side of a control queue. It puts the command +* on the queue, bumps the tail, waits for processing of the command, captures +* command status and results, etc. */ int ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
@@ -1160,9 +1187,9 @@ void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode)* @e: event info from the receive descriptor, includes any buffers * @pending: number of events that could be left to process * -* This function cleans one Admin Receive Queue element and returns -* the contents through e. It can also return how many events are -* left to process through 'pending'. +* Clean one element from the receive side of a control queue. On return 'e' +* contains contents of the message, and 'pending' contains the number of +* events left to process. */ int ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
@@ -1218,8 +1245,7 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq, e->msg_len, ICE_DMA_TO_NONDMA);ice_debug (hw,ICE_DBG_AQ_DESC ,"ARQ: desc and buffer:\n" ); - -ice_debug_cq (hw, (void *)desc, e->msg_buf, cq->rq_buf_size); +ice_debug_cq (hw, cq, (void *)desc, e->msg_buf, cq->rq_buf_size, true);/* Restore the original datalen and buffer address in the desc, * FW updates datalen to indicate the event message size
Signature · 1 line
2.43.0
PATCH v3 9/129 net/ice/base: add mgmt netlist auth support command
In reply to Anatoly BurakovFrom: Fabio Pricoco <[email protected]>
Add new Admin Q command to check if netlist auth is supported.
--- drivers/net/ice/base/ice_common.c | 5 +++++ drivers/net/ice/base/ice_type.h | 2 ++ 2 files changed, 7 insertions(+)
drivers/net/ice/base/ice_common.c +5 -0
@@ -2495,6 +2495,11 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, true : false;ice_debug (hw,ICE_DBG_INIT ,"%s: nvm_unified_update = %d\n" , prefix, caps->nvm_unified_update); + caps->netlist_auth = + (number &ICE_NVM_MGMT_NETLIST_AUTH_SUPPORT ) ? + true : false; +ice_debug (hw,ICE_DBG_INIT ,"%s: netlist_auth = %d\n" , prefix, + caps->netlist_auth);break ;case ICE_AQC_CAPS_MAX_MTU : caps->max_mtu = number;
drivers/net/ice/base/ice_type.h +2 -0
@@ -602,9 +602,11 @@ struct ice_hw_common_caps {bool sec_rev_disabled;bool update_disabled;bool nvm_unified_update; +bool netlist_auth;#define ICE_NVM_MGMT_SEC_REV_DISABLED BIT(0)#define ICE_NVM_MGMT_UPDATE_DISABLED BIT(1)#define ICE_NVM_MGMT_UNIFIED_UPD_SUPPORT BIT(3) +#define ICE_NVM_MGMT_NETLIST_AUTH_SUPPORT BIT(5)/* PCIe reset avoidance */ bool pcie_reset_avoidance;/* false: not supported, true: supported */ /* Post update reset restriction */
Signature · 1 line
2.43.0
PATCH v3 10/129 net/ice/base: avoid undefined variables
In reply to Anatoly BurakovFrom: Fabio Pricoco <[email protected]>
Initialize some variable to avoid "variable might be not defined" warning. This is due to the fact that when using silicon validation tools, sometimes alternative fragments of code are being executed exclusively thanks to use of goto, which some compilers cannot handle correctly.
--- drivers/net/ice/base/ice_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_switch.c +2 -2
@@ -5768,7 +5768,7 @@ ice_cfg_dflt_vsi(struct ice_port_info *pi, u16 vsi_handle, bool set, u8 direction) {struct ice_fltr_list_entry f_list_entry; -struct ice_sw_recipe *recp_list; +struct ice_sw_recipe *recp_list =NULL ;struct ice_fltr_info f_info;struct ice_hw *hw = pi->hw;u8 lport = pi->lport;
@@ -10091,7 +10091,7 @@ int ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi, u16 vsi_handle) { - struct ice_switch_info *sw; + struct ice_switch_info *sw = NULL;int status;u8 i;
Signature · 1 line
2.43.0