Message ID | 20241031060009.38979-2-michal.swiatkowski@linux.intel.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ice: multiqueue on subfunction | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Guessing tree name failed - patch did not apply |
On Thu, Oct 31, 2024 at 07:00:07AM +0100, Michal Swiatkowski wrote: > Implement get and set for the maximum IO event queues for SF. > It is used to derive the maximum number of Rx/Tx queues on subfunction > device. > > If the value isn't set when activating set it to the low default value. > > Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com> > Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> > --- > drivers/net/ethernet/intel/ice/devlink/port.c | 37 +++++++++++++++++++ > drivers/net/ethernet/intel/ice/ice.h | 2 + > 2 files changed, 39 insertions(+) > > diff --git a/drivers/net/ethernet/intel/ice/devlink/port.c b/drivers/net/ethernet/intel/ice/devlink/port.c ... > @@ -548,6 +575,14 @@ ice_activate_dynamic_port(struct ice_dynamic_port *dyn_port, > if (dyn_port->active) > return 0; > > + if (!dyn_port->vsi->max_io_eqs) { > + err = ice_devlink_port_fn_max_io_eqs_set(&dyn_port->devlink_port, > + ICE_SF_DEFAULT_EQS, > + extack); Hi Michal, I am a little confused about the relationship between this, where ICE_SF_DEFAULT_EQS is 8, and the following check in ice_devlink_port_fn_max_io_eqs_set(). if (max_io_eqs > num_online_cpus()) { NL_SET_ERR_MSG_MOD(extack, "Supplied value out of range"); return -EINVAL; } What is the behaviour on systems with more than 8 online CPUs? > + if (err) > + return err; > + } > + > err = ice_sf_eth_activate(dyn_port, extack); > if (err) > return err; ... > diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h > index 70d5294a558c..ca0739625d3b 100644 > --- a/drivers/net/ethernet/intel/ice/ice.h > +++ b/drivers/net/ethernet/intel/ice/ice.h > @@ -109,6 +109,7 @@ > #define ICE_Q_WAIT_MAX_RETRY (5 * ICE_Q_WAIT_RETRY_LIMIT) > #define ICE_MAX_LG_RSS_QS 256 > #define ICE_INVAL_Q_INDEX 0xffff > +#define ICE_SF_DEFAULT_EQS 8 > > #define ICE_MAX_RXQS_PER_TC 256 /* Used when setting VSI context per TC Rx queues */ > ...
diff --git a/drivers/net/ethernet/intel/ice/devlink/port.c b/drivers/net/ethernet/intel/ice/devlink/port.c index 767419a67fef..a723895e4dff 100644 --- a/drivers/net/ethernet/intel/ice/devlink/port.c +++ b/drivers/net/ethernet/intel/ice/devlink/port.c @@ -530,6 +530,33 @@ void ice_devlink_destroy_sf_dev_port(struct ice_sf_dev *sf_dev) devl_port_unregister(&sf_dev->priv->devlink_port); } +static int +ice_devlink_port_fn_max_io_eqs_set(struct devlink_port *port, u32 max_io_eqs, + struct netlink_ext_ack *extack) +{ + struct ice_dynamic_port *dyn_port = ice_devlink_port_to_dyn(port); + + if (max_io_eqs > num_online_cpus()) { + NL_SET_ERR_MSG_MOD(extack, "Supplied value out of range"); + return -EINVAL; + } + + dyn_port->vsi->max_io_eqs = max_io_eqs; + + return 0; +} + +static int +ice_devlink_port_fn_max_io_eqs_get(struct devlink_port *port, u32 *max_io_eqs, + struct netlink_ext_ack *extack) +{ + struct ice_dynamic_port *dyn_port = ice_devlink_port_to_dyn(port); + + *max_io_eqs = dyn_port->vsi->max_io_eqs; + + return 0; +} + /** * ice_activate_dynamic_port - Activate a dynamic port * @dyn_port: dynamic port instance to activate @@ -548,6 +575,14 @@ ice_activate_dynamic_port(struct ice_dynamic_port *dyn_port, if (dyn_port->active) return 0; + if (!dyn_port->vsi->max_io_eqs) { + err = ice_devlink_port_fn_max_io_eqs_set(&dyn_port->devlink_port, + ICE_SF_DEFAULT_EQS, + extack); + if (err) + return err; + } + err = ice_sf_eth_activate(dyn_port, extack); if (err) return err; @@ -807,6 +842,8 @@ static const struct devlink_port_ops ice_devlink_port_sf_ops = { .port_fn_hw_addr_set = ice_devlink_port_fn_hw_addr_set, .port_fn_state_get = ice_devlink_port_fn_state_get, .port_fn_state_set = ice_devlink_port_fn_state_set, + .port_fn_max_io_eqs_set = ice_devlink_port_fn_max_io_eqs_set, + .port_fn_max_io_eqs_get = ice_devlink_port_fn_max_io_eqs_get, }; /** diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h index 70d5294a558c..ca0739625d3b 100644 --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@ -109,6 +109,7 @@ #define ICE_Q_WAIT_MAX_RETRY (5 * ICE_Q_WAIT_RETRY_LIMIT) #define ICE_MAX_LG_RSS_QS 256 #define ICE_INVAL_Q_INDEX 0xffff +#define ICE_SF_DEFAULT_EQS 8 #define ICE_MAX_RXQS_PER_TC 256 /* Used when setting VSI context per TC Rx queues */ @@ -443,6 +444,7 @@ struct ice_vsi { u8 old_numtc; u16 old_ena_tc; + u32 max_io_eqs; /* setup back reference, to which aggregator node this VSI * corresponds to */