DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue
@ 2020-01-21 13:41 Yahui Cao
  2020-02-02  8:22 ` Ye Xiaolong
  0 siblings, 1 reply; 4+ messages in thread
From: Yahui Cao @ 2020-01-21 13:41 UTC (permalink / raw)
  To: Qiming Yang, Wenzhuo Lu; +Cc: dev, stable, Qi Zhang, Yahui Cao, Xiaolong Ye

If only gtpu teid is specified, FDIR will always match the gtpu teid no
matter there is gtp extension header appended or not.
So forbid pattern in which gtp_psc without qfi value follows gtpu with
teid value like:
pattern eth / ipv4 / udp / gtpu teid is XXX / gtp_psc / end

Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel")
Cc: stable@dpdk.org

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c  | 12 ++++++++++++
 drivers/net/ice/ice_generic_flow.h |  6 ++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index f356581d1..7517299fc 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1894,6 +1894,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 
 				filter->input.gtpu_data.qfi =
 					gtp_psc_spec->qfi;
+			} else {
+				/* forbid pattern like:
+				 * "gtpu teid is XXX / gtp_psc / end"
+				 */
+				if (ice_flow_inset_get_field(input_set,
+					ICE_INSET_GTPU_TEID)) {
+					rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid GTP mask");
+					return -rte_errno;
+				}
 			}
 			break;
 		default:
diff --git a/drivers/net/ice/ice_generic_flow.h b/drivers/net/ice/ice_generic_flow.h
index adc30ee2a..8387b5fee 100644
--- a/drivers/net/ice/ice_generic_flow.h
+++ b/drivers/net/ice/ice_generic_flow.h
@@ -485,4 +485,10 @@ 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);
+
+static inline int
+ice_flow_inset_get_field(uint64_t input_set, uint64_t field)
+{
+	return (input_set & field) == field;
+}
 #endif
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue
  2020-01-21 13:41 [dpdk-dev] [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue Yahui Cao
@ 2020-02-02  8:22 ` Ye Xiaolong
  2020-02-03  2:46   ` Zhang, Qi Z
  0 siblings, 1 reply; 4+ messages in thread
From: Ye Xiaolong @ 2020-02-02  8:22 UTC (permalink / raw)
  To: Yahui Cao; +Cc: Qiming Yang, Wenzhuo Lu, dev, stable, Qi Zhang

On 01/21, Yahui Cao wrote:
>If only gtpu teid is specified, FDIR will always match the gtpu teid no
>matter there is gtp extension header appended or not.
>So forbid pattern in which gtp_psc without qfi value follows gtpu with
>teid value like:
>pattern eth / ipv4 / udp / gtpu teid is XXX / gtp_psc / end
>
>Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel")
>Cc: stable@dpdk.org
>
>Signed-off-by: Yahui Cao <yahui.cao@intel.com>
>---
> drivers/net/ice/ice_fdir_filter.c  | 12 ++++++++++++
> drivers/net/ice/ice_generic_flow.h |  6 ++++++
> 2 files changed, 18 insertions(+)
>
>diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
>index f356581d1..7517299fc 100644
>--- a/drivers/net/ice/ice_fdir_filter.c
>+++ b/drivers/net/ice/ice_fdir_filter.c
>@@ -1894,6 +1894,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
> 
> 				filter->input.gtpu_data.qfi =
> 					gtp_psc_spec->qfi;
>+			} else {
>+				/* forbid pattern like:
>+				 * "gtpu teid is XXX / gtp_psc / end"
>+				 */
>+				if (ice_flow_inset_get_field(input_set,
>+					ICE_INSET_GTPU_TEID)) {
>+					rte_flow_error_set(error, EINVAL,
>+						   RTE_FLOW_ERROR_TYPE_ITEM,
>+						   item,
>+						   "Invalid GTP mask");

Is this a correct message for the error?

Btw, this patch can't be applied cleanly on top of latest dpdk-next-net-intel,
please help rebase and send a new version.

Thanks,
Xiaolong

>+					return -rte_errno;
>+				}
> 			}
> 			break;
> 		default:
>diff --git a/drivers/net/ice/ice_generic_flow.h b/drivers/net/ice/ice_generic_flow.h
>index adc30ee2a..8387b5fee 100644
>--- a/drivers/net/ice/ice_generic_flow.h
>+++ b/drivers/net/ice/ice_generic_flow.h
>@@ -485,4 +485,10 @@ 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);
>+
>+static inline int
>+ice_flow_inset_get_field(uint64_t input_set, uint64_t field)
>+{
>+	return (input_set & field) == field;
>+}
> #endif
>-- 
>2.17.1
>

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

* Re: [dpdk-dev] [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue
  2020-02-02  8:22 ` Ye Xiaolong
