DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhao1, Wei" <wei.zhao1@intel.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix sctp port support limitation
Date: Wed, 19 Jul 2017 03:47:59 +0000	[thread overview]
Message-ID: <A2573D2ACFCADC41BB3BE09C6DE313CA07C2EE51@PGSMSX103.gar.corp.intel.com> (raw)
In-Reply-To: <20170719083917.63441-1-qi.z.zhang@intel.com>

Hi, zhangqi
   82599 also support SCTP packet type, you can reference to  this patch:
 http://dpdk.org/dev/patchwork/patch/27012/ 

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qi Zhang
> Sent: Wednesday, July 19, 2017 4:39 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/ixgbe: fix sctp port support limitation
> 
> Only x550 family support sctp port in fdir filter, so add this limiation when
> parse consistent API.
> 
> Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_flow.c | 107 ++++++++++++++++++++++++---------
> --------
>  1 file changed, 64 insertions(+), 43 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
> index f70bdb0..4b5697a 100644
> --- a/drivers/net/ixgbe/ixgbe_flow.c
> +++ b/drivers/net/ixgbe/ixgbe_flow.c
> @@ -1375,7 +1375,8 @@ static inline uint8_t signature_match(const struct
> rte_flow_item pattern[])
>   * Item->last should be NULL.
>   */
>  static int
> -ixgbe_parse_fdir_filter_normal(const struct rte_flow_attr *attr,
> +ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
> +			       const struct rte_flow_attr *attr,
>  			       const struct rte_flow_item pattern[],
>  			       const struct rte_flow_action actions[],
>  			       struct ixgbe_fdir_rule *rule, @@ -1398,9 +1399,10
> @@ ixgbe_parse_fdir_filter_normal(const struct rte_flow_attr *attr,
>  	const struct rte_flow_item_vlan *vlan_mask;
>  	const struct rte_flow_item_raw *raw_mask;
>  	const struct rte_flow_item_raw *raw_spec;
> -
>  	uint8_t j;
> 
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +
>  	if (!pattern) {
>  		rte_flow_error_set(error, EINVAL,
>  			RTE_FLOW_ERROR_TYPE_ITEM_NUM,
> @@ -1897,49 +1899,68 @@ ixgbe_parse_fdir_filter_normal(const struct
> rte_flow_attr *attr,
>  				item, "Not supported last point for range");
>  			return -rte_errno;
>  		}
> -		/**
> -		 * Only care about src & dst ports,
> -		 * others should be masked.
> -		 */
> -		if (!item->mask) {
> -			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
> -			rte_flow_error_set(error, EINVAL,
> -				RTE_FLOW_ERROR_TYPE_ITEM,
> -				item, "Not supported by fdir filter");
> -			return -rte_errno;
> -		}
> -		rule->b_mask = TRUE;
> -		sctp_mask =
> -			(const struct rte_flow_item_sctp *)item->mask;
> -		if (sctp_mask->hdr.tag ||
> -		    sctp_mask->hdr.cksum) {
> -			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
> -			rte_flow_error_set(error, EINVAL,
> -				RTE_FLOW_ERROR_TYPE_ITEM,
> -				item, "Not supported by fdir filter");
> -			return -rte_errno;
> -		}
> -		rule->mask.src_port_mask = sctp_mask->hdr.src_port;
> -		rule->mask.dst_port_mask = sctp_mask->hdr.dst_port;
> 
> -		if (item->spec) {
> -			rule->b_spec = TRUE;
> -			sctp_spec =
> +		/* only x550 family support sctp port */
> +		if (hw->mac.type == ixgbe_mac_X550 ||
> +		    hw->mac.type == ixgbe_mac_X550EM_x ||
> +		    hw->mac.type == ixgbe_mac_X550EM_a) {
> +			/**
> +			 * Only care about src & dst ports,
> +			 * others should be masked.
> +			 */
> +			if (!item->mask) {
> +				memset(rule, 0, sizeof(struct
> ixgbe_fdir_rule));
> +				rte_flow_error_set(error, EINVAL,
> +					RTE_FLOW_ERROR_TYPE_ITEM,
> +					item, "Not supported by fdir filter");
> +				return -rte_errno;
> +			}
> +			rule->b_mask = TRUE;
> +			sctp_mask =
> +				(const struct rte_flow_item_sctp *)item-
> >mask;
> +			if (sctp_mask->hdr.tag ||
> +			sctp_mask->hdr.cksum) {
> +				memset(rule, 0, sizeof(struct
> ixgbe_fdir_rule));
> +				rte_flow_error_set(error, EINVAL,
> +					RTE_FLOW_ERROR_TYPE_ITEM,
> +					item, "Not supported by fdir filter");
> +				return -rte_errno;
> +			}
> +			rule->mask.src_port_mask = sctp_mask-
> >hdr.src_port;
> +			rule->mask.dst_port_mask = sctp_mask-
> >hdr.dst_port;
> +
> +			if (item->spec) {
> +				rule->b_spec = TRUE;
> +				sctp_spec =
>  				(const struct rte_flow_item_sctp *)item-
> >spec;
> -			rule->ixgbe_fdir.formatted.src_port =
> -				sctp_spec->hdr.src_port;
> -			rule->ixgbe_fdir.formatted.dst_port =
> -				sctp_spec->hdr.dst_port;
> -		}
> +				rule->ixgbe_fdir.formatted.src_port =
> +					sctp_spec->hdr.src_port;
> +				rule->ixgbe_fdir.formatted.dst_port =
> +					sctp_spec->hdr.dst_port;
> +			}
> 
> -		item = next_no_fuzzy_pattern(pattern, item);
> -		if (item->type != RTE_FLOW_ITEM_TYPE_RAW &&
> -		    item->type != RTE_FLOW_ITEM_TYPE_END) {
> -			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
> -			rte_flow_error_set(error, EINVAL,
> -				RTE_FLOW_ERROR_TYPE_ITEM,
> -				item, "Not supported by fdir filter");
> -			return -rte_errno;
> +			item = next_no_fuzzy_pattern(pattern, item);
> +			if (item->type != RTE_FLOW_ITEM_TYPE_RAW &&
> +				item->type != RTE_FLOW_ITEM_TYPE_END) {
> +				memset(rule, 0, sizeof(struct
> ixgbe_fdir_rule));
> +				rte_flow_error_set(error, EINVAL,
> +					RTE_FLOW_ERROR_TYPE_ITEM,
> +					item, "Not supported by fdir filter");
> +				return -rte_errno;
> +			}
> +		} else {
> +			/* sctp port is not supported */
> +			sctp_mask =
> +				(const struct rte_flow_item_sctp *)item-
> >mask;
> +			if (sctp_mask &&
> +				(sctp_mask->hdr.src_port ||
> +				 sctp_mask->hdr.dst_port)) {
> +				memset(rule, 0, sizeof(struct
> ixgbe_fdir_rule));
> +				rte_flow_error_set(error, EINVAL,
> +					RTE_FLOW_ERROR_TYPE_ITEM,
> +					item, "Not supported by fdir filter");
> +				return -rte_errno;
> +			}
>  		}
>  	}
> 
> @@ -2528,7 +2549,7 @@ ixgbe_parse_fdir_filter(struct rte_eth_dev *dev,
>  		hw->mac.type != ixgbe_mac_X550EM_a)
>  		return -ENOTSUP;
> 
> -	ret = ixgbe_parse_fdir_filter_normal(attr, pattern,
> +	ret = ixgbe_parse_fdir_filter_normal(dev, attr, pattern,
>  					actions, rule, error);
> 
>  	if (!ret)
> --
> 2.9.4

  reply	other threads:[~2017-07-19  3:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19  8:39 Qi Zhang
2017-07-19  3:47 ` Zhao1, Wei [this message]
2017-07-19  4:12   ` Zhang, Qi Z
2017-07-20  8:19 ` [dpdk-dev] [PATCH v2] net/ixgbe: " Qi Zhang
2017-07-20 11:12   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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=A2573D2ACFCADC41BB3BE09C6DE313CA07C2EE51@PGSMSX103.gar.corp.intel.com \
    --to=wei.zhao1@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@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).