[Intel-wired-lan] [PATCH net-next 4/4] ice: use src VSI instead of src MAC in slow-path

Michal Swiatkowski michal.swiatkowski at linux.intel.com
Mon Apr 3 06:01:26 UTC 2023


On Sat, Apr 01, 2023 at 11:04:49AM +0200, Simon Horman wrote:
> On Fri, Mar 31, 2023 at 12:57:47PM +0200, Michal Swiatkowski wrote:
> > The use of a source  MAC to direct packets from the VF to the
> > corresponding port representor is only ok if there is only one
> > MAC on a VF. To support this functionality when the number
> > of MACs on a VF is greater, it is necessary to match a source
> > VSI instead of a source MAC.
> > 
> > Let's use the new switch API that allows matching on metadata.
> > 
> > If MAC isn't used in match criteria there is no need to handle adding
> > rule after virtchnl command. Instead add new rule while port representor
> > is being configured.
> > 
> > Remove rule_added field, checking for sp_rule can be used instead.
> > Remove also checking for switchdev running in deleting rule as it can be
> > call from unroll context when running flag isn't set. Checking for
> > sp_rule cover both context (with and without running flag).
> > 
> > Rules are added in eswitch configuration flow, so there is no need to
> > have replay function.
> > 
> > Signed-off-by: Michal Swiatkowski <michal.swiatkowski at linux.intel.com>
> > Reviewed-by: Piotr Raczynski <piotr.raczynski at intel.com>
> 
> Reviewed-by: Simon Horman <simon.horman at corigine.com>
> 
> ...
> 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_protocol_type.h b/drivers/net/ethernet/intel/ice/ice_protocol_type.h
> > index 20f66be9ba5f..1b739e096d27 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_protocol_type.h
> > +++ b/drivers/net/ethernet/intel/ice/ice_protocol_type.h
> > @@ -256,7 +256,9 @@ struct ice_nvgre_hdr {
> >   * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >   *
> >   * Source VSI = Source VSI of packet loopbacked in switch (for egress) (10b).
> > - *
> > + */
> > +#define ICE_MDID_SOURCE_VSI_MASK 0x3ff
> 
> nit: GENMASK might be appropriate here.
> 

Thanks for the review, I will fix it.

> > +/*
> >   * MDID 20
> >   * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >   * |A|B|C|D|E|F|R|R|G|H|I|J|K|L|M|N|
> 
> ...


More information about the Intel-wired-lan mailing list