Skip to content

Commit 0f9d502

Browse files
refactormanJeff Kirsher
authored andcommitted
ice: Refactor VSI allocation, deletion and rebuild flow
This patch refactors aspects of the VSI allocation, deletion and rebuild flow. Some of the more noteworthy changes are described below. 1) On reset, all switch filters applied in the hardware are lost. In the rebuild flow, only MAC and broadcast filters are being restored. Instead, use a new function ice_replay_all_fltr to restore all the filters that were previously added. To do this, remove calls to ice_remove_vsi_fltr to prevent cleaning out the internal bookkeeping structures that ice_replay_all_fltr uses to replay filters. 2) Introduce a new state bit __ICE_PREPARED_FOR_RESET to distinguish the PF that requested the reset (and consequently prepared for it) from the rest of the PFs. These other PFs will prepare for reset only when they receive an interrupt from the firmware. 3) Use new functions ice_add_vsi and ice_free_vsi to create and destroy VSIs respectively. These functions accept a handle to uniquely identify a VSI. This same handle is required to rebuild the VSI post reset. To prevent confusion, the existing ice_vsi_add was renamed to ice_vsi_init. 4) Enhance ice_vsi_setup for the upcoming SR-IOV changes and expose a new wrapper function ice_pf_vsi_setup to create PF VSIs. Rework the error handling path in ice_setup_pf_sw. 5) Introduce a new function ice_vsi_release_all to release all PF VSIs. Signed-off-by: Anirudh Venkataramanan <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 80d144c commit 0f9d502

File tree

7 files changed

+580
-171
lines changed

7 files changed

+580
-171
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ extern const char ice_drv_ver[];
6262
#define ICE_RES_VALID_BIT 0x8000
6363
#define ICE_RES_MISC_VEC_ID (ICE_RES_VALID_BIT - 1)
6464
#define ICE_INVAL_Q_INDEX 0xffff
65+
#define ICE_INVAL_VFID 256
6566

6667
#define ICE_VSIQF_HKEY_ARRAY_SIZE ((VSIQF_HKEY_MAX_INDEX + 1) * 4)
6768

@@ -122,6 +123,7 @@ struct ice_sw {
122123
enum ice_state {
123124
__ICE_DOWN,
124125
__ICE_NEEDS_RESTART,
126+
__ICE_PREPARED_FOR_RESET, /* set by driver when prepared */
125127
__ICE_RESET_RECOVERY_PENDING, /* set by driver when reset starts */
126128
__ICE_PFR_REQ, /* set by driver and peers */
127129
__ICE_CORER_REQ, /* set by driver and peers */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,7 @@ struct ice_aq_desc {
12531253
struct ice_aqc_add_txqs add_txqs;
12541254
struct ice_aqc_dis_txqs dis_txqs;
12551255
struct ice_aqc_add_get_update_free_vsi vsi_cmd;
1256+
struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res;
12561257
struct ice_aqc_alloc_free_res_cmd sw_res_ctrl;
12571258
struct ice_aqc_set_event_mask set_event_mask;
12581259
struct ice_aqc_get_link_status get_link_status;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ enum ice_status ice_reset(struct ice_hw *hw, enum ice_reset_req req)
711711
ice_debug(hw, ICE_DBG_INIT, "GlobalR requested\n");
712712
val = GLGEN_RTRIG_GLOBR_M;
713713
break;
714+
default:
715+
return ICE_ERR_PARAM;
714716
}
715717

716718
val |= rd32(hw, GLGEN_RTRIG);

0 commit comments

Comments
 (0)