net/ice: fix FDIR gtp_psc without qfi pattern issue
PATCH 1/1 net/ice: fix FDIR gtp_psc without qfi pattern issue
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
--- drivers/net/ice/ice_fdir_filter.c | 12 ++++++++++++ drivers/net/ice/ice_generic_flow.h | 6 ++++++ 2 files changed, 18 insertions(+)
drivers/net/ice/ice_fdir_filter.c +12 -0
@@ -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 :
drivers/net/ice/ice_generic_flow.h +6 -0
@@ -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
Signature · 1 line
2.17.1
Quoted 23 lines · Yahui Cao
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 whichgtp_pscwithout qfi value follows gtpu with teid value like:
pattern eth / ipv4 / udp / gtpu teid is XXX /gtp_psc/ endFixes efc16c621415 ("net/ice: support flow director GTPU tunnel")Signed-off-by Yahui Cao <[email protected]>---
drivers/net/ice/ice_fdir_filter.c| 12 ++++++++++++drivers/net/ice/ice_generic_flow.h| 6 ++++++2 files changed, 18 insertions(+)drivers/net/ice/ice_fdir_filter.c +0
-0@@ -1894,6 +1894,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, filter->input.gtpu_data.qfi = gtp_psc_spec->qfi;
drivers/net/ice/ice_fdir_filter.c ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, · line 1906
Quoted 10 lines
drivers/net/ice/ice_fdir_filter.c +10
-0+ }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
Quoted 23 lines
drivers/net/ice/ice_fdir_filter.c +2
-0+return -rte_errno; + } }break ;default :drivers/net/ice/ice_generic_flow.h +6
-0@@ -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 Signature · 1 line
2.17.1
Hi Xiaolong:
Please ignore this one, since it is covered by below patch already https://patches.dpdk.org/patch/65025/
Thanks
Qi
Quoted 78 lines
-----Original Message-----
From: Ye, Xiaolong <[email protected]>
Sent: Sunday, February 2, 2020 4:23 PM
To: Cao, Yahui <[email protected]>
Cc: Yang, Qiming <[email protected]>; Lu, Wenzhuo <[email protected]>; [email protected]; [email protected]; Zhang, Qi Z <[email protected]>
Subject: Re: [PATCH] net/ice: fix FDIRgtp_pscwithout qfi pattern issueQuoted 25 lines · Yahui Cao
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 whichgtp_pscwithout qfi value follows gtpu with teid value like:
pattern eth / ipv4 / udp / gtpu teid is XXX /gtp_psc/ endFixes efc16c621415 ("net/ice: support flow director GTPU tunnel")Signed-off-by Yahui Cao <[email protected]>---
drivers/net/ice/ice_fdir_filter.c| 12 ++++++++++++drivers/net/ice/ice_generic_flow.h| 6 ++++++2 files changed, 18 insertions(+)drivers/net/ice/ice_fdir_filter.c +0
-0@@ -1894,6 +1894,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, filter->input.gtpu_data.qfi = gtp_psc_spec->qfi;drivers/net/ice/ice_fdir_filter.c ice_fdir_parse_pattern(__rte_unused struct · line 1907
Quoted 10 lines
drivers/net/ice/ice_fdir_filter.c +10
-0+ }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,
Xiaolongdrivers/net/ice/ice_generic_flow.h ice_search_pattern_match_item(const struct
Quoted 11 lines
drivers/net/ice/ice_fdir_filter.c +2
-0+return -rte_errno; + } }break ;default:
drivers/net/ice/ice_generic_flow.h +0
-0@@ -485,4 +485,10 @@ ice_search_pattern_match_item(const struct
rte_flow_itempattern[],Quoted 12 lines
drivers/net/ice/ice_generic_flow.h +5
-1struct 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
Got it, thanks for the info.
Thanks,
Xiaolong
Quoted 84 lines · Qi Z
Hi Xiaolong:
Please ignore this one, since it is covered by below patch already https://patches.dpdk.org/patch/65025/Thanks
QiQuoted 78 lines
-----Original Message-----
From: Ye, Xiaolong <[email protected]>
Sent: Sunday, February 2, 2020 4:23 PM
To: Cao, Yahui <[email protected]>
Cc: Yang, Qiming <[email protected]>; Lu, Wenzhuo <[email protected]>; [email protected]; [email protected]; Zhang, Qi Z <[email protected]>
Subject: Re: [PATCH] net/ice: fix FDIRgtp_pscwithout qfi pattern issueQuoted 25 lines · Yahui Cao
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 whichgtp_pscwithout qfi value follows gtpu with teid value like:
pattern eth / ipv4 / udp / gtpu teid is XXX /gtp_psc/ endFixes efc16c621415 ("net/ice: support flow director GTPU tunnel")Signed-off-by Yahui Cao <[email protected]>---
drivers/net/ice/ice_fdir_filter.c| 12 ++++++++++++drivers/net/ice/ice_generic_flow.h| 6 ++++++2 files changed, 18 insertions(+)drivers/net/ice/ice_fdir_filter.c +0
-0@@ -1894,6 +1894,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, filter->input.gtpu_data.qfi = gtp_psc_spec->qfi;drivers/net/ice/ice_fdir_filter.c ice_fdir_parse_pattern(__rte_unused struct · line 1907
Quoted 10 lines
drivers/net/ice/ice_fdir_filter.c +10
-0+ }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,
Xiaolongdrivers/net/ice/ice_generic_flow.h ice_search_pattern_match_item(const struct
Quoted 11 lines
drivers/net/ice/ice_fdir_filter.c +2
-0+return -rte_errno; + } }break ;default:
drivers/net/ice/ice_generic_flow.h +0
-0@@ -485,4 +485,10 @@ ice_search_pattern_match_item(const struct
rte_flow_itempattern[],Quoted 12 lines
drivers/net/ice/ice_generic_flow.h +5
-1struct 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