@ 2020-02-03  2:46   ` Zhang, Qi Z
  2020-02-03  3:54     ` Ye Xiaolong
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang, Qi Z @ 2020-02-03  2:46 UTC (permalink / raw)
  To: Ye, Xiaolong, Cao, Yahui; +Cc: Yang, Qiming, Lu, Wenzhuo, dev, stable

Hi Xiaolong:
	Please ignore this one, since it is covered by below patch already 
	https://patches.dpdk.org/patch/65025/ 
Thanks
Qi

> -----Original Message-----
> From: Ye, Xiaolong <xiaolong.ye@intel.com>
> Sent: Sunday, February 2, 2020 4:23 PM
> To: Cao, Yahui <yahui.cao@intel.com>
> Cc: Yang, Qiming <qiming.yang@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; dev@dpdk.org; stable@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: Re: [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue
> 
> On 01/21, Yahui Cao wrote:
> >If only gtpu teid is specified, FDIR will always match the gtpu teid no
> >matter there is gtp extension header appended or not.
> >So forbid pattern in which gtp_psc without qfi value follows gtpu with
> >teid value like:
> >pattern eth / ipv4 / udp / gtpu teid is XXX / gtp_psc / end
> >
> >Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel")
> >Cc: stable@dpdk.org
> >
> >Signed-off-by: Yahui Cao <yahui.cao@intel.com>
> >---
> > drivers/net/ice/ice_fdir_filter.c  | 12 ++++++++++++
> >drivers/net/ice/ice_generic_flow.h |  6 ++++++
> > 2 files changed, 18 insertions(+)
> >
> >diff --git a/drivers/net/ice/ice_fdir_filter.c
> >b/drivers/net/ice/ice_fdir_filter.c
> >index f356581d1..7517299fc 100644
> >--- a/drivers/net/ice/ice_fdir_filter.c
> >+++ b/drivers/net/ice/ice_fdir_filter.c
> >@@ -1894,6 +1894,18 @@ ice_fdir_parse_pattern(__rte_unused struct
> >ice_adapter *ad,
> >
> > 				filter->input.gtpu_data.qfi =
> > 					gtp_psc_spec->qfi;
> >+			} else {
> >+				/* forbid pattern like:
> >+				 * "gtpu teid is XXX / gtp_psc / end"
> >+				 */
> >+				if (ice_flow_inset_get_field(input_set,
> >+					ICE_INSET_GTPU_TEID)) {
> >+					rte_flow_error_set(error, EINVAL,
> >+						   RTE_FLOW_ERROR_TYPE_ITEM,
> >+						   item,
> >+						   "Invalid GTP mask");
> 
> Is this a correct message for the error?
> 
> Btw, this patch can't be applied cleanly on top of latest dpdk-next-net-intel,
> please help rebase and send a new version.
> 
> Thanks,
> Xiaolong
> 
> >+					return -rte_errno;
> >+				}
> > 			}
> > 			break;
> > 		default:
> >diff --git a/drivers/net/ice/ice_generic_flow.h
> >b/drivers/net/ice/ice_generic_flow.h
> >index adc30ee2a..8387b5fee 100644
> >--- a/drivers/net/ice/ice_generic_flow.h
> >+++ b/drivers/net/ice/ice_generic_flow.h
> >@@ -485,4 +485,10 @@ 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);
> >+
> >+static inline int
> >+ice_flow_inset_get_field(uint64_t input_set, uint64_t field) {
> >+	return (input_set & field) == field;
> >+}
> > #endif
> >--
> >2.17.1
> >

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

