DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: Jeff Guo <jia.guo@intel.com>
To: Chenxu Di <chenxux.di@intel.com>, dev@dpdk.org
Cc: Yang Qiming <qiming.yang@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3 4/5] net/i40e: enable flow query RSS
Date: Fri, 3 Jul 2020 13:57:07 +0800
Message-ID: <9f0867d2-722f-6751-138e-2be88a08f6c9@intel.com> (raw)
In-Reply-To: <20200701082451.34511-5-chenxux.di@intel.com>


On 7/1/2020 4:24 PM, Chenxu Di wrote:
> This patch enables flow query function to get the
> configuration of the specified rule.
>
> Signed-off-by: Chenxu Di <chenxux.di@intel.com>
> ---
>   doc/guides/rel_notes/release_20_08.rst |  1 +
>   drivers/net/i40e/i40e_flow.c           | 49 ++++++++++++++++++++++++++
>   2 files changed, 50 insertions(+)
>
> diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst
> index 1252a337a..a7fb3136d 100644
> --- a/doc/guides/rel_notes/release_20_08.rst
> +++ b/doc/guides/rel_notes/release_20_08.rst
> @@ -90,6 +90,7 @@ New Features
>   
>     * Re-implemented get_fdir_info and get_fdir_stat in private API.
>     * Re-implemented set_gre_key_len in private API.
> +  * Added support for flow query RSS.
>   
>   * **Updated the Intel ixgbe driver.**
>   
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
> index 8f8df6fae..4186a5df2 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -43,6 +43,10 @@ static int i40e_flow_destroy(struct rte_eth_dev *dev,
>   			     struct rte_flow_error *error);
>   static int i40e_flow_flush(struct rte_eth_dev *dev,
>   			   struct rte_flow_error *error);
> +static int i40e_flow_query(struct rte_eth_dev *dev,
> +			   struct rte_flow *flow,
> +			   const struct rte_flow_action *actions,
> +			   void *data, struct rte_flow_error *error);
>   static int
>   i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,
>   				  const struct rte_flow_item *pattern,
> @@ -129,6 +133,7 @@ const struct rte_flow_ops i40e_flow_ops = {
>   	.create = i40e_flow_create,
>   	.destroy = i40e_flow_destroy,
>   	.flush = i40e_flow_flush,
> +	.query = i40e_flow_query,
>   };
>   
>   static union i40e_filter_t cons_filter;
> @@ -5462,3 +5467,47 @@ i40e_flow_flush_rss_filter(struct rte_eth_dev *dev)
>   
>   	return ret;
>   }
> +
> +static int
> +i40e_flow_query(struct rte_eth_dev *dev __rte_unused,
> +		struct rte_flow *flow,
> +		const struct rte_flow_action *actions,
> +		void *data, struct rte_flow_error *error)
> +{
> +	struct i40e_rss_filter *rss_rule = (struct i40e_rss_filter *)flow->rule;
> +	enum rte_filter_type filter_type = flow->filter_type;
> +	struct rte_flow_action_rss *rss_conf = data;
> +
> +	if (!rss_rule) {
> +		rte_flow_error_set(error, EINVAL,
> +				   RTE_FLOW_ERROR_TYPE_HANDLE,
> +				   NULL, "Invalid rule");
> +		return -rte_errno;
> +	}
> +
> +	for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
> +		switch (actions->type) {
> +		case RTE_FLOW_ACTION_TYPE_VOID:
> +			break;
> +		case RTE_FLOW_ACTION_TYPE_RSS:
> +			if (filter_type != RTE_ETH_FILTER_HASH) {
> +				rte_flow_error_set(error, ENOTSUP,
> +						   RTE_FLOW_ERROR_TYPE_ACTION,
> +						   actions,
> +						   "action not supported");
> +				return -rte_errno;
> +			}
> +			rte_memcpy(rss_conf,
> +				   &rss_rule->rss_filter_info.conf,
> +				   sizeof(struct rte_flow_action_rss));
> +			break;
> +		default:
> +			return rte_flow_error_set(error, ENOTSUP,
> +						  RTE_FLOW_ERROR_TYPE_ACTION,
> +						  actions,
> +						  "action not supported");
> +		}
> +	}
> +
> +	return 0;
> +}


