DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/ixgbe: fix ntuple filter support for sctp
@ 2017-04-27  5:37 Wei Zhao
  0 siblings, 0 replies; 5+ messages in thread
From: Wei Zhao @ 2017-04-27  5:37 UTC (permalink / raw)
  To: dev; +Cc: Wei Zhao

Add the support of RTE_FLOW_ITEM_TYPE_SCTP type packet for
ixgbe ntuple filter.

Fixes: 672be56d76a ("net/ixgbe: parse n-tuple filter")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index e2ba9c2..98e414a 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -142,6 +142,8 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 	const struct rte_flow_item_tcp *tcp_mask;
 	const struct rte_flow_item_udp *udp_spec;
 	const struct rte_flow_item_udp *udp_mask;
+	const struct rte_flow_item_sctp *sctp_spec;
+	const struct rte_flow_item_sctp *sctp_mask;
 	uint32_t index;
 
 	if (!pattern) {
@@ -253,7 +255,8 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 	index++;
 	NEXT_ITEM_OF_PATTERN(item, pattern, index);
 	if (item->type != RTE_FLOW_ITEM_TYPE_TCP &&
-	    item->type != RTE_FLOW_ITEM_TYPE_UDP) {
+	    item->type != RTE_FLOW_ITEM_TYPE_UDP &&
+	    item->type != RTE_FLOW_ITEM_TYPE_SCTP) {
 		memset(filter, 0, sizeof(struct rte_eth_ntuple_filter));
 		rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ITEM,
@@ -319,7 +322,7 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 		filter->dst_port  = tcp_spec->hdr.dst_port;
 		filter->src_port  = tcp_spec->hdr.src_port;
 		filter->tcp_flags = tcp_spec->hdr.tcp_flags;
-	} else {
+	} else if (item->type == RTE_FLOW_ITEM_TYPE_UDP) {
 		udp_mask = (const struct rte_flow_item_udp *)item->mask;
 
 		/**
@@ -342,6 +345,29 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 		udp_spec = (const struct rte_flow_item_udp *)item->spec;
 		filter->dst_port = udp_spec->hdr.dst_port;
 		filter->src_port = udp_spec->hdr.src_port;
+	} else {
+		sctp_mask = (const struct rte_flow_item_sctp *)item->mask;
+
+		/**
+		 * Only support src & dst ports,
+		 * others should be masked.
+		 */
+		if (sctp_mask->hdr.tag ||
+		    sctp_mask->hdr.cksum) {
+			memset(filter, 0,
+				sizeof(struct rte_eth_ntuple_filter));
+			rte_flow_error_set(error, EINVAL,
+				RTE_FLOW_ERROR_TYPE_ITEM,
+				item, "Not supported by ntuple filter");
+			return -rte_errno;
+		}
+
+		filter->dst_port_mask = sctp_mask->hdr.dst_port;
+		filter->src_port_mask = sctp_mask->hdr.src_port;
+
+		sctp_spec = (const struct rte_flow_item_sctp *)item->spec;
+		filter->dst_port = sctp_spec->hdr.dst_port;
+		filter->src_port = sctp_spec->hdr.src_port;
 	}
 
 	/* check if the next not void item is END */
-- 
2.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix ntuple filter support for sctp
  2017-04-27  9:43 ` Ferruh Yigit
@ 2017-04-28  2:18   ` Zhao1, Wei
  0 siblings, 0 replies; 5+ messages in thread
From: Zhao1, Wei @ 2017-04-28  2:18 UTC (permalink / raw)
  To: Yigit, Ferruh, dev

Hi,Ferruh

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Thursday, April 27, 2017 5:44 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix ntuple filter support for
> sctp
> 
> On 4/27/2017 6:39 AM, Wei Zhao wrote:
> > Add the support of RTE_FLOW_ITEM_TYPE_SCTP type packet for ixgbe
> > ntuple filter.
> >
> > v2:
> > --add type check of RTE_FLOW_ITEM_TYPE_SCTP for item flow.
> 
> For version information in the commit log, can you put it as:
> Below signed-off tag, in new line put three dashes "---", later put the version
> information. This way git automatically strips that part when applied,
> otherwise maintainer manually needs to do the update.
> 

Ok, fix in v3

> And can you please send new version of the patches using git send-email "--
> in-reply-to" option, otherwise it is hard to trace the patch versions and
> previous comments on it.
> 

Sorry, I have forget that info.

> Thanks.
> 
> >
> > Fixes: 672be56d76a ("net/ixgbe: parse n-tuple filter")
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_flow.c | 30 ++++++++++++++++++++++++++++--
> >  1 file changed, 28 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_flow.c
> > b/drivers/net/ixgbe/ixgbe_flow.c index e2ba9c2..98e414a 100644
> > --- a/drivers/net/ixgbe/ixgbe_flow.c
> > +++ b/drivers/net/ixgbe/ixgbe_flow.c
> > @@ -142,6 +142,8 @@ cons_parse_ntuple_filter(const struct rte_flow_attr
> *attr,
> >  	const struct rte_flow_item_tcp *tcp_mask;
> >  	const struct rte_flow_item_udp *udp_spec;
> >  	const struct rte_flow_item_udp *udp_mask;
> > +	const struct rte_flow_item_sctp *sctp_spec;
> > +	const struct rte_flow_item_sctp *sctp_mask;
> >  	uint32_t index;
> >
> >  	if (!pattern) {
> > @@ -253,7 +255,8 @@ cons_parse_ntuple_filter(const struct rte_flow_attr
> *attr,
> >  	index++;
> >  	NEXT_ITEM_OF_PATTERN(item, pattern, index);
> >  	if (item->type != RTE_FLOW_ITEM_TYPE_TCP &&
> > -	    item->type != RTE_FLOW_ITEM_TYPE_UDP) {
> > +	    item->type != RTE_FLOW_ITEM_TYPE_UDP &&
> > +	    item->type != RTE_FLOW_ITEM_TYPE_SCTP) {
> 
> There is a function comment, that documents the expected/valid pattern
> types, that should be updated with this new type.

Ok, I will fix that in v3.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix ntuple filter support for sctp
  2017-04-27  5:39 Wei Zhao
  2017-04-27  7:12 ` Lu, Wenzhuo
@ 2017-04-27  9:43 ` Ferruh Yigit
  2017-04-28  2:18   ` Zhao1, Wei
  1 sibling, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2017-04-27  9:43 UTC (permalink / raw)
  To: Wei Zhao, dev

On 4/27/2017 6:39 AM, Wei Zhao wrote:
> Add the support of RTE_FLOW_ITEM_TYPE_SCTP type packet for
> ixgbe ntuple filter.
> 
> v2:
> --add type check of RTE_FLOW_ITEM_TYPE_SCTP for item flow.

For version information in the commit log, can you put it as:
Below signed-off tag, in new line put three dashes "---",
later put the version information. This way git automatically strips
that part when applied, otherwise maintainer manually needs to do the
update.

And can you please send new version of the patches using git send-email
"--in-reply-to" option, otherwise it is hard to trace the patch versions
and previous comments on it.

Thanks.

> 
> Fixes: 672be56d76a ("net/ixgbe: parse n-tuple filter")
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_flow.c | 30 ++++++++++++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
> index e2ba9c2..98e414a 100644
> --- a/drivers/net/ixgbe/ixgbe_flow.c
> +++ b/drivers/net/ixgbe/ixgbe_flow.c
> @@ -142,6 +142,8 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
>  	const struct rte_flow_item_tcp *tcp_mask;
>  	const struct rte_flow_item_udp *udp_spec;
>  	const struct rte_flow_item_udp *udp_mask;
> +	const struct rte_flow_item_sctp *sctp_spec;
> +	const struct rte_flow_item_sctp *sctp_mask;
>  	uint32_t index;
>  
>  	if (!pattern) {
> @@ -253,7 +255,8 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
>  	index++;
>  	NEXT_ITEM_OF_PATTERN(item, pattern, index);
>  	if (item->type != RTE_FLOW_ITEM_TYPE_TCP &&
> -	    item->type != RTE_FLOW_ITEM_TYPE_UDP) {
> +	    item->type != RTE_FLOW_ITEM_TYPE_UDP &&
> +	    item->type != RTE_FLOW_ITEM_TYPE_SCTP) {

There is a function comment, that documents the expected/valid pattern
types, that should be updated with this new type.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix ntuple filter support for sctp
  2017-04-27  5:39 Wei Zhao
@ 2017-04-27  7:12 ` Lu, Wenzhuo
  2017-04-27  9:43 ` Ferruh Yigit
  1 sibling, 0 replies; 5+ messages in thread
From: Lu, Wenzhuo @ 2017-04-27  7:12 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: Zhao1, Wei

Hi,


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao
> Sent: Thursday, April 27, 2017 1:40 PM
> To: dev@dpdk.org
> Cc: Zhao1, Wei
> Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix ntuple filter support for sctp
> 
> Add the support of RTE_FLOW_ITEM_TYPE_SCTP type packet for ixgbe ntuple
> filter.
> 
> v2:
> --add type check of RTE_FLOW_ITEM_TYPE_SCTP for item flow.
> 
> Fixes: 672be56d76a ("net/ixgbe: parse n-tuple filter")
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2] net/ixgbe: fix ntuple filter support for sctp
@ 2017-04-27  5:39 Wei Zhao
  2017-04-27  7:12 ` Lu, Wenzhuo
  2017-04-27  9:43 ` Ferruh Yigit
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Zhao @ 2017-04-27  5:39 UTC (permalink / raw)
  To: dev; +Cc: Wei Zhao

Add the support of RTE_FLOW_ITEM_TYPE_SCTP type packet for
ixgbe ntuple filter.

v2:
--add type check of RTE_FLOW_ITEM_TYPE_SCTP for item flow.

Fixes: 672be56d76a ("net/ixgbe: parse n-tuple filter")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index e2ba9c2..98e414a 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -142,6 +142,8 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 	const struct rte_flow_item_tcp *tcp_mask;
 	const struct rte_flow_item_udp *udp_spec;
 	const struct rte_flow_item_udp *udp_mask;
+	const struct rte_flow_item_sctp *sctp_spec;
+	const struct rte_flow_item_sctp *sctp_mask;
 	uint32_t index;
 
 	if (!pattern) {
@@ -253,7 +255,8 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 	index++;
 	NEXT_ITEM_OF_PATTERN(item, pattern, index);
 	if (item->type != RTE_FLOW_ITEM_TYPE_TCP &&
-	    item->type != RTE_FLOW_ITEM_TYPE_UDP) {
+	    item->type != RTE_FLOW_ITEM_TYPE_UDP &&
+	    item->type != RTE_FLOW_ITEM_TYPE_SCTP) {
 		memset(filter, 0, sizeof(struct rte_eth_ntuple_filter));
 		rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ITEM,
@@ -319,7 +322,7 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 		filter->dst_port  = tcp_spec->hdr.dst_port;
 		filter->src_port  = tcp_spec->hdr.src_port;
 		filter->tcp_flags = tcp_spec->hdr.tcp_flags;
-	} else {
+	} else if (item->type == RTE_FLOW_ITEM_TYPE_UDP) {
 		udp_mask = (const struct rte_flow_item_udp *)item->mask;
 
 		/**
@@ -342,6 +345,29 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 		udp_spec = (const struct rte_flow_item_udp *)item->spec;
 		filter->dst_port = udp_spec->hdr.dst_port;
 		filter->src_port = udp_spec->hdr.src_port;
+	} else {
+		sctp_mask = (const struct rte_flow_item_sctp *)item->mask;
+
+		/**
+		 * Only support src & dst ports,
+		 * others should be masked.
+		 */
+		if (sctp_mask->hdr.tag ||
+		    sctp_mask->hdr.cksum) {
+			memset(filter, 0,
+				sizeof(struct rte_eth_ntuple_filter));
+			rte_flow_error_set(error, EINVAL,
+				RTE_FLOW_ERROR_TYPE_ITEM,
+				item, "Not supported by ntuple filter");
+			return -rte_errno;
+		}
+
+		filter->dst_port_mask = sctp_mask->hdr.dst_port;
+		filter->src_port_mask = sctp_mask->hdr.src_port;
+
+		sctp_spec = (const struct rte_flow_item_sctp *)item->spec;
+		filter->dst_port = sctp_spec->hdr.dst_port;
+		filter->src_port = sctp_spec->hdr.src_port;
 	}
 
 	/* check if the next not void item is END */
-- 
2.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-28  2:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27  5:37 [dpdk-dev] [PATCH v2] net/ixgbe: fix ntuple filter support for sctp Wei Zhao
2017-04-27  5:39 Wei Zhao
2017-04-27  7:12 ` Lu, Wenzhuo
2017-04-27  9:43 ` Ferruh Yigit
2017-04-28  2:18   ` Zhao1, Wei

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).