DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Yang, Qiming" <qiming.yang@intel.com>
To: "Xing, Beilei" <beilei.xing@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Wang, Haiyue" <haiyue.wang@intel.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/ice: support flow redirect function
Date: Mon, 30 Mar 2020 08:01:16 +0000	[thread overview]
Message-ID: <MN2PR11MB35820F6E1C890792B7A05AA0E5CB0@MN2PR11MB3582.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1585586271-9296-1-git-send-email-beilei.xing@intel.com>


> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Tuesday, March 31, 2020 00:38
> To: dev@dpdk.org; Wang, Haiyue <haiyue.wang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH] net/ice: support flow redirect function
> 
> Add a new ops "redirect" to flow engine, it's used to implement the function
> that redirect a flow's destination. Currently only support VSI-Redirect which
> will be used by DCF for handling VSI mapping table change.
> A new API "ice_flow_redirect" is exposed, current usage is: it could be called
> when VSI mapping table change happens.

We can mention the case, like VF reset. The usage will be more clear.

> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>  drivers/net/ice/ice_generic_flow.c | 22 ++++++++++++++++++++++
> drivers/net/ice/ice_generic_flow.h | 21 +++++++++++++++++++++
>  2 files changed, 43 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_generic_flow.c
> b/drivers/net/ice/ice_generic_flow.c
> index a1648ee..823ff0e 100644
> --- a/drivers/net/ice/ice_generic_flow.c
> +++ b/drivers/net/ice/ice_generic_flow.c
> @@ -1961,3 +1961,25 @@ ice_flow_query(struct rte_eth_dev *dev,
>  	}
>  	return ret;
>  }
> +
> +int
> +ice_flow_redirect(struct ice_adapter *ad,
> +		  struct ice_flow_redirect *rd)
> +{
> +	struct ice_pf *pf = &ad->pf;
> +	struct rte_flow *p_flow;
> +	void *temp;
> +	int ret;
> +
> +	TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) {
> +		if (!p_flow->engine->redirect)
> +			continue;
> +		ret = p_flow->engine->redirect(ad, p_flow, rd);
> +		if (ret) {
> +			PMD_DRV_LOG(ERR, "Failed to redirect flows");
> +			return ret;
> +		}
> +	}
> +
> +	return 0;
> +}
> diff --git a/drivers/net/ice/ice_generic_flow.h
> b/drivers/net/ice/ice_generic_flow.h
> index adc30ee..ede6ec8 100644
> --- a/drivers/net/ice/ice_generic_flow.h
> +++ b/drivers/net/ice/ice_generic_flow.h
> @@ -417,6 +417,20 @@ struct ice_pattern_match_item {
>  	void *meta;
>  };
> 
> +enum ice_flow_redirect_type {
> +	ICE_FLOW_REDIRECT_VSI,
> +};
> +
> +struct ice_flow_redirect {
> +	enum ice_flow_redirect_type type;
> +	union {
> +		struct {
> +			uint16_t vsi_handle;
> +			uint16_t new_vsi_num;
> +		};
> +	};
> +};
> +
>  typedef int (*engine_init_t)(struct ice_adapter *ad);  typedef void
> (*engine_uninit_t)(struct ice_adapter *ad);  typedef int
> (*engine_create_t)(struct ice_adapter *ad, @@ -430,6 +444,9 @@ typedef
> int (*engine_query_t)(struct ice_adapter *ad,
>  		struct rte_flow *flow,
>  		struct rte_flow_query_count *count,
>  		struct rte_flow_error *error);
> +typedef int(*engine_redirect_t)(struct ice_adapter *ad,
> +				struct rte_flow *flow,
> +				struct ice_flow_redirect *redirect);
>  typedef void (*engine_free_t) (struct rte_flow *flow);  typedef int
> (*parse_pattern_action_t)(struct ice_adapter *ad,
>  		struct ice_pattern_match_item *array, @@ -447,6 +464,7
> @@ struct ice_flow_engine {
>  	engine_create_t create;
>  	engine_destroy_t destroy;
>  	engine_query_t query_count;
> +	engine_redirect_t redirect;
>  	engine_free_t free;
>  	enum ice_flow_engine_type type;
>  };
> @@ -485,4 +503,7 @@ ice_search_pattern_match_item(const struct
> rte_flow_item pattern[],
>  		struct ice_pattern_match_item *array,
>  		uint32_t array_len,
>  		struct rte_flow_error *error);
> +int
> +ice_flow_redirect(struct ice_adapter *ad,
> +		  struct ice_flow_redirect *rd);
>  #endif
> --
> 2.7.4

Acked-by: Qiming Yang <qiming.yang@intel.com>


  reply	other threads:[~2020-03-30  8:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 16:37 Beilei Xing
2020-03-30  8:01 ` Yang, Qiming [this message]
2020-03-30 17:38 ` [dpdk-dev] [PATCH v2 0/2] add " Beilei Xing
2020-03-30 17:38   ` [dpdk-dev] [PATCH v2 1/2] net/ice: support " Beilei Xing
2020-03-31  2:45     ` Ye Xiaolong
2020-03-30 17:38   ` [dpdk-dev] [PATCH v2 2/2] net/ice: support flow ops thread safe Beilei Xing
2020-03-31  2:46   ` [dpdk-dev] [PATCH v2 0/2] add flow redirect function Ye Xiaolong

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=MN2PR11MB35820F6E1C890792B7A05AA0E5CB0@MN2PR11MB3582.namprd11.prod.outlook.com \
    --to=qiming.yang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=haiyue.wang@intel.com \
    --cc=qi.z.zhang@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).