* Re: [dpdk-dev] [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue
  2020-02-03  2:46   ` Zhang, Qi Z
@ 2020-02-03  3:54     ` Ye Xiaolong
  0 siblings, 0 replies; 4+ messages in thread
From: Ye Xiaolong @ 2020-02-03  3:54 UTC (permalink / raw)
  To: Zhang, Qi Z; +Cc: Cao, Yahui, Yang, Qiming, Lu, Wenzhuo, dev, stable

Got it, thanks for the info.

Thanks,
Xiaolong

On 02/03, Zhang, Qi Z wrote:
>Hi Xiaolong:
>	Please ignore this one, since it is covered by below patch already 
>	https://patches.dpdk.org/patch/65025/ 
>Thanks
>Qi
>
>> -----Original Message-----
>> From: Ye, Xiaolong <xiaolong.ye@intel.com>
>> Sent: Sunday, February 2, 2020 4:23 PM
>> To: Cao, Yahui <yahui.cao@intel.com>
>> Cc: Yang, Qiming <qiming.yang@intel.com>; Lu, Wenzhuo
>> <wenzhuo.lu@intel.com>; dev@dpdk.org; stable@dpdk.org; Zhang, Qi Z
>> <qi.z.zhang@intel.com>
>> Subject: Re: [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue
>> 
>> On 01/21, Yahui Cao wrote:
>> >If only gtpu teid is specified, FDIR will always match the gtpu teid no
>> >matter there is gtp extension header appended or not.
>> >So forbid pattern in which gtp_psc without qfi value follows gtpu with
>> >teid value like:
>> >pattern eth / ipv4 / udp / gtpu teid is XXX / gtp_psc / end
>> >
>> >Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel")
>> >Cc: stable@dpdk.org
>> >
>> >Signed-off-by: Yahui Cao <yahui.cao@intel.com>
>> >---
>> > drivers/net/ice/ice_fdir_filter.c  | 12 ++++++++++++
>> >drivers/net/ice/ice_generic_flow.h |  6 ++++++
>> > 2 files changed, 18 insertions(+)
>> >
>> >diff --git a/drivers/net/ice/ice_fdir_filter.c
>> >b/drivers/net/ice/ice_fdir_filter.c
>> >index f356581d1..7517299fc 100644
>> >--- a/drivers/net/ice/ice_fdir_filter.c
>> >+++ b/drivers/net/ice/ice_fdir_filter.c
>> >@@ -1894,6 +1894,18 @@ ice_fdir_parse_pattern(__rte_unused struct
>> >ice_adapter *ad,
>> >
>> > 				filter->input.gtpu_data.qfi =
>> > 					gtp_psc_spec->qfi;
>> >+			} else {
>> >+				/* forbid pattern like:
>> >+				 * "gtpu teid is XXX / gtp_psc / end"
>> >+				 */
>> >+				if (ice_flow_inset_get_field(input_set,
>> >+					ICE_INSET_GTPU_TEID)) {
>> >+					rte_flow_error_set(error, EINVAL,
>> >+						   RTE_FLOW_ERROR_TYPE_ITEM,
>> >+						   item,
>> >+						   "Invalid GTP mask");
>> 
>> Is this a correct message for the error?
>> 
>> Btw, this patch can't be applied cleanly on top of latest dpdk-next-net-intel,
>> please help rebase and send a new version.
>> 
>> Thanks,
>> Xiaolong
>> 
>> >+					return -rte_errno;
>> >+				}
>> > 			}
>> > 			break;
>> > 		default:
>> >diff --git a/drivers/net/ice/ice_generic_flow.h
>> >b/drivers/net/ice/ice_generic_flow.h
>> >index adc30ee2a..8387b5fee 100644
>> >--- a/drivers/net/ice/ice_generic_flow.h
>> >+++ b/drivers/net/ice/ice_generic_flow.h
>> >@@ -485,4 +485,10 @@ 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);
>> >+
>> >+static inline int
>> >+ice_flow_inset_get_field(uint64_t input_set, uint64_t field) {
>> >+	return (input_set & field) == field;
>> >+}
>> > #endif
>> >--
>> >2.17.1
>> >

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

end of thread, other threads:[~2020-02-03  3:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 13:41 [dpdk-dev] [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue Yahui Cao
2020-02-02  8:22 ` Ye Xiaolong
2020-02-03  2:46   ` Zhang, Qi Z
2020-02-03  3:54     ` Ye Xiaolong

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