ice: Call ice_aq_set_mac_cfg
Subsystems (2)
Tony Nguyen
maintainerPATCH 1/15 ice: Call ice_aq_set_mac_cfg
From: Anirudh Venkataramanan <[email protected]>
As per the specification, the driver needs to call set_mac_cfg (opcode 0x0603) to be able to exercise jumbo frames. Call the function during initialization and the post reset rebuild flow.
--- .../net/ethernet/intel/ice/ice_adminq_cmd.h | 21 ++++++ drivers/net/ethernet/intel/ice/ice_common.c | 69 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_common.h | 2 + .../net/ethernet/intel/ice/ice_hw_autogen.h | 5 ++ drivers/net/ethernet/intel/ice/ice_main.c | 6 ++ 5 files changed, 103 insertions(+)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +21 -0
@@ -1069,6 +1069,25 @@ struct ice_aqc_set_phy_cfg_data {u8 rsvd1; }; +/* Set MAC Config command data structure (direct 0x0603) */ +struct ice_aqc_set_mac_cfg { +__le16 max_frame_size; +u8 params; +#define ICE_AQ_SET_MAC_PACE_S 3 +#define ICE_AQ_SET_MAC_PACE_M (0xF << ICE_AQ_SET_MAC_PACE_S) +#define ICE_AQ_SET_MAC_PACE_TYPE_M BIT(7) +#define ICE_AQ_SET_MAC_PACE_TYPE_RATE 0 +#define ICE_AQ_SET_MAC_PACE_TYPE_FIXED ICE_AQ_SET_MAC_PACE_TYPE_M +u8 tx_tmr_priority; +__le16 tx_tmr_value; +__le16 fc_refresh_threshold; +u8 drop_opts; +#define ICE_AQ_SET_MAC_AUTO_DROP_MASK BIT(0) +#define ICE_AQ_SET_MAC_AUTO_DROP_NONE 0 +#define ICE_AQ_SET_MAC_AUTO_DROP_BLOCKING_PKTS BIT(0) +u8 reserved[7 ]; +}; +/* Restart AN command data structure (direct 0x0605) * Also used for response, with only the lport_num field present. */
@@ -1806,6 +1825,7 @@ struct ice_aq_desc {struct ice_aqc_download_pkg download_pkg;struct ice_aqc_set_mac_lb set_mac_lb;struct ice_aqc_alloc_free_res_cmd sw_res_ctrl; +struct ice_aqc_set_mac_cfg set_mac_cfg;struct ice_aqc_set_event_mask set_event_mask;struct ice_aqc_get_link_status get_link_status;struct ice_aqc_event_lan_overflow lan_overflow;
@@ -1902,6 +1922,7 @@ enum ice_adminq_opc {/* PHY commands */ ice_aqc_opc_get_phy_caps =0x0600 , ice_aqc_opc_set_phy_cfg =0x0601 , + ice_aqc_opc_set_mac_cfg =0x0603 , ice_aqc_opc_restart_an =0x0605 , ice_aqc_opc_get_link_status =0x0607 , ice_aqc_opc_set_event_mask = 0x0613,
drivers/net/ethernet/intel/ice/ice_common.c +69 -0
81 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_common.h +2 -0
@@ -108,6 +108,8 @@ enum ice_status ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, struct ice_sq_cd *cd);enum ice_status +ice_aq_set_mac_cfg (struct ice_hw *hw,u16 max_frame_size,struct ice_sq_cd *cd); +enum ice_status ice_aq_get_link_info (struct ice_port_info *pi,bool ena_lse,struct ice_link_status *link,struct ice_sq_cd *cd);enum ice_status
drivers/net/ethernet/intel/ice/ice_hw_autogen.h +5 -0
@@ -219,6 +219,11 @@#define VPLAN_TX_QBASE_VFNUMQ_M ICE_M(0xFF, 16)#define VPLAN_TXQ_MAPENA (_VF) (0x00073800 + ((_VF) * 4))#define VPLAN_TXQ_MAPENA_TX_ENA_M BIT(0) +#define PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA (_i) (0x001E36E0 + ((_i) * 32)) +#define PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX 8 +#define PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M ICE_M(0xFFFF, 0) +#define PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER (_i) (0x001E3800 + ((_i) * 32)) +#define PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M ICE_M(0xFFFF, 0)#define GL_MDCK_TX_TDPU 0x00049348#define GL_MDCK_TX_TDPU_RCU_ANTISPOOF_ITR_DIS_M BIT(1)#define GL_MDET_RX 0x00294C00
drivers/net/ethernet/intel/ice/ice_main.c +6 -0
@@ -4963,6 +4963,12 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type) goto err_init_ctrlq; } + ret =ice_aq_set_mac_cfg (hw,ICE_AQ_SET_MAC_FRAME_SIZE_MAX ,NULL ); +if (ret) { +dev_err (dev,"set_mac_cfg failed %s\n" ,ice_stat_str (ret)); + goto err_init_ctrlq; + } + err =ice_sched_init_port (hw->port_info);if (err) goto err_sched_init_port;
Signature · 1 line
2.20.1
Tony Nguyen
maintainerPATCH 2/15 ice: print Rx MDD auto reset message before VF reset
From: Paul Greenwalt <[email protected]>
Rx MDD auto reset message was not being logged because logging occurred after the VF reset and the VF MDD data was reinitialized.
Log the Rx MDD auto reset message before triggering the VF reset.
--- drivers/net/ethernet/intel/ice/ice_main.c | 7 +++++- .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 25 ++++++++++++++----- .../net/ethernet/intel/ice/ice_virtchnl_pf.h | 2 ++ 3 files changed, 27 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +6 -1
@@ -1326,8 +1326,13 @@ static void ice_handle_mdd_event(struct ice_pf *pf)* PF can be configured to reset the VF through ethtool * private flag mdd-auto-reset-vf. */ -if (test_bit (ICE_FLAG_MDD_AUTO_RESET_VF , pf->flags)) +if (test_bit (ICE_FLAG_MDD_AUTO_RESET_VF , pf->flags)) { +/* VF MDD event counters will be cleared by +* reset, so print the event prior to reset. +*/ +ice_print_vf_rx_mdd_event (vf);ice_reset_vf (&pf->vf[i], false); + } } }
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +19 -6
@@ -3764,6 +3764,24 @@ int ice_get_vf_stats(struct net_device *netdev, int vf_id,return 0 ; } +/** +* ice_print_vf_rx_mdd_event - print VF Rx malicious driver detect event +* @vf: pointer to the VF structure +*/ +void ice_print_vf_rx_mdd_event (struct ice_vf *vf) +{ +struct ice_pf *pf = vf->pf; +struct device *dev; + + dev =ice_pf_to_dev (pf); + +dev_info (dev,"%d Rx Malicious Driver Detection events detected on PF %d VF %d MAC %pM. mdd-auto-reset-vfs=%s\n" , + vf->mdd_rx_events.count, pf->hw.pf_id, vf->vf_id, + vf->dflt_lan_addr.addr, +test_bit (ICE_FLAG_MDD_AUTO_RESET_VF , pf->flags) + ?"on" :"off" ); +} +/** * ice_print_vfs_mdd_event - print VFs malicious driver detect event * @pf: pointer to the PF structure
@@ -3793,12 +3811,7 @@ void ice_print_vfs_mdd_events(struct ice_pf *pf)if (vf->mdd_rx_events.count != vf->mdd_rx_events.last_printed) { vf->mdd_rx_events.last_printed = vf->mdd_rx_events.count; - -dev_info (dev,"%d Rx Malicious Driver Detection events detected on PF %d VF %d MAC %pM. mdd-auto-reset-vfs=%s\n" , - vf->mdd_rx_events.count, hw->pf_id, i, - vf->dflt_lan_addr.addr, -test_bit (ICE_FLAG_MDD_AUTO_RESET_VF , pf->flags) - ?"on" :"off" ); +ice_print_vf_rx_mdd_event (vf); }/* only print Tx MDD event message if there are new events */
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h +2 -0
@@ -132,6 +132,7 @@ bool ice_is_any_vf_in_promisc(struct ice_pf *pf);void ice_vf_lan_overflow_event (struct ice_pf *pf,struct ice_rq_event_info *event);void ice_print_vfs_mdd_events (struct ice_pf *pf); +void ice_print_vf_rx_mdd_event (struct ice_vf *vf);#else /* CONFIG_PCI_IOV */ #define ice_process_vflr_event (pf) do {} while (0)#define ice_free_vfs (pf) do {} while (0)
@@ -141,6 +142,7 @@ void ice_print_vfs_mdd_events(struct ice_pf *pf);#define ice_set_vf_state_qs_dis (vf) do {} while (0)#define ice_vf_lan_overflow_event (pf, event) do {} while (0)#define ice_print_vfs_mdd_events (pf) do {} while (0) +#define ice_print_vf_rx_mdd_event (vf) do {} while (0) static inline bool ice_reset_all_vfs(struct ice_pf __always_unused *pf,
Signature · 1 line
2.20.1
Bowers
PATCH 2/15 ice: print Rx MDD auto reset message before VF reset
Quoted 13 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 02/15] ice: print Rx MDD auto reset message before VF resetFrom: Paul Greenwalt <[email protected]>
Rx MDD auto reset message was not being logged because logging occurred after the VF reset and the VF MDD data was reinitialized.
Quoted 8 lines
Log the Rx MDD auto reset message before triggering the VF reset.
Signed-off-by Paul Greenwalt <[email protected]>--- drivers/net/ethernet/intel/ice/ice_main.c | 7 +++++- .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 25 ++++++++++++++----- .../net/ethernet/intel/ice/ice_virtchnl_pf.h | 2 ++ 3 files changed, 27 insertions(+), 7 deletions(-)
Tony Nguyen
maintainerPATCH 3/15 ice: Fix Tx timeout when link is toggled on a VF's interface
In reply to Tony NguyenFrom: Brett Creeley <[email protected]>
Currently if the iavf is loaded and a VF link transitions from up to down to up again a Tx timeout will be triggered. This happens because Tx/Rx queue interrupts are only enabled when receiving the VIRTCHNL_OP_CONFIG_MAP_IRQ message, which happens on reset or initial iavf driver load, but not when bringing link up. This is problematic because they are disabled on the VIRTCHNL_OP_DISABLE_QUEUES message, which is part of bringing a VF's link down. However, they are not enabled on the VIRTCHNL_OP_ENABLE_QUEUES message, which is part of bringing a VF's link up.
Fix this by re-enabling the VF's Rx and Tx queue interrupts when they were previously configured. This is done by first checking to make sure the previous value in QINT_[R|T]QCTL.MSIX_INDX is not 0, which is used to represent the OICR in the VF's interrupt space. If the MSIX_INDX is non-zero then enable the interrupt by setting the QINT_[R|T]CTL.CAUSE_ENA bit to 1.
--- .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +48 -0
@@ -2291,6 +2291,52 @@ static bool ice_vc_validate_vqs_bitmaps(struct virtchnl_queue_select *vqs)return true; } +/** +* ice_vf_ena_txq_interrupt - enable Tx queue interrupt via QINT_TQCTL +* @vsi: VSI of the VF to configure +* @q_idx: VF queue index used to determine the queue in the PF's space +*/ +static void ice_vf_ena_txq_interrupt (struct ice_vsi *vsi,u32 q_idx) +{ +struct ice_hw *hw = &vsi->back->hw; +u32 pfq = vsi->txq_map[q_idx]; +u32 reg; + + reg =rd32 (hw,QINT_TQCTL (pfq)); + +/* MSI-X index 0 in the VF's space is always for the OICR, which means +* this is most likely a poll mode VF driver, so don't enable an +* interrupt that was never configured via VIRTCHNL_OP_CONFIG_IRQ_MAP +*/ +if (!(reg &QINT_TQCTL_MSIX_INDX_M )) +return ; + +wr32 (hw,QINT_TQCTL (pfq), reg |QINT_TQCTL_CAUSE_ENA_M ); +} + +/** +* ice_vf_ena_rxq_interrupt - enable Tx queue interrupt via QINT_RQCTL +* @vsi: VSI of the VF to configure +* @q_idx: VF queue index used to determine the queue in the PF's space +*/ +static void ice_vf_ena_rxq_interrupt (struct ice_vsi *vsi,u32 q_idx) +{ +struct ice_hw *hw = &vsi->back->hw; +u32 pfq = vsi->rxq_map[q_idx]; +u32 reg; + + reg =rd32 (hw,QINT_RQCTL (pfq)); + +/* MSI-X index 0 in the VF's space is always for the OICR, which means +* this is most likely a poll mode VF driver, so don't enable an +* interrupt that was never configured via VIRTCHNL_OP_CONFIG_IRQ_MAP +*/ +if (!(reg &QINT_RQCTL_MSIX_INDX_M )) +return ; + +wr32 (hw,QINT_RQCTL (pfq), reg |QINT_RQCTL_CAUSE_ENA_M ); +} +/** * ice_vc_ena_qs_msg * @vf: pointer to the VF info
@@ -2351,6 +2397,7 @@ static int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg) goto error_param; } +ice_vf_ena_rxq_interrupt (vsi, vf_q_id);set_bit (vf_q_id, vf->rxq_ena); }
@@ -2365,6 +2412,7 @@ static int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg)if (test_bit (vf_q_id, vf->txq_ena))continue ; +ice_vf_ena_txq_interrupt (vsi, vf_q_id);set_bit (vf_q_id, vf->txq_ena); }
Signature · 1 line
2.20.1
Bowers
PATCH 3/15 ice: Fix Tx timeout when link is toggled on a VF's interface
Quoted 26 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 03/15] ice: Fix Tx timeout when link is toggled on a VF's interfaceFrom: Brett Creeley <[email protected]>
Currently if the iavf is loaded and a VF link transitions from up to down to up again a Tx timeout will be triggered. This happens because Tx/Rx queue interrupts are only enabled when receiving the
VIRTCHNL_OP_CONFIG_MAP_IRQmessage, which happens on reset or initial iavf driver load, but not when bringing link up. This is problematic because they are disabled on theVIRTCHNL_OP_DISABLE_QUEUESmessage, which is part of bringing a VF's link down. However, they are not enabled on theVIRTCHNL_OP_ENABLE_QUEUESmessage, which is part of bringing a VF's link up.Fix this by re-enabling the VF's Rx and Tx queue interrupts when they were previously configured. This is done by first checking to make sure the previous value in QINT_[R|T]QCTL.MSIX_INDX is not 0, which is used to represent the OICR in the VF's interrupt space. If the
MSIX_INDXis non-zero then enable the interrupt by setting the QINT_[R|T]CTL.CAUSE_ENA bit to 1.
Quoted 4 lines
Signed-off-by Brett Creeley <[email protected]>--- .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+)
Tony Nguyen
maintainerPATCH 4/15 ice: Check if unicast MAC exists before setting VF MAC
In reply to Tony NguyenFrom: Brett Creeley <[email protected]>
Currently if a unicast MAC is set via ndo_set_vf_mac, the PF driver will set the VF's dflt_lan_addr.addr once some basic checks have passed. The VF is then reset. During reset the PF driver will attempt to program the VF's MAC from the dflt_lan_addr.addr field. This fails when the MAC already exists on the PF's switch.
This is causing the VF to be completely disabled until removing/enabling any VFs via sysfs.
Fix this by checking if the unicast MAC exists before triggering a VF reset directly in ndo_set_vf_mac. Also, add a check if the unicast MAC is set to the same value as before and return 0 if that is the case.
--- .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +43 -0
@@ -3648,6 +3648,39 @@ ice_get_vf_cfg(struct net_device *netdev, int vf_id, struct ifla_vf_info *ivi)return 0 ; } +/** +* ice_unicast_mac_exists - check if the unicast MAC exists on the PF's switch +* @pf: PF used to reference the switch's rules +* @umac: unicast MAC to compare against existing switch rules +* +* Return true on the first/any match, else return false +*/ +static bool ice_unicast_mac_exists (struct ice_pf *pf,u8 *umac) +{ +struct ice_sw_recipe *mac_recipe_list = + &pf->hw.switch_info->recp_list[ICE_SW_LKUP_MAC ]; +struct ice_fltr_mgmt_list_entry *list_itr; +struct list_head *rule_head; +struct mutex *rule_lock;/* protect MAC filter list access */ + + rule_head = &mac_recipe_list->filt_rules; + rule_lock = &mac_recipe_list->filt_rule_lock; + +mutex_lock (rule_lock); +list_for_each_entry (list_itr, rule_head, list_entry) { +u8 *existing_mac = &list_itr->fltr_info.l_data.mac.mac_addr[0 ]; + +if (ether_addr_equal (existing_mac, umac)) { +mutex_unlock (rule_lock); +return true; + } + } + +mutex_unlock (rule_lock); + +return false; +} +/** * ice_set_vf_mac * @netdev: network interface device structure
@@ -3671,10 +3704,20 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac) } vf = &pf->vf[vf_id]; +/* nothing left to do, unicast MAC already set */ +if (ether_addr_equal (vf->dflt_lan_addr.addr, mac)) +return 0 ; + ret =ice_check_vf_ready_for_cfg (vf);if (ret)return ret; +if (ice_unicast_mac_exists (pf, mac)) { +netdev_err (netdev,"Unicast MAC %pM already exists on this PF. Preventing setting VF %u unicast MAC address to %pM\n" , + mac, vf_id, mac); +return -EINVAL ; + } +/* copy MAC into dflt_lan_addr and trigger a VF reset. The reset * flow will use the updated dflt_lan_addr and add a MAC filter * using ice_add_mac. Also set pf_set_mac to indicate that the PF has
Signature · 1 line
2.20.1
Bowers
PATCH 4/15 ice: Check if unicast MAC exists before setting VF MAC
Quoted 19 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 04/15] ice: Check if unicast MAC exists before setting VF MACFrom: Brett Creeley <[email protected]>
Currently if a unicast MAC is set via
ndo_set_vf_mac, the PF driver will set the VF's dflt_lan_addr.addr once some basic checks have passed. The VF is then reset. During reset the PF driver will attempt to program the VF's MAC from the dflt_lan_addr.addr field. This fails when the MAC already exists on the PF's switch.This is causing the VF to be completely disabled until removing/enabling any VFs via sysfs.
Quoted 8 lines
Fix this by checking if the unicast MAC exists before triggering a VF reset directly in
ndo_set_vf_mac. Also, add a check if the unicast MAC is set to the same value as before and return 0 if that is the case.Signed-off-by Brett Creeley <[email protected]>--- .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+)
Tony Nguyen
maintainerPATCH 5/15 ice: check for compatibility between DDP package and firmware
In reply to Tony NguyenFrom: Victor Raj <[email protected]>
Require the Dynamic Device Personalization (DDP) file to have the same major version number and the same or older minor number than the firmware version major and minor, respectively.
Check the OS and NVM package versions before downloading the package. If the OS package version is not compatible with NVM then return an appropriate error.
Split the 32-byte segment name into a 28-byte segment name and a 4-byte Track-ID. Older packages will still work with this change because no package has a name that will take up more than 28 bytes; in this case the Track-ID will be 0.
Note that the driver will store the segment name as 32-bytes in the ice_hw structure, in order to normalize the length of the various package name strings that it uses.
Also add section ID and structure for the segment metadata section.
--- .../net/ethernet/intel/ice/ice_adminq_cmd.h | 4 +- .../net/ethernet/intel/ice/ice_flex_pipe.c | 112 ++++++++++++++---- .../net/ethernet/intel/ice/ice_flex_type.h | 8 +- drivers/net/ethernet/intel/ice/ice_main.c | 5 + drivers/net/ethernet/intel/ice/ice_status.h | 2 + drivers/net/ethernet/intel/ice/ice_type.h | 1 + 6 files changed, 102 insertions(+), 30 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +3 -1
@@ -1734,10 +1734,12 @@ struct ice_pkg_ver { };#define ICE_PKG_NAME_SIZE 32 +#define ICE_SEG_NAME_SIZE 28struct ice_aqc_get_pkg_info {struct ice_pkg_ver ver; -char name[ICE_PKG_NAME_SIZE ]; +char name[ICE_SEG_NAME_SIZE ]; +__le32 track_id;u8 is_in_nvm;u8 is_active;u8 is_active_at_boot;
drivers/net/ethernet/intel/ice/ice_flex_pipe.c +87 -25
164 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_flex_type.h +4 -4
@@ -20,7 +20,7 @@ struct ice_fv {/* Package and segment headers and tables */ struct ice_pkg_hdr { -struct ice_pkg_ver format_ver; +struct ice_pkg_ver pkg_format_ver;__le32 seg_count;__le32 seg_offset[1 ]; };
@@ -30,9 +30,9 @@ struct ice_generic_seg_hdr {#define SEGMENT_TYPE_METADATA 0x00000001#define SEGMENT_TYPE_ICE 0x00000010__le32 seg_type; -struct ice_pkg_ver seg_ver; +struct ice_pkg_ver seg_format_ver;__le32 seg_size; -char seg_name[ICE_PKG_NAME_SIZE ]; +char seg_id[ICE_PKG_NAME_SIZE ]; };/* ice specific segment */
@@ -75,7 +75,7 @@ struct ice_buf_table {struct ice_global_metadata_seg {struct ice_generic_seg_hdr hdr;struct ice_pkg_ver pkg_ver; -__le32 track_id; +__le32 rsvd;char pkg_name[ICE_PKG_NAME_SIZE ]; };
drivers/net/ethernet/intel/ice/ice_main.c +5 -0
@@ -3077,6 +3077,9 @@ ice_log_pkg_init(struct ice_hw *hw, enum ice_status *status) *status =ICE_ERR_NOT_SUPPORTED ; }break ; +case ICE_ERR_FW_DDP_MISMATCH : +dev_err (dev,"The firmware loaded on the device is not compatible with the DDP package. Please update the device's NVM. Entering safe mode.\n" ); +break ;case ICE_ERR_BUF_TOO_SHORT :case ICE_ERR_CFG :dev_err (dev,"The DDP package file is invalid. Entering Safe Mode.\n" );
@@ -5271,6 +5274,8 @@ const char *ice_stat_str(enum ice_status stat_err)return "ICE_ERR_HW_TABLE" ;case ICE_ERR_DOES_NOT_EXIST :return "ICE_ERR_DOES_NOT_EXIST" ; +case ICE_ERR_FW_DDP_MISMATCH : +return "ICE_ERR_FW_DDP_MISMATCH" ;case ICE_ERR_AQ_ERROR :return "ICE_ERR_AQ_ERROR" ;case ICE_ERR_AQ_TIMEOUT :
drivers/net/ethernet/intel/ice/ice_status.h +2 -0
@@ -27,6 +27,8 @@ enum ice_status {ICE_ERR_MAX_LIMIT =-17 ,ICE_ERR_RESET_ONGOING =-18 ,ICE_ERR_HW_TABLE =-19 , +ICE_ERR_FW_DDP_MISMATCH =-20 , +ICE_ERR_NVM_CHECKSUM =-51 ,ICE_ERR_BUF_TOO_SHORT =-52 , ICE_ERR_NVM_BLANK_MODE = -53,
drivers/net/ethernet/intel/ice/ice_type.h +1 -0
@@ -601,6 +601,7 @@ struct ice_hw {/* Active package version (currently active) */ struct ice_pkg_ver active_pkg_ver; +u32 active_track_id;u8 active_pkg_name[ICE_PKG_NAME_SIZE ];u8 active_pkg_in_nvm;
Signature · 1 line
2.20.1
Bowers
PATCH 5/15 ice: check for compatibility between DDP package and firmware
Quoted 33 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 05/15] ice: check for compatibility between DDP package and firmwareFrom: Victor Raj <[email protected]>
Require the Dynamic Device Personalization (DDP) file to have the same major version number and the same or older minor number than the firmware version major and minor, respectively.
Check the OS and NVM package versions before downloading the package. If the OS package version is not compatible with NVM then return an appropriate error.
Split the 32-byte segment name into a 28-byte segment name and a 4-byte Track-ID. Older packages will still work with this change because no package has a name that will take up more than 28 bytes; in this case the Track-ID will be 0.
Note that the driver will store the segment name as 32-bytes in the
ice_hwstructure, in order to normalize the length of the various package name strings that it uses.Also add section ID and structure for the segment metadata section.
Signed-off-by Victor Raj <[email protected]>Signed-off-by Dan Nowlin <[email protected]>Signed-off-by Bruce Allan <[email protected]>Signed-off-by Tony Nguyen <[email protected]>
Quoted 8 lines
--- .../net/ethernet/intel/ice/ice_adminq_cmd.h | 4 +- .../net/ethernet/intel/ice/ice_flex_pipe.c | 112 ++++++++++++++---- .../net/ethernet/intel/ice/ice_flex_type.h | 8 +- drivers/net/ethernet/intel/ice/ice_main.c | 5 + drivers/net/ethernet/intel/ice/ice_status.h | 2 + drivers/net/ethernet/intel/ice/ice_type.h | 1 + 6 files changed, 102 insertions(+), 30 deletions(-)
Tony Nguyen
maintainerPATCH 6/15 ice: Fix bad register reads
In reply to Tony NguyenFrom: Anirudh Venkataramanan <[email protected]>
The "ethtool -d" handler reads registers in the ice_regs_dump_list array and returns read values back to the userspace.
The register offsets PFINT0_ITR* are not valid as per the specification and reading these causes a "unable to handle kernel paging request" bug in the driver. Remove these registers from ice_regs_dump_list.
--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 3 --- drivers/net/ethernet/intel/ice/ice_hw_autogen.h | 3 --- 2 files changed, 6 deletions(-)
drivers/net/ethernet/intel/ice/ice_ethtool.c +0 -3
@@ -142,9 +142,6 @@ static const u32 ice_regs_dump_list[] = {QINT_RQCTL (0 ),PFINT_OICR_ENA , QRX_ITR(0), -PF0INT_ITR_0 (0 ), -PF0INT_ITR_1 (0 ), - PF0INT_ITR_2(0), }; struct ice_priv_flag {
drivers/net/ethernet/intel/ice/ice_hw_autogen.h +0 -3
@@ -6,9 +6,6 @@#ifndef _ICE_HW_AUTOGEN_H_#define _ICE_HW_AUTOGEN_H_ -#define PF0INT_ITR_0 (_i) (0x03000004 + ((_i) * 4096)) -#define PF0INT_ITR_1 (_i) (0x03000008 + ((_i) * 4096)) -#define PF0INT_ITR_2 (_i) (0x0300000C + ((_i) * 4096))#define QTX_COMM_DBELL (_DBQM) (0x002C0000 + ((_DBQM) * 4))#define QTX_COMM_HEAD (_DBQM) (0x000E0000 + ((_DBQM) * 4))#define QTX_COMM_HEAD_HEAD_S 0
Signature · 1 line
2.20.1
Bowers
PATCH 6/15 ice: Fix bad register reads
Quoted 16 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 06/15] ice: Fix bad register readsFrom: Anirudh Venkataramanan <[email protected]>
The "ethtool -d" handler reads registers in the
ice_regs_dump_listarray and returns read values back to the userspace.The register offsets PFINT0_ITR* are not valid as per the specification and reading these causes a "unable to handle kernel paging request" bug in the driver. Remove these registers from
ice_regs_dump_list.
Quoted 7 lines
Signed-off-by: Anirudh Venkataramanan
<[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 3 --- drivers/net/ethernet/intel/ice/ice_hw_autogen.h | 3 --- 2 files changed, 6 deletions(-)
Tony Nguyen
maintainerPATCH 7/15 ice: fix usage of incorrect variable
In reply to Tony NguyenFrom: Jesse Brandeburg <[email protected]>
The driver was using rq_last_status where it should have been using sq_last_status. Fix the string to be using the correct error reporting variable.
--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 2 +- drivers/net/ethernet/intel/ice/ice_main.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_ethtool.c +1 -1
@@ -3251,7 +3251,7 @@ static int ice_vsi_set_dflt_rss_lut(struct ice_vsi *vsi, int req_rss_size)if (status) {dev_err (dev,"Cannot set RSS lut, err %s aq_err %s\n" ,ice_stat_str (status), -ice_aq_str (hw->adminq.rq_last_status)); +ice_aq_str (hw->adminq.sq_last_status)); err = -EIO ; }
drivers/net/ethernet/intel/ice/ice_main.c +4 -4
@@ -5317,7 +5317,7 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)if (status) {dev_err (dev,"Cannot set RSS key, err %s aq_err %s\n" ,ice_stat_str (status), -ice_aq_str (hw->adminq.rq_last_status)); +ice_aq_str (hw->adminq.sq_last_status));return -EIO ; } }
@@ -5328,7 +5328,7 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)if (status) {dev_err (dev,"Cannot set RSS lut, err %s aq_err %s\n" ,ice_stat_str (status), -ice_aq_str (hw->adminq.rq_last_status)); +ice_aq_str (hw->adminq.sq_last_status));return -EIO ; } }
@@ -5361,7 +5361,7 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)if (status) {dev_err (dev,"Cannot get RSS key, err %s aq_err %s\n" ,ice_stat_str (status), -ice_aq_str (hw->adminq.rq_last_status)); +ice_aq_str (hw->adminq.sq_last_status));return -EIO ; } }
@@ -5372,7 +5372,7 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)if (status) {dev_err (dev,"Cannot get RSS lut, err %s aq_err %s\n" ,ice_stat_str (status), -ice_aq_str (hw->adminq.rq_last_status)); +ice_aq_str (hw->adminq.sq_last_status));return -EIO ; } }
Signature · 1 line
2.20.1
Bowers
PATCH 7/15 ice: fix usage of incorrect variable
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 07/15] ice: fix usage of incorrect variableFrom: Jesse Brandeburg <[email protected]>
Quoted 8 lines
The driver was using
rq_last_statuswhere it should have been usingsq_last_status. Fix the string to be using the correct error reporting variable.Signed-off-by Jesse Brandeburg <[email protected]>--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 2 +- drivers/net/ethernet/intel/ice/ice_main.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
Tony Nguyen
maintainerPATCH 8/15 ice: cleanup unsigned loops
In reply to Tony NguyenFrom: Jesse Brandeburg <[email protected]>
Fix loop variables that are comparing or assigning signed against unsigned values, mostly by declaring loop counters as unsigned.
--- drivers/net/ethernet/intel/ice/ice_dcb_nl.c | 9 +++++---- drivers/net/ethernet/intel/ice/ice_ethtool.c | 10 +++++----- drivers/net/ethernet/intel/ice/ice_main.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/ice/ice_dcb_nl.c +5 -4
@@ -671,7 +671,7 @@ static bool ice_dcbnl_find_app(struct ice_dcbx_cfg *cfg, struct ice_dcb_app_priority_table *app) { - int i; + unsigned int i;for (i =0 ; i < cfg->numapps; i++) { if (app->selector == cfg->app[i].selector &&
@@ -746,7 +746,8 @@ static int ice_dcbnl_delapp(struct net_device *netdev, struct dcb_app *app) {struct ice_pf *pf =ice_netdev_to_pf (netdev);struct ice_dcbx_cfg *old_cfg, *new_cfg; -int i, j, ret =0 ; +unsigned int i, j; +int ret =0 ;if (pf->dcbx_cap &DCB_CAP_DCBX_LLD_MANAGED )return -EINVAL ;
@@ -869,7 +870,7 @@ void ice_dcbnl_set_all(struct ice_vsi *vsi)struct ice_port_info *pi;struct dcb_app sapp;struct ice_pf *pf; -int i; +unsigned int i;if (!netdev)return ;
@@ -941,7 +942,7 @@ ice_dcbnl_flush_apps(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg, struct ice_dcbx_cfg *new_cfg) {struct ice_vsi *main_vsi =ice_get_main_vsi (pf); -int i; +unsigned int i;if (!main_vsi)return ;
drivers/net/ethernet/intel/ice/ice_ethtool.c +5 -5
@@ -205,7 +205,7 @@ ice_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)struct ice_pf *pf = np->vsi->back;struct ice_hw *hw = &pf->hw;u32 *regs_buf = (u32 *)p; -int i; +unsigned int i; regs->version =1 ;
@@ -308,7 +308,7 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,*/ static bool ice_active_vfs (struct ice_pf *pf) { -int i; +unsigned int i;ice_for_each_vf (pf, i) {struct ice_vf *vf = &pf->vf[i];
@@ -378,7 +378,7 @@ static int ice_reg_pattern_test(struct ice_hw *hw, u32 reg, u32 mask) 0x00000000, 0xFFFFFFFF };u32 val, orig_val; -int i; +unsigned int i; orig_val =rd32 (hw, reg);for (i =0 ; i <ARRAY_SIZE (patterns); ++i) {
@@ -431,7 +431,7 @@ static u64 ice_reg_test(struct net_device *netdev) GLINT_ITR(2, 1) - GLINT_ITR(2, 0)}, {GLINT_CTL, 0xffff0001, 1, 0} }; -int i; +unsigned int i;netdev_dbg (netdev,"Register test\n" );for (i =0 ; i <ARRAY_SIZE (ice_reg_list); ++i) {
@@ -3759,10 +3759,10 @@ ice_get_module_eeprom(struct net_device *netdev,struct ice_hw *hw = &pf->hw;enum ice_status status;bool is_sfp = false; +unsigned int i;u16 offset =0 ;u8 value =0 ;u8 page =0 ; -int i; status =ice_aq_sff_eeprom (hw,0 , addr, offset, page,0 , &value,1 ,0 ,NULL );
drivers/net/ethernet/intel/ice/ice_main.c +2 -2
@@ -453,7 +453,7 @@ static void ice_prepare_for_reset(struct ice_pf *pf) {struct ice_hw *hw = &pf->hw; -int i; +unsigned int i;/* already prepared for reset */ if (test_bit (__ICE_PREPARED_FOR_RESET, pf->state))
@@ -1192,8 +1192,8 @@ static void ice_handle_mdd_event(struct ice_pf *pf) {struct device *dev =ice_pf_to_dev (pf);struct ice_hw *hw = &pf->hw; +unsigned int i;u32 reg; -int i;if (!test_and_clear_bit (__ICE_MDD_EVENT_PENDING, pf->state)) {/* Since the VF MDD event logging is rate limited, check if
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +2 -2
@@ -80,7 +80,7 @@ ice_vc_vf_broadcast(struct ice_pf *pf, enum virtchnl_ops v_opcode, enum virtchnl_status_code v_retval, u8 *msg, u16 msglen) { struct ice_hw *hw = &pf->hw; -int i; +unsigned int i;ice_for_each_vf (pf, i) {struct ice_vf *vf = &pf->vf[i];
@@ -325,7 +325,7 @@ void ice_free_vfs(struct ice_pf *pf) {struct device *dev =ice_pf_to_dev (pf);struct ice_hw *hw = &pf->hw; -int tmp, i; +unsigned int tmp, i;if (!pf->vf)return ;
Signature · 1 line
2.20.1
Bowers
PATCH 8/15 ice: cleanup unsigned loops
Quoted 12 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 08/15] ice: cleanup unsigned loopsFrom: Jesse Brandeburg <[email protected]>
Fix loop variables that are comparing or assigning signed against unsigned values, mostly by declaring loop counters as unsigned.
Quoted 7 lines
Signed-off-by Jesse Brandeburg <[email protected]>--- drivers/net/ethernet/intel/ice/ice_dcb_nl.c | 9 +++++---- drivers/net/ethernet/intel/ice/ice_ethtool.c | 10 +++++----- drivers/net/ethernet/intel/ice/ice_main.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-)
Tony Nguyen
maintainerPATCH 9/15 ice: fix signed vs unsigned comparisons
In reply to Tony NguyenFrom: Jesse Brandeburg <[email protected]>
Fix the remaining signed vs unsigned issues, which appear when compiling with -Werror=sign-compare.
Many of these are because there is an external interface that is passing an int to us (which we can't change) but that we (rightfully) store and compare against as an unsigned in our data structures.
--- drivers/net/ethernet/intel/ice/ice_base.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_main.c | 8 ++++---- drivers/net/ethernet/intel/ice/ice_txrx.h | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/ice/ice_base.c +2 -2
@@ -12,7 +12,7 @@*/ static int __ice_vsi_get_qs_contig (struct ice_qs_cfg *qs_cfg) { -int offset, i; +unsigned int offset, i;mutex_lock (qs_cfg->qs_mutex); offset = bitmap_find_next_zero_area(qs_cfg->pf_map, qs_cfg->pf_map_size,
@@ -38,7 +38,7 @@ static int __ice_vsi_get_qs_contig(struct ice_qs_cfg *qs_cfg)*/ static int __ice_vsi_get_qs_sc (struct ice_qs_cfg *qs_cfg) { -int i, index =0 ; +unsigned int i, index =0 ;mutex_lock (qs_cfg->qs_mutex);for (i =0 ; i < qs_cfg->q_count; i++) {
drivers/net/ethernet/intel/ice/ice_main.c +4 -4
@@ -5107,7 +5107,7 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu)u8 count =0 ;int err =0 ; -if (new_mtu == netdev->mtu) { +if (new_mtu == (int )netdev->mtu) {netdev_warn (netdev,"MTU is already %u\n" , netdev->mtu);return 0 ; }
@@ -5122,11 +5122,11 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu) } } -if (new_mtu < netdev->min_mtu) { +if (new_mtu < (int )netdev->min_mtu) {netdev_err (netdev,"new MTU invalid. min_mtu is %d\n" , netdev->min_mtu);return -EINVAL ; - }else if (new_mtu > netdev->max_mtu) { + }else if (new_mtu > (int )netdev->max_mtu) {netdev_err (netdev,"new MTU invalid. max_mtu is %d\n" , netdev->min_mtu);return -EINVAL ;
@@ -5151,7 +5151,7 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu)if (!event)return -ENOMEM ; - netdev->mtu = new_mtu; + netdev->mtu = (unsigned int )new_mtu;/* if VSI is up, bring it down and then back up */ if (!test_and_set_bit (__ICE_DOWN, vsi->state)) {
drivers/net/ethernet/intel/ice/ice_txrx.h +4 -3
@@ -38,7 +38,8 @@*/ #if (PAGE_SIZE <8192 )#define ICE_2K_TOO_SMALL_WITH_PADDING \ -((NET_SKB_PAD + ICE_RXBUF_1536) > SKB_WITH_OVERHEAD(ICE_RXBUF_2048)) + ((unsigned int)(NET_SKB_PAD + ICE_RXBUF_1536) > \ + SKB_WITH_OVERHEAD(ICE_RXBUF_2048))/** * ice_compute_pad - compute the padding
@@ -107,8 +108,8 @@ static inline int ice_skb_pad(void)#define DESC_NEEDED (MAX_SKB_FRAGS + ICE_DESCS_FOR_CTX_DESC + \ ICE_DESCS_PER_CACHE_LINE + ICE_DESCS_FOR_SKB_DATA_PTR)#define ICE_DESC_UNUSED (R ) \ - ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ - (R)->next_to_clean - (R)->next_to_use - 1) + (u16)((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ + (R)->next_to_clean - (R)->next_to_use - 1)#define ICE_TX_FLAGS_TSO BIT(0)#define ICE_TX_FLAGS_HW_VLAN BIT(1)
Signature · 1 line
2.20.1
Bowers
PATCH 9/15 ice: fix signed vs unsigned comparisons
Quoted 17 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 09/15] ice: fix signed vs unsigned comparisonsFrom: Jesse Brandeburg <[email protected]>
Fix the remaining signed vs unsigned issues, which appear when compiling with -Werror=sign-compare.
Many of these are because there is an external interface that is passing an int to us (which we can't change) but that we (rightfully) store and compare against as an unsigned in our data structures.
Quoted 8 lines
Signed-off-by Jesse Brandeburg <[email protected]>Signed-off-by Bruce Allan <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ice/ice_base.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_main.c | 8 ++++---- drivers/net/ethernet/intel/ice/ice_txrx.h | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-)
Tony Nguyen
maintainerPATCH 10/15 ice: remove unused macro
In reply to Tony NguyenFrom: Jesse Brandeburg <[email protected]>
The driver had an unused define that can be removed. Found by compiler -Werror=unused-macros check.
--- drivers/net/ethernet/intel/ice/ice_dcb_nl.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_dcb_nl.c +0 -2
@@ -7,8 +7,6 @@#include "ice_dcb_nl.h" #include <net/dcbnl.h> -#define ICE_APP_PROT_ID_ROCE 0x8915 -/** * ice_dcbnl_devreset - perform enough of a ifdown/ifup to sync DCBNL info * @netdev: device associated with interface that needs reset
Signature · 1 line
2.20.1
Bowers
PATCH 10/15 ice: remove unused macro
Quoted 9 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 10/15] ice: remove unused macroFrom: Jesse Brandeburg <[email protected]>
Quoted 7 lines
The driver had an unused define that can be removed. Found by compiler - Werror=unused-macros check.
Signed-off-by Jesse Brandeburg <[email protected]>--- drivers/net/ethernet/intel/ice/ice_dcb_nl.c | 2 -- 1 file changed, 2 deletions(-)
Tony Nguyen
maintainerPATCH 11/15 ice: set VF default LAN address
In reply to Tony NguyenFrom: Paul Greenwalt <[email protected]>
Remove is_zero_ether_add() check when setting the VF default LAN address. This check assumed that the address had been delete and zeroed before calling ice_vc_add_mac_addr(). Now the default LAN address will be set to the last unicast MAC address added by the VF.
The default LAN address is reported by the PF via ndo_get_vf_config.
--- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +5 -3
@@ -2836,9 +2836,11 @@ ice_vc_add_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi, u8 *mac_addr)return -EIO ; } -/* only set dflt_lan_addr once */ -if (is_zero_ether_addr (vf->dflt_lan_addr.addr) && -is_unicast_ether_addr (mac_addr)) +/* Set the default LAN address to the latest unicast MAC address added +* by the VF. The default LAN address is reported by the PF via +* ndo_get_vf_config. +*/ +if (is_unicast_ether_addr (mac_addr))ether_addr_copy (vf->dflt_lan_addr.addr, mac_addr); vf->num_mac++;
Signature · 1 line
2.20.1
Bowers
PATCH 11/15 ice: set VF default LAN address
Quoted 15 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 11/15] ice: set VF default LAN addressFrom: Paul Greenwalt <[email protected]>
Remove
is_zero_ether_add()check when setting the VF default LAN address.
This check assumed that the address had been delete and zeroed before callingice_vc_add_mac_addr(). Now the default LAN address will be set to the last unicast MAC address added by the VF.
Quoted 6 lines
The default LAN address is reported by the PF via
ndo_get_vf_config.Signed-off-by Paul Greenwalt <[email protected]>--- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Tony Nguyen
maintainerPATCH 12/15 ice: fix MAC write command
In reply to Tony NguyenFrom: Jesse Brandeburg <[email protected]>
The manage MAC write command was implemented in an overly complex way that actually didn't work, as it wasn't symmetric to the manage MAC read command, and was feeding bytes out of order to the firmware. Fix the implementation by just using a simple array to represent the MAC address when it is being written via firmware command.
--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 10 ++++------ drivers/net/ethernet/intel/ice/ice_common.c | 5 +---- 2 files changed, 5 insertions(+), 10 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +4 -6
@@ -157,13 +157,11 @@ struct ice_aqc_manage_mac_write {#define ICE_AQC_MAN_MAC_WR_MC_MAG_EN BIT(0)#define ICE_AQC_MAN_MAC_WR_WOL_LAA_PFR_KEEP BIT(1)#define ICE_AQC_MAN_MAC_WR_S 6 -#define ICE_AQC_MAN_MAC_WR_M (3 << ICE_AQC_MAN_MAC_WR_S) +#define ICE_AQC_MAN_MAC_WR_M ICE_M(3, ICE_AQC_MAN_MAC_WR_S)#define ICE_AQC_MAN_MAC_UPDATE_LAA 0 -#define ICE_AQC_MAN_MAC_UPDATE_LAA_WOL (BIT(0) << ICE_AQC_MAN_MAC_WR_S) -/* High 16 bits of MAC address in big endian order */ -__be16 sah; -/* Low 32 bits of MAC address in big endian order */ -__be32 sal; +#define ICE_AQC_MAN_MAC_UPDATE_LAA_WOL BIT(ICE_AQC_MAN_MAC_WR_S) +/* byte stream in network order */ +u8 mac_addr[ETH_ALEN ];__le32 addr_high;__le32 addr_low; };
drivers/net/ethernet/intel/ice/ice_common.c +1 -4
@@ -2010,10 +2010,7 @@ ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags,ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_manage_mac_write); cmd->flags = flags; - -/* Prep values for flags, sah, sal */ - cmd->sah =htons (*((const u16 *)mac_addr)); - cmd->sal =htonl (*((const u32 *)(mac_addr +2 ))); +ether_addr_copy (cmd->mac_addr, mac_addr);return ice_aq_send_cmd (hw, &desc,NULL ,0 , cd); }
Signature · 1 line
2.20.1
Bowers
PATCH 12/15 ice: fix MAC write command
Quoted 15 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 12/15] ice: fix MAC write commandFrom: Jesse Brandeburg <[email protected]>
The manage MAC write command was implemented in an overly complex way that actually didn't work, as it wasn't symmetric to the manage MAC read command, and was feeding bytes out of order to the firmware. Fix the implementation by just using a simple array to represent the MAC address when it is being written via firmware command.
Quoted 5 lines
Signed-off-by Jesse Brandeburg <[email protected]>--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 10 ++++------ drivers/net/ethernet/intel/ice/ice_common.c | 5 +---- 2 files changed, 5 insertions(+), 10 deletions(-)
Tony Nguyen
maintainerPATCH 13/15 ice: Fix memory leak
In reply to Tony NguyenFrom: Surabhi Boob <[email protected]>
Handle memory leak on filter management initialization failure.
--- drivers/net/ethernet/intel/ice/ice_common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_common.c +7 -1
@@ -387,6 +387,7 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd)static enum ice_status ice_init_fltr_mgmt_struct (struct ice_hw *hw) {struct ice_switch_info *sw; +enum ice_status status; hw->switch_info =devm_kzalloc (ice_hw_to_dev (hw),sizeof (*hw->switch_info),GFP_KERNEL );
@@ -397,7 +398,12 @@ static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)INIT_LIST_HEAD (&sw->vsi_list_map_head); -return ice_init_def_sw_recp (hw); + status =ice_init_def_sw_recp (hw); +if (status) { +devm_kfree (ice_hw_to_dev (hw), hw->switch_info); +return status; + } +return 0 ; }/**
Signature · 1 line
2.20.1
Bowers
PATCH 13/15 ice: Fix memory leak
Quoted 9 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 13/15] ice: Fix memory leakFrom: Surabhi Boob <[email protected]>
Quoted 7 lines
Handle memory leak on filter management initialization failure.
Signed-off-by Surabhi Boob <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ice/ice_common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Tony Nguyen
maintainerPATCH 14/15 ice: Fix for memory leaks and modify ICE_FREE_CQ_BUFS
In reply to Tony NguyenFrom: Surabhi Boob <[email protected]>
Handle memory leaks during control queue initialization and buffer allocation failures. The macro ICE_FREE_CQ_BUFS is modified to re-use for this fix.
--- drivers/net/ethernet/intel/ice/ice_controlq.c | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-)
drivers/net/ethernet/intel/ice/ice_controlq.c +28 -21
@@ -199,7 +199,9 @@ ice_alloc_rq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq) cq->rq.r.rq_bi[i].pa =0 ; cq->rq.r.rq_bi[i].size =0 ; } + cq->rq.r.rq_bi =NULL ;devm_kfree (ice_hw_to_dev (hw), cq->rq.dma_head); + cq->rq.dma_head =NULL ;return ICE_ERR_NO_MEMORY ; }
@@ -245,7 +247,9 @@ ice_alloc_sq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq) cq->sq.r.sq_bi[i].pa =0 ; cq->sq.r.sq_bi[i].size =0 ; } + cq->sq.r.sq_bi =NULL ;devm_kfree (ice_hw_to_dev (hw), cq->sq.dma_head); + cq->sq.dma_head =NULL ;return ICE_ERR_NO_MEMORY ; }
@@ -304,6 +308,28 @@ ice_cfg_rq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq)return 0 ; } +#define ICE_FREE_CQ_BUFS(hw, qi, ring) \ +do { \ + int i; \ + /* free descriptors */ \ + if ((qi)->ring.r.ring##_bi) \ + for (i = 0; i < (qi)->num_##ring##_entries; i++) \ + if ((qi)->ring.r.ring##_bi[i].pa) { \ + dmam_free_coherent(ice_hw_to_dev(hw), \ + (qi)->ring.r.ring##_bi[i].size, \ + (qi)->ring.r.ring##_bi[i].va, \ + (qi)->ring.r.ring##_bi[i].pa); \ + (qi)->ring.r.ring##_bi[i].va = NULL;\ + (qi)->ring.r.ring##_bi[i].pa = 0;\ + (qi)->ring.r.ring##_bi[i].size = 0;\ + } \ +/* free the buffer info list */ \ +if ((qi)->ring.cmd_buf) \ +devm_kfree (ice_hw_to_dev (hw), (qi)->ring.cmd_buf); \ +/* free DMA head */ \ +devm_kfree (ice_hw_to_dev (hw), (qi)->ring.dma_head); \ +}while (0 ) +/** * ice_init_sq - main initialization routine for Control ATQ * @hw: pointer to the hardware structure
@@ -357,6 +383,7 @@ static enum ice_status ice_init_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) goto init_ctrlq_exit; init_ctrlq_free_rings: +ICE_FREE_CQ_BUFS (hw, cq, sq);ice_free_cq_ring (hw, &cq->sq); init_ctrlq_exit:
@@ -416,33 +443,13 @@ static enum ice_status ice_init_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq) goto init_ctrlq_exit; init_ctrlq_free_rings: +ICE_FREE_CQ_BUFS (hw, cq, rq);ice_free_cq_ring (hw, &cq->rq); init_ctrlq_exit:return ret_code; } -#define ICE_FREE_CQ_BUFS(hw, qi, ring) \ -do { \ - int i; \ - /* free descriptors */ \ - for (i = 0; i < (qi)->num_##ring##_entries; i++) \ - if ((qi)->ring.r.ring##_bi[i].pa) { \ - dmam_free_coherent(ice_hw_to_dev(hw), \ - (qi)->ring.r.ring##_bi[i].size,\ - (qi)->ring.r.ring##_bi[i].va,\ - (qi)->ring.r.ring##_bi[i].pa);\ - (qi)->ring.r.ring##_bi[i].va = NULL; \ - (qi)->ring.r.ring##_bi[i].pa = 0; \ - (qi)->ring.r.ring##_bi[i].size = 0; \ - } \ -/* free the buffer info list */ \ -if ((qi)->ring.cmd_buf) \ -devm_kfree (ice_hw_to_dev (hw), (qi)->ring.cmd_buf); \ -/* free DMA head */ \ -devm_kfree (ice_hw_to_dev (hw), (qi)->ring.dma_head); \ -}while (0 ) -/** * ice_shutdown_sq - shutdown the Control ATQ * @hw: pointer to the hardware structure
Signature · 1 line
2.20.1
Bowers
PATCH 14/15 ice: Fix for memory leaks and modify ICE_FREE_CQ_BUFS
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 14/15] ice: Fix for memory leaks and modifyICE_FREE_CQ_BUFSFrom: Surabhi Boob <[email protected]>
Quoted 8 lines
Handle memory leaks during control queue initialization and buffer allocation failures. The macro
ICE_FREE_CQ_BUFSis modified to re-use for this fix.Signed-off-by Surabhi Boob <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ice/ice_controlq.c | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-)
Tony Nguyen
maintainerPATCH 15/15 ice: Add more Rx errors to netdev's rx_error counter
In reply to Tony NguyenFrom: Brett Creeley <[email protected]>
Currently we are only including illegal_bytes and rx_crc_errors in the PF netdev's rx_error counter. There are many more causes of Rx errors that the device supports and reports via Ethtool. Accumulate all Rx errors in the PF netdev's rx_error counter.
--- drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_main.c +7 -1
@@ -4357,7 +4357,13 @@ void ice_update_vsi_stats(struct ice_vsi *vsi)if (vsi->type ==ICE_VSI_PF ) { cur_ns->rx_crc_errors = pf->stats.crc_errors; cur_ns->rx_errors = pf->stats.crc_errors + - pf->stats.illegal_bytes; + pf->stats.illegal_bytes + + pf->stats.rx_len_errors + + pf->stats.rx_undersize + + pf->hw_csum_rx_error + + pf->stats.rx_jabber + + pf->stats.rx_fragments + + pf->stats.rx_oversize; cur_ns->rx_length_errors = pf->stats.rx_len_errors;/* record drops from the port level */ cur_ns->rx_missed_errors = pf->stats.eth.rx_discards;
Signature · 1 line
2.20.1
Bowers
PATCH 15/15 ice: Add more Rx errors to netdev's rx_error counter
Quoted 15 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 15/15] ice: Add more Rx errors to netdev'srx_errorcounterFrom: Brett Creeley <[email protected]>
Currently we are only including
illegal_bytesandrx_crc_errorsin the PF netdev'srx_errorcounter. There are many more causes of Rx errors that the device supports and reports via Ethtool. Accumulate all Rx errors in the PF netdev'srx_errorcounter.
Quoted 4 lines
Signed-off-by Brett Creeley <[email protected]>--- drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Bowers
PATCH 1/15 ice: Call ice_aq_set_mac_cfg
In reply to Tony NguyenQuoted 16 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, May 15, 2020 5:37 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S43 01/15] ice: Callice_aq_set_mac_cfgFrom: Anirudh Venkataramanan <[email protected]>
As per the specification, the driver needs to call
set_mac_cfg(opcode0x0603) to be able to exercise jumbo frames. Call the function during initialization and the post reset rebuild flow.Signed-off-by: Anirudh Venkataramanan
<[email protected]>Signed-off-by Tony Nguyen <[email protected]>
Quoted 8 lines
--- .../net/ethernet/intel/ice/ice_adminq_cmd.h | 21 ++++++ drivers/net/ethernet/intel/ice/ice_common.c | 69 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_common.h | 2 + .../net/ethernet/intel/ice/ice_hw_autogen.h | 5 ++ drivers/net/ethernet/intel/ice/ice_main.c | 6 ++ 5 files changed, 103 insertions(+)