DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Yuying" <yuying.zhang@intel.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Wang, Haiyue" <haiyue.wang@intel.com>
Cc: "Yan, Zhirun" <zhirun.yan@intel.com>,
	"Guo, Junfeng" <junfeng.guo@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3 2/2] net/ice: refactor input set fields for switch filter
Date: Mon, 26 Apr 2021 03:09:38 +0000	[thread overview]
Message-ID: <DM6PR11MB351607122F7AB0FE79CB89E58E429@DM6PR11MB3516.namprd11.prod.outlook.com> (raw)
In-Reply-To: <bb97f79725fa488fbd4087d055591225@intel.com>



> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Monday, April 26, 2021 9:48 AM
> To: Zhang, Yuying <yuying.zhang@intel.com>; dev@dpdk.org; Wang, Haiyue
> <haiyue.wang@intel.com>
> Cc: Yan, Zhirun <zhirun.yan@intel.com>; Guo, Junfeng <junfeng.guo@intel.com>
> Subject: RE: [PATCH v3 2/2] net/ice: refactor input set fields for switch filter
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Yuying <yuying.zhang@intel.com>
> > Sent: Sunday, April 25, 2021 9:29 PM
> > To: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Haiyue
> > <haiyue.wang@intel.com>
> > Cc: Yan, Zhirun <zhirun.yan@intel.com>; Guo, Junfeng
> > <junfeng.guo@intel.com>; Zhang, Yuying <yuying.zhang@intel.com>
> > Subject: [PATCH v3 2/2] net/ice: refactor input set fields for switch
> > filter
> >
> > Input set has been divided into inner and outer part to distinguish
> > different fields. However, the parse method of switch filter doesn't
> > match this update. Refactor switch filter to distingush inner and
> > outer input set in the same way as other filters.
> >
> > Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> > ---
> >  drivers/net/ice/ice_switch_filter.c | 746
> > ++++++++++++----------------
> >  1 file changed, 323 insertions(+), 423 deletions(-)
> >
> >
> 
> ......
> >
> > -static uint64_t
> > -ice_switch_inset_get(const struct rte_flow_item pattern[],
> > +static bool
> > +ice_switch_parse_pattern(const struct rte_flow_item pattern[],
> >  struct rte_flow_error *error,
> >  struct ice_adv_lkup_elem *list,
> >  uint16_t *lkups_num,
> > -enum ice_sw_tunnel_type *tun_type)
> > +enum ice_sw_tunnel_type *tun_type,
> > +const struct ice_pattern_match_item pattern_match_item)
> 
> Better to parse const pointer, but not struct value
> 
> const struct ice_pattern_match_item *pattern_match_item
> 
> >  {
> >  const struct rte_flow_item *item = pattern;  enum rte_flow_item_type
> > item_type; @@ -504,7 +456,9 @@ ice_switch_inset_get(const struct
> > rte_flow_item pattern[],  const struct rte_flow_item_pfcp *pfcp_spec,
> > *pfcp_mask;  const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
> > const struct rte_flow_item_gtp_psc *gtp_psc_spec, *gtp_psc_mask;
> > -uint64_t input_set = ICE_INSET_NONE;
> > +uint64_t outer_input_set = ICE_INSET_NONE; uint64_t inner_input_set =
> > +ICE_INSET_NONE; uint64_t *input = NULL;
> 
> Why we need pointer here?
> 
> Can we:
> 
> if (tunnel_valid) {
> ...
> input_set = inner_input_set;
> } else {
> ...
> input_set = outer_input_set;
> }
> 

We need to change the value of inner_input_set and outer_input_set
according to actual input set of the rule to be created. Pointer is used to
distinguish which one need to be changed.

> .......
> >
> > -inputset = ice_switch_inset_get
> > -(pattern, error, list, &lkups_num, &tun_type); -if ((!inputset &&
> > !ice_is_prof_rule(tun_type)) || -(inputset &
> > ~pattern_match_item->input_set_mask_o)) {
> > +if (ice_switch_parse_pattern(pattern, error, list, &lkups_num,
> > +   &tun_type, *pattern_match_item) == false) {
> 
> No need "==false", use ! for Boolean.
> 
> >  rte_flow_error_set(error, EINVAL,
> >     RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
> >     pattern,
> > --
> > 2.25.1
> 


  reply	other threads:[~2021-04-26  3:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 10:05 [dpdk-dev] [PATCH v1] " Yuying Zhang
2021-04-23  7:42 ` [dpdk-dev] [PATCH v2 1/2] " Yuying Zhang
2021-04-23  7:42   ` [dpdk-dev] [PATCH v2 2/2] net/ice: clean redundant macro definition of filters Yuying Zhang
2021-04-25 13:29 ` [dpdk-dev] [PATCH v3 1/2] " Yuying Zhang
2021-04-25 13:29   ` [dpdk-dev] [PATCH v3 2/2] net/ice: refactor input set fields for switch filter Yuying Zhang
2021-04-26  1:47     ` Zhang, Qi Z
2021-04-26  3:09       ` Zhang, Yuying [this message]
2021-04-26  5:38 ` [dpdk-dev] [PATCH v4 1/2] net/ice: clean redundant macro definition of filters Yuying Zhang
2021-04-26  5:38   ` [dpdk-dev] [PATCH v4 2/2] net/ice: refactor input set fields for switch filter Yuying Zhang
2021-04-26  8:05     ` Zhang, Qi Z
2021-04-26  8:04   ` [dpdk-dev] [PATCH v4 1/2] net/ice: clean redundant macro definition of filters Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR11MB351607122F7AB0FE79CB89E58E429@DM6PR11MB3516.namprd11.prod.outlook.com \
    --to=yuying.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=haiyue.wang@intel.com \
    --cc=junfeng.guo@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=zhirun.yan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).