> -----Original Message-----
> From: Guo, Junfeng <junfeng....@intel.com>
> Sent: Wednesday, October 27, 2021 9:58 AM
> To: Zhang, Qi Z <qi.z.zh...@intel.com>; Wu, Jingjing <jingjing...@intel.com>;
> Xing, Beilei <beilei.x...@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yi...@intel.com>; Wang, Haiyue
> <haiyue.w...@intel.com>; Yan, Zhirun <zhirun....@intel.com>
> Subject: RE: [PATCH v4 2/4] net/ice/base: add function to set HW profile for
> raw flow
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z <qi.z.zh...@intel.com>
> > Sent: Wednesday, October 27, 2021 08:58
> > To: Guo, Junfeng <junfeng....@intel.com>; Wu, Jingjing
> > <jingjing...@intel.com>; Xing, Beilei <beilei.x...@intel.com>
> > Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yi...@intel.com>; Wang, Haiyue
> > <haiyue.w...@intel.com>; Yan, Zhirun <zhirun....@intel.com>
> > Subject: RE: [PATCH v4 2/4] net/ice/base: add function to set HW
> > profile for raw flow
> >
> >
> >
> > > -----Original Message-----
> > > From: Guo, Junfeng <junfeng....@intel.com>
> > > Sent: Tuesday, October 26, 2021 8:01 PM
> > > To: Zhang, Qi Z <qi.z.zh...@intel.com>; Wu, Jingjing
> > <jingjing...@intel.com>;
> > > Xing, Beilei <beilei.x...@intel.com>
> > > Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yi...@intel.com>; Wang,
> > Haiyue
> > > <haiyue.w...@intel.com>; Yan, Zhirun <zhirun....@intel.com>; Guo,
> > Junfeng
> > > <junfeng....@intel.com>
> > > Subject: [PATCH v4 2/4] net/ice/base: add function to set HW profile
> > > for
> > raw
> > > flow
> > >
> > > Based on the parser library, we can directly set HW profile and
> > > associate
> > the
> > > main/ctrl vsi.
> > >
> > > Signed-off-by: Junfeng Guo <junfeng....@intel.com>
> > > ---
> > >  drivers/net/ice/base/ice_flex_pipe.c | 55 ++++++++++++++++++
> > > drivers/net/ice/base/ice_flex_pipe.h |  4 ++
> > >  drivers/net/ice/base/ice_flow.c      | 85
> > ++++++++++++++++++++++++++++
> > >  drivers/net/ice/base/ice_flow.h      |  4 ++
> > >  4 files changed, 148 insertions(+)
> > >
> > > diff --git a/drivers/net/ice/base/ice_flex_pipe.c
> > > b/drivers/net/ice/base/ice_flex_pipe.c
> > > index 06a233990f..030655f3f0 100644
> > > --- a/drivers/net/ice/base/ice_flex_pipe.c
> > > +++ b/drivers/net/ice/base/ice_flex_pipe.c
> > > @@ -6365,3 +6365,58 @@ ice_rem_prof_id_flow(struct ice_hw *hw,
> > enum
> > > ice_block blk, u16 vsi, u64 hdl)
> > >
> > >  return status;
> > >  }
> > > +
> > > +/**
> > > + * ice_flow_assoc_hw_prof - add profile id flow for main/ctrl VSI
> > > +flow entry
> > > + * @hw: pointer to the HW struct
> > > + * @blk: HW block
> > > + * @dest_vsi_handle: dest VSI handle
> > > + * @fdir_vsi_handle: fdir programming VSI handle
> > > + * @id: profile id (handle)
> > > + * @fv_found: found fv in fdir fv list
> > > + *
> > > + * Calling this function will update the hardware tables to enable
> > > +the
> > > + * profile indicated by the ID parameter for the VSIs specified in
> > > +the VSI
> > > + * array. Once successfully called, the flow will be enabled.
> > > + */
> > > +enum ice_status
> > > +ice_flow_assoc_hw_prof(struct ice_hw *hw, enum ice_block blk,
> > > +       u16 dest_vsi_handle, u16 fdir_vsi_handle, int id,
> > > +       bool fv_found)
> >
> > Do we really need this fv_found parameter?
> 
> The value of fv_found is set based on the maintained profile info list in the 
> PMD.
> So we need this parameter to add profile id flow for FDIR in the shared code.

I mean if we parse fv_found = true into ice_flow_assoc_hw_prof, nothing will 
happen,
So why not just remove the parameter and we can do below 

        If (!fv_found)
                ice_flow_assoc_hw_prof(...)

its always better to reduce unnecessary context for simple purpose in a 
function.
        

> 
> >
> > If fv_found is true, seems nothing has been done in this function, why
> > not just check the flag outside the function?
> 
> Yes, ice_add_prof_id_flow should be processed after ice_add_prof.
> It's ok if we just move the ice_add_prof_id_flow processing into func
> ice_flow_set_hw_prof, and delete the func ice_flow_assoc_hw_prof to reduce
> the code size.
> 
> For RSS, the ice_add_prof_id_flow for adding dest_vsi_handle should always be
> processed.
> So this function has other RSS logic to add soon.
> 
> >
> >
> >
> 

Reply via email to