diff mbox series

[iwl-next,v5,04/15] ice: treat subfunction VSI the same as PF VSI

Message ID 20240606112503.1939759-5-michal.swiatkowski@linux.intel.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series ice: support devlink subfunction | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Michal Swiatkowski June 6, 2024, 11:24 a.m. UTC
When subfunction VSI is open the same code as for PF VSI should be
executed. Also when up is complete. Reflect that in code by adding
subfunction VSI to consideration.

In case of stopping, PF doesn't have additional tasks, so the same
is with subfunction VSI.

Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Fijalkowski, Maciej June 27, 2024, 11:07 a.m. UTC | #1
On Thu, Jun 06, 2024 at 01:24:52PM +0200, Michal Swiatkowski wrote:
> When subfunction VSI is open the same code as for PF VSI should be
> executed. Also when up is complete. Reflect that in code by adding
> subfunction VSI to consideration.
> 
> In case of stopping, PF doesn't have additional tasks, so the same
> is with subfunction VSI.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index e76e19036593..ddc348371841 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -6726,7 +6726,8 @@ static int ice_up_complete(struct ice_vsi *vsi)
>  
>  	if (vsi->port_info &&
>  	    (vsi->port_info->phy.link_info.link_info & ICE_AQ_LINK_UP) &&
> -	    vsi->netdev && vsi->type == ICE_VSI_PF) {
> +	    ((vsi->netdev && vsi->type == ICE_VSI_PF) ||
> +	     (vsi->netdev && vsi->type == ICE_VSI_SF))) {

patch 1 has:

	if (vsi->netdev && (vsi->type == ICE_VSI_PF ||
			    vsi->type == ICE_VSI_SF)) {

so maybe stay consistent and do the same here?

nit: also seems that a really small helper would make the code easier to
read and wrap...something like:

bool ice_is_vsi_pf_sf(struct ice_vsi* vsi)
{
	return (vsi->type == ICE_VSI_PF || vsi->type == ICE_VSI_SF);
}

>  		ice_print_link_msg(vsi, true);
>  		netif_tx_start_all_queues(vsi->netdev);
>  		netif_carrier_on(vsi->netdev);
> @@ -7427,7 +7428,7 @@ int ice_vsi_open(struct ice_vsi *vsi)
>  
>  	ice_vsi_cfg_netdev_tc(vsi, vsi->tc_cfg.ena_tc);
>  
> -	if (vsi->type == ICE_VSI_PF) {
> +	if (vsi->type == ICE_VSI_PF || vsi->type == ICE_VSI_SF) {
>  		/* Notify the stack of the actual queue counts. */
>  		err = netif_set_real_num_tx_queues(vsi->netdev, vsi->num_txq);
>  		if (err)
> -- 
> 2.42.0
>
Michal Swiatkowski June 27, 2024, 12:31 p.m. UTC | #2
On Thu, Jun 27, 2024 at 01:07:22PM +0200, Maciej Fijalkowski wrote:
> On Thu, Jun 06, 2024 at 01:24:52PM +0200, Michal Swiatkowski wrote:
> > When subfunction VSI is open the same code as for PF VSI should be
> > executed. Also when up is complete. Reflect that in code by adding
> > subfunction VSI to consideration.
> > 
> > In case of stopping, PF doesn't have additional tasks, so the same
> > is with subfunction VSI.
> > 
> > Reviewed-by: Simon Horman <horms@kernel.org>
> > Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> > ---
> >  drivers/net/ethernet/intel/ice/ice_main.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> > index e76e19036593..ddc348371841 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_main.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> > @@ -6726,7 +6726,8 @@ static int ice_up_complete(struct ice_vsi *vsi)
> >  
> >  	if (vsi->port_info &&
> >  	    (vsi->port_info->phy.link_info.link_info & ICE_AQ_LINK_UP) &&
> > -	    vsi->netdev && vsi->type == ICE_VSI_PF) {
> > +	    ((vsi->netdev && vsi->type == ICE_VSI_PF) ||
> > +	     (vsi->netdev && vsi->type == ICE_VSI_SF))) {
> 
> patch 1 has:
> 
> 	if (vsi->netdev && (vsi->type == ICE_VSI_PF ||
> 			    vsi->type == ICE_VSI_SF)) {
> 
> so maybe stay consistent and do the same here?
> 
> nit: also seems that a really small helper would make the code easier to
> read and wrap...something like:
> 
> bool ice_is_vsi_pf_sf(struct ice_vsi* vsi)
> {
> 	return (vsi->type == ICE_VSI_PF || vsi->type == ICE_VSI_SF);
> }

Make sense, hope you are ok, with changing it on the occasion (for
example adding multibuffer support).

Thanks,
Michal

> 
> >  		ice_print_link_msg(vsi, true);
> >  		netif_tx_start_all_queues(vsi->netdev);
> >  		netif_carrier_on(vsi->netdev);
> > @@ -7427,7 +7428,7 @@ int ice_vsi_open(struct ice_vsi *vsi)
> >  
> >  	ice_vsi_cfg_netdev_tc(vsi, vsi->tc_cfg.ena_tc);
> >  
> > -	if (vsi->type == ICE_VSI_PF) {
> > +	if (vsi->type == ICE_VSI_PF || vsi->type == ICE_VSI_SF) {
> >  		/* Notify the stack of the actual queue counts. */
> >  		err = netif_set_real_num_tx_queues(vsi->netdev, vsi->num_txq);
> >  		if (err)
> > -- 
> > 2.42.0
> >
Romanowski, Rafal July 23, 2024, 11:14 a.m. UTC | #3
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Michal
> Swiatkowski
> Sent: Thursday, June 27, 2024 2:31 PM
> To: Fijalkowski, Maciej <maciej.fijalkowski@intel.com>
> Cc: shayd@nvidia.com; Drewek, Wojciech <wojciech.drewek@intel.com>;
> horms@kernel.org; Samudrala, Sridhar <sridhar.samudrala@intel.com>;
> Polchlopek, Mateusz <mateusz.polchlopek@intel.com>; netdev@vger.kernel.org;
> jiri@nvidia.com; kalesh-anakkur.purayil@broadcom.com; Kubiak, Michal
> <michal.kubiak@intel.com>; intel-wired-lan@lists.osuosl.org;
> pio.raczynski@gmail.com; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>;
> Keller, Jacob E <jacob.e.keller@intel.com>
> Subject: Re: [Intel-wired-lan] [iwl-next v5 04/15] ice: treat subfunction VSI the
> same as PF VSI
> 
> On Thu, Jun 27, 2024 at 01:07:22PM +0200, Maciej Fijalkowski wrote:
> > On Thu, Jun 06, 2024 at 01:24:52PM +0200, Michal Swiatkowski wrote:
> > > When subfunction VSI is open the same code as for PF VSI should be
> > > executed. Also when up is complete. Reflect that in code by adding
> > > subfunction VSI to consideration.
> > >
> > > In case of stopping, PF doesn't have additional tasks, so the same
> > > is with subfunction VSI.
> > >
> > > Reviewed-by: Simon Horman <horms@kernel.org>
> > > Signed-off-by: Michal Swiatkowski
> > > <michal.swiatkowski@linux.intel.com>
> > > ---
> > >  drivers/net/ethernet/intel/ice/ice_main.c | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c
> > > b/drivers/net/ethernet/intel/ice/ice_main.c
> > > index e76e19036593..ddc348371841 100644
> > > --- a/drivers/net/ethernet/intel/ice/ice_main.c
> > > +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> > > @@ -6726,7 +6726,8 @@ static int ice_up_complete(struct ice_vsi


Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index e76e19036593..ddc348371841 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -6726,7 +6726,8 @@  static int ice_up_complete(struct ice_vsi *vsi)
 
 	if (vsi->port_info &&
 	    (vsi->port_info->phy.link_info.link_info & ICE_AQ_LINK_UP) &&
-	    vsi->netdev && vsi->type == ICE_VSI_PF) {
+	    ((vsi->netdev && vsi->type == ICE_VSI_PF) ||
+	     (vsi->netdev && vsi->type == ICE_VSI_SF))) {
 		ice_print_link_msg(vsi, true);
 		netif_tx_start_all_queues(vsi->netdev);
 		netif_carrier_on(vsi->netdev);
@@ -7427,7 +7428,7 @@  int ice_vsi_open(struct ice_vsi *vsi)
 
 	ice_vsi_cfg_netdev_tc(vsi, vsi->tc_cfg.ena_tc);
 
-	if (vsi->type == ICE_VSI_PF) {
+	if (vsi->type == ICE_VSI_PF || vsi->type == ICE_VSI_SF) {
 		/* Notify the stack of the actual queue counts. */
 		err = netif_set_real_num_tx_queues(vsi->netdev, vsi->num_txq);
 		if (err)