DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Guo, Jia" <jia.guo@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>
Cc: "Ye, Xiaolong" <xiaolong.ye@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] net/iavf: fix protocol field selector configure
Date: Sat, 23 May 2020 02:03:04 +0000
Message-ID: <039ED4275CED7440929022BC67E70611548250BC@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20200522231731.40803-1-jia.guo@intel.com>



> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Saturday, May 23, 2020 7:18 AM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>
> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
> <jia.guo@intel.com>
> Subject: [dpdk-dev] net/iavf: fix protocol field selector configure
> 
> When VFs configure the rss rule by virtchnl, it need to set bit mask into the
> field selector for the protocol, then PF got the configure massage and parse
> the field selector to the corresponding protocol field.
> 
> Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")
> 
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
>  drivers/net/iavf/iavf_hash.c | 474 +++++++++++++++++++++--------------
>  1 file changed, 280 insertions(+), 194 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> af528863b..1e0ffad4c 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -43,6 +43,7 @@ struct iavf_hash_match_type {
>  	enum iavf_pattern_hint_type phint_type;
>  	uint64_t hash_type;
>  	struct virtchnl_proto_hdrs *proto_hdrs;
> +	uint32_t link_type;

If this is just a hint for gtpu link type.
Better to rename to "gtpu_hint"
And use the already defined enum but not uint32_t.
 
>  };
> 
>  struct iavf_rss_meta {
> @@ -147,8 +148,11 @@ static struct iavf_pattern_match_item
> iavf_hash_pattern_list[] = {
>  	{iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty},  };
> 
> -#define	GTP_EH_PDU_LINK_UP		1
> -#define	GTP_EH_PDU_LINK_DWN		0
> +enum iavf_pattern_link_type {

Rename to iavf_gtpu_hint.

> +	IAVF_PATTERN_LINK_DOWN,
> +	IAVF_PATTERN_LINK_UP,
> +	IAVF_PATTERN_LINK_NONE,
> +};

The configure is for GTP down/up link, 
The name "xxx_LINK_DOWN", and "xxx_LINK_UP" is a little bit misleading.
Could be 
IAVF_GTPU_HINT_UPLINK.
IAVF_GTPU_HINT_DOWNLINK.
IAVF_GTPU_HINT_N/A

> 
>  #define TUNNEL_LEVEL_OUTER		0
>  #define TUNNEL_LEVEL_FIRST_INNER	1
> @@ -160,103 +164,112 @@ static struct iavf_pattern_match_item
> iavf_hash_pattern_list[] = {
>  #define BUFF_NOUSED			0
>  #define FIELD_FOR_PROTO_ONLY		0
> 
> +#define FIELD_SELECTOR(proto_hdr_field)	(1UL << ((proto_hdr_field) % \
> +					 (1UL << PROTO_HDR_SHIFT)))

Could be simplified to.
#define FIELD_SELECTOR(proto_hdr_field) \
	(1UL << (proto_hdr_field & PROTO_HDR_FIELD_MASK))

......

Regards
Qi

  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 23:17 Jeff Guo
2020-05-23  2:03 ` Zhang, Qi Z [this message]
2020-05-24  5:46   ` Jeff Guo
2020-05-24  5:52 ` [dpdk-dev] [dpdk-dev v2] " Jeff Guo
2020-05-24  7:31   ` Zhang, Qi Z
2020-05-25  4:08     ` Ye Xiaolong
2020-05-25  6:50   ` He, Zhiwei
  -- strict thread matches above, loose matches on Subject: below --
2020-05-22 11:10 [dpdk-dev] " Jeff Guo

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=039ED4275CED7440929022BC67E70611548250BC@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=xiaolong.ye@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

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git