@@ -20,6 +20,8 @@ const char *ice_vsi_type_str(enum ice_vsi_type vsi_type)
2020 return "ICE_VSI_PF" ;
2121 case ICE_VSI_VF :
2222 return "ICE_VSI_VF" ;
23+ case ICE_VSI_SF :
24+ return "ICE_VSI_SF" ;
2325 case ICE_VSI_CTRL :
2426 return "ICE_VSI_CTRL" ;
2527 case ICE_VSI_CHNL :
@@ -135,6 +137,7 @@ static void ice_vsi_set_num_desc(struct ice_vsi *vsi)
135137{
136138 switch (vsi -> type ) {
137139 case ICE_VSI_PF :
140+ case ICE_VSI_SF :
138141 case ICE_VSI_CTRL :
139142 case ICE_VSI_LB :
140143 /* a user could change the values of num_[tr]x_desc using
@@ -201,6 +204,12 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi)
201204 max_t (int , vsi -> alloc_rxq ,
202205 vsi -> alloc_txq ));
203206 break ;
207+ case ICE_VSI_SF :
208+ vsi -> alloc_txq = 1 ;
209+ vsi -> alloc_rxq = 1 ;
210+ vsi -> num_q_vectors = 1 ;
211+ vsi -> irq_dyn_alloc = true;
212+ break ;
204213 case ICE_VSI_VF :
205214 if (vf -> num_req_qs )
206215 vf -> num_vf_qs = vf -> num_req_qs ;
@@ -559,6 +568,7 @@ ice_vsi_alloc_def(struct ice_vsi *vsi, struct ice_channel *ch)
559568
560569 switch (vsi -> type ) {
561570 case ICE_VSI_PF :
571+ case ICE_VSI_SF :
562572 /* Setup default MSIX irq handler for VSI */
563573 vsi -> irq_handler = ice_msix_clean_rings ;
564574 break ;
@@ -889,6 +899,11 @@ static void ice_vsi_set_rss_params(struct ice_vsi *vsi)
889899 max_rss_size );
890900 vsi -> rss_lut_type = ICE_LUT_PF ;
891901 break ;
902+ case ICE_VSI_SF :
903+ vsi -> rss_table_size = ICE_LUT_VSI_SIZE ;
904+ vsi -> rss_size = min_t (u16 , num_online_cpus (), max_rss_size );
905+ vsi -> rss_lut_type = ICE_LUT_VSI ;
906+ break ;
892907 case ICE_VSI_VF :
893908 /* VF VSI will get a small RSS table.
894909 * For VSI_LUT, LUT size should be set to 64 bytes.
@@ -1136,6 +1151,7 @@ static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)
11361151 lut_type = ICE_AQ_VSI_Q_OPT_RSS_LUT_PF ;
11371152 break ;
11381153 case ICE_VSI_VF :
1154+ case ICE_VSI_SF :
11391155 /* VF VSI will gets a small RSS table which is a VSI LUT type */
11401156 lut_type = ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI ;
11411157 break ;
@@ -1214,6 +1230,7 @@ static int ice_vsi_init(struct ice_vsi *vsi, u32 vsi_flags)
12141230 case ICE_VSI_PF :
12151231 ctxt -> flags = ICE_AQ_VSI_TYPE_PF ;
12161232 break ;
1233+ case ICE_VSI_SF :
12171234 case ICE_VSI_CHNL :
12181235 ctxt -> flags = ICE_AQ_VSI_TYPE_VMDQ2 ;
12191236 break ;
@@ -2095,6 +2112,7 @@ static void ice_set_agg_vsi(struct ice_vsi *vsi)
20952112 case ICE_VSI_CHNL :
20962113 case ICE_VSI_LB :
20972114 case ICE_VSI_PF :
2115+ case ICE_VSI_SF :
20982116 max_agg_nodes = ICE_MAX_PF_AGG_NODES ;
20992117 agg_node_id_start = ICE_PF_AGG_NODE_ID_START ;
21002118 agg_node_iter = & pf -> pf_agg_node [0 ];
@@ -2264,6 +2282,7 @@ static int ice_vsi_cfg_def(struct ice_vsi *vsi)
22642282
22652283 switch (vsi -> type ) {
22662284 case ICE_VSI_CTRL :
2285+ case ICE_VSI_SF :
22672286 case ICE_VSI_PF :
22682287 ret = ice_vsi_alloc_q_vectors (vsi );
22692288 if (ret )
@@ -2648,7 +2667,8 @@ int ice_ena_vsi(struct ice_vsi *vsi, bool locked)
26482667
26492668 clear_bit (ICE_VSI_NEEDS_RESTART , vsi -> state );
26502669
2651- if (vsi -> netdev && vsi -> type == ICE_VSI_PF ) {
2670+ if (vsi -> netdev && (vsi -> type == ICE_VSI_PF ||
2671+ vsi -> type == ICE_VSI_SF )) {
26522672 if (netif_running (vsi -> netdev )) {
26532673 if (!locked )
26542674 rtnl_lock ();
@@ -2676,7 +2696,8 @@ void ice_dis_vsi(struct ice_vsi *vsi, bool locked)
26762696
26772697 set_bit (ICE_VSI_NEEDS_RESTART , vsi -> state );
26782698
2679- if (vsi -> type == ICE_VSI_PF && vsi -> netdev ) {
2699+ if (vsi -> netdev && (vsi -> type == ICE_VSI_PF ||
2700+ vsi -> type == ICE_VSI_SF )) {
26802701 if (netif_running (vsi -> netdev )) {
26812702 if (!locked )
26822703 rtnl_lock ();
0 commit comments