Acked-by: Jeff Guo <jia.guo@intel.com <mailto:jia.guo@intel.com>>


  reply index

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11  6:01 [dpdk-dev] [PATCH 0/5] re-implement legacy filter functions by private API Chenxu Di
2020-06-11  6:01 ` [dpdk-dev] [PATCH 1/5] net/i40e: add private APIs Chenxu Di
2020-06-11  6:01 ` [dpdk-dev] [PATCH 2/5] net/ixgbe: " Chenxu Di
2020-06-11  6:01 ` [dpdk-dev] [PATCH 3/5] app/testpmd: re-implement commands by using private API Chenxu Di
2020-06-16 20:12   ` Kevin Traynor
2020-06-17 10:12     ` Di, ChenxuX
2020-06-30  6:20       ` Jeff Guo
2020-06-11  6:01 ` [dpdk-dev] [PATCH 4/5] net/i40e: enable flow query RSS Chenxu Di
2020-06-11  6:01 ` [dpdk-dev] [PATCH 5/5] app/testpmd: support query RSS config in flow query Chenxu Di
2020-06-15  2:18 ` [dpdk-dev] [PATCH v2 0/5] re-implement legacy filter functions by private API Chenxu Di
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 1/5] net/i40e: add private APIs Chenxu Di
2020-06-30  4:22     ` Jeff Guo
2020-06-30 10:24     ` Yang, Qiming
2020-07-01  1:30       ` Di, ChenxuX
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 2/5] net/ixgbe: " Chenxu Di
2020-06-30  5:25     ` Jeff Guo
2020-06-30 10:25     ` Yang, Qiming
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 3/5] app/testpmd: re-implement commands by using private API Chenxu Di
2020-06-30 10:34     ` Yang, Qiming
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 4/5] net/i40e: enable flow query RSS Chenxu Di
2020-06-30  6:48     ` Jeff Guo
2020-06-30 10:27     ` Yang, Qiming
2020-07-01  1:15       ` Di, ChenxuX
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 5/5] app/testpmd: support query RSS config in flow query Chenxu Di
2020-06-30  6:37     ` Jeff Guo
2020-06-30 10:40     ` Yang, Qiming
2020-07-01  1:25       ` Di, ChenxuX
2020-07-01  8:24 ` [dpdk-dev] [PATCH v3 0/5] re-implement legacy filter functions by private API Chenxu Di
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 1/5] net/i40e: add private APIs Chenxu Di
2020-07-03  5:44     ` Jeff Guo
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 2/5] net/ixgbe: " Chenxu Di
2020-07-03  5:44     ` Jeff Guo
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 3/5] app/testpmd: re-implement commands by using private API Chenxu Di
2020-07-03  5:54     ` Jeff Guo
2020-07-06  9:10     ` Yang, Qiming
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 4/5] net/i40e: enable flow query RSS Chenxu Di
2020-07-03  5:57     ` Jeff Guo [this message]
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 5/5] app/testpmd: support query RSS config in flow query Chenxu Di
2020-07-08  1:18 ` [dpdk-dev] [PATCH v4 0/5] re-implement legacy filter functions by private API Chenxu Di
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 1/5] net/i40e: add private APIs Chenxu Di
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 2/5] net/ixgbe: " Chenxu Di
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 3/5] app/testpmd: re-implement commands by using private API Chenxu Di
2020-07-08  3:31     ` Yang, Qiming
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 4/5] net/i40e: enable flow query RSS Chenxu Di
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 5/5] app/testpmd: support query RSS config in flow query Chenxu Di
2020-07-08  3:32     ` Yang, Qiming
2020-07-08  9:05   ` [dpdk-dev] [PATCH v4 0/5] re-implement legacy filter functions by private API 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=9f0867d2-722f-6751-138e-2be88a08f6c9@intel.com \
    --to=jia.guo@intel.com \
    --cc=chenxux.di@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@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