* [dpdk-dev] [PATCH] net/ice: fix flow type selection for FDIR
@ 2019-11-19 1:07 Qi Zhang
2019-11-19 2:07 ` Xing, Beilei
2019-11-19 5:03 ` Ye Xiaolong
0 siblings, 2 replies; 3+ messages in thread
From: Qi Zhang @ 2019-11-19 1:07 UTC (permalink / raw)
To: yahui.cao, beilei.xing; +Cc: dev, Qi Zhang
The FDIR parser will select ICE_FLTR_PTYPE_NONF_IPV4_OTHER as flow type
for an IPv4 UDP flow with empty l4 matching field which is not correct.
Same issues happens on all the combination between IPv4/IPv6 and
UDP/TCP/SCTP cases
The patch fix all the wrong flow ptype selections.
Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/ice/ice_fdir_filter.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index e5a35dfe8..6db48e994 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1699,6 +1699,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
tcp_spec = item->spec;
tcp_mask = item->mask;
+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_TCP;
+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_TCP;
+
if (tcp_spec && tcp_mask) {
/* Check TCP mask and update input set */
if (tcp_mask->hdr.sent_seq ||
@@ -1730,15 +1735,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
tcp_spec->hdr.src_port;
filter->input.ip.v4.src_port =
tcp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV4_TCP;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.dst_port =
tcp_spec->hdr.src_port;
filter->input.ip.v6.src_port =
tcp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV6_TCP;
}
}
break;
@@ -1746,6 +1747,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
udp_spec = item->spec;
udp_mask = item->mask;
+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_UDP;
+
if (udp_spec && udp_mask) {
/* Check UDP mask and update input set*/
if (udp_mask->hdr.dgram_len ||
@@ -1772,15 +1778,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
udp_spec->hdr.src_port;
filter->input.ip.v4.src_port =
udp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV4_UDP;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.src_port =
udp_spec->hdr.dst_port;
filter->input.ip.v6.dst_port =
udp_spec->hdr.src_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV6_UDP;
}
}
break;
@@ -1788,6 +1790,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
sctp_spec = item->spec;
sctp_mask = item->mask;
+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_SCTP;
+
if (sctp_spec && sctp_mask) {
/* Check SCTP mask and update input set */
if (sctp_mask->hdr.cksum) {
@@ -1813,15 +1820,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
sctp_spec->hdr.src_port;
filter->input.ip.v4.src_port =
sctp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.dst_port =
sctp_spec->hdr.src_port;
filter->input.ip.v6.src_port =
sctp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV6_SCTP;
}
}
break;
--
2.13.6
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix flow type selection for FDIR
2019-11-19 1:07 [dpdk-dev] [PATCH] net/ice: fix flow type selection for FDIR Qi Zhang
@ 2019-11-19 2:07 ` Xing, Beilei
2019-11-19 5:03 ` Ye Xiaolong
1 sibling, 0 replies; 3+ messages in thread
From: Xing, Beilei @ 2019-11-19 2:07 UTC (permalink / raw)
To: Zhang, Qi Z, Cao, Yahui; +Cc: dev
> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Tuesday, November 19, 2019 9:07 AM
> To: Cao, Yahui <yahui.cao@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH] net/ice: fix flow type selection for FDIR
>
> The FDIR parser will select ICE_FLTR_PTYPE_NONF_IPV4_OTHER as flow type
> for an IPv4 UDP flow with empty l4 matching field which is not correct.
> Same issues happens on all the combination between IPv4/IPv6 and
> UDP/TCP/SCTP cases
>
> The patch fix all the wrong flow ptype selections.
>
> Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> drivers/net/ice/ice_fdir_filter.c | 27 +++++++++++++++------------
> 1 file changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
> index e5a35dfe8..6db48e994 100644
> --- a/drivers/net/ice/ice_fdir_filter.c
> +++ b/drivers/net/ice/ice_fdir_filter.c
> @@ -1699,6 +1699,11 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
> tcp_spec = item->spec;
> tcp_mask = item->mask;
>
> + if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
> + flow_type = ICE_FLTR_PTYPE_NONF_IPV4_TCP;
> + else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
> + flow_type = ICE_FLTR_PTYPE_NONF_IPV6_TCP;
> +
> if (tcp_spec && tcp_mask) {
> /* Check TCP mask and update input set */
> if (tcp_mask->hdr.sent_seq ||
> @@ -1730,15 +1735,11 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
> tcp_spec->hdr.src_port;
> filter->input.ip.v4.src_port =
> tcp_spec->hdr.dst_port;
> - flow_type =
> -
> ICE_FLTR_PTYPE_NONF_IPV4_TCP;
> } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
> filter->input.ip.v6.dst_port =
> tcp_spec->hdr.src_port;
> filter->input.ip.v6.src_port =
> tcp_spec->hdr.dst_port;
> - flow_type =
> -
> ICE_FLTR_PTYPE_NONF_IPV6_TCP;
> }
> }
> break;
> @@ -1746,6 +1747,11 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
> udp_spec = item->spec;
> udp_mask = item->mask;
>
> + if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
> + flow_type =
> ICE_FLTR_PTYPE_NONF_IPV4_UDP;
> + else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
> + flow_type =
> ICE_FLTR_PTYPE_NONF_IPV6_UDP;
> +
> if (udp_spec && udp_mask) {
> /* Check UDP mask and update input set*/
> if (udp_mask->hdr.dgram_len ||
> @@ -1772,15 +1778,11 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
> udp_spec->hdr.src_port;
> filter->input.ip.v4.src_port =
> udp_spec->hdr.dst_port;
> - flow_type =
> -
> ICE_FLTR_PTYPE_NONF_IPV4_UDP;
> } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
> filter->input.ip.v6.src_port =
> udp_spec->hdr.dst_port;
> filter->input.ip.v6.dst_port =
> udp_spec->hdr.src_port;
> - flow_type =
> -
> ICE_FLTR_PTYPE_NONF_IPV6_UDP;
> }
> }
> break;
> @@ -1788,6 +1790,11 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
> sctp_spec = item->spec;
> sctp_mask = item->mask;
>
> + if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
> + flow_type =
> ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
> + else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
> + flow_type =
> ICE_FLTR_PTYPE_NONF_IPV6_SCTP;
> +
> if (sctp_spec && sctp_mask) {
> /* Check SCTP mask and update input set */
> if (sctp_mask->hdr.cksum) {
> @@ -1813,15 +1820,11 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
> sctp_spec->hdr.src_port;
> filter->input.ip.v4.src_port =
> sctp_spec->hdr.dst_port;
> - flow_type =
> -
> ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
> } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
> filter->input.ip.v6.dst_port =
> sctp_spec->hdr.src_port;
> filter->input.ip.v6.src_port =
> sctp_spec->hdr.dst_port;
> - flow_type =
> -
> ICE_FLTR_PTYPE_NONF_IPV6_SCTP;
> }
> }
> break;
> --
> 2.13.6
Acked-by: Beilei Xing <beilei.xing@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix flow type selection for FDIR
2019-11-19 1:07 [dpdk-dev] [PATCH] net/ice: fix flow type selection for FDIR Qi Zhang
2019-11-19 2:07 ` Xing, Beilei
@ 2019-11-19 5:03 ` Ye Xiaolong
1 sibling, 0 replies; 3+ messages in thread
From: Ye Xiaolong @ 2019-11-19 5:03 UTC (permalink / raw)
To: Qi Zhang; +Cc: yahui.cao, beilei.xing, dev
On 11/19, Qi Zhang wrote:
>The FDIR parser will select ICE_FLTR_PTYPE_NONF_IPV4_OTHER as flow type
>for an IPv4 UDP flow with empty l4 matching field which is not correct.
>Same issues happens on all the combination between IPv4/IPv6 and
>UDP/TCP/SCTP cases
>
>The patch fix all the wrong flow ptype selections.
>
>Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
>
>Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>---
> drivers/net/ice/ice_fdir_filter.c | 27 +++++++++++++++------------
> 1 file changed, 15 insertions(+), 12 deletions(-)
>
>diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
>index e5a35dfe8..6db48e994 100644
>--- a/drivers/net/ice/ice_fdir_filter.c
>+++ b/drivers/net/ice/ice_fdir_filter.c
>@@ -1699,6 +1699,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
> tcp_spec = item->spec;
> tcp_mask = item->mask;
>
>+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
>+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_TCP;
>+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
>+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_TCP;
>+
> if (tcp_spec && tcp_mask) {
> /* Check TCP mask and update input set */
> if (tcp_mask->hdr.sent_seq ||
>@@ -1730,15 +1735,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
> tcp_spec->hdr.src_port;
> filter->input.ip.v4.src_port =
> tcp_spec->hdr.dst_port;
>- flow_type =
>- ICE_FLTR_PTYPE_NONF_IPV4_TCP;
> } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
> filter->input.ip.v6.dst_port =
> tcp_spec->hdr.src_port;
> filter->input.ip.v6.src_port =
> tcp_spec->hdr.dst_port;
>- flow_type =
>- ICE_FLTR_PTYPE_NONF_IPV6_TCP;
> }
> }
> break;
>@@ -1746,6 +1747,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
> udp_spec = item->spec;
> udp_mask = item->mask;
>
>+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
>+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
>+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
>+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_UDP;
>+
> if (udp_spec && udp_mask) {
> /* Check UDP mask and update input set*/
> if (udp_mask->hdr.dgram_len ||
>@@ -1772,15 +1778,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
> udp_spec->hdr.src_port;
> filter->input.ip.v4.src_port =
> udp_spec->hdr.dst_port;
>- flow_type =
>- ICE_FLTR_PTYPE_NONF_IPV4_UDP;
> } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
> filter->input.ip.v6.src_port =
> udp_spec->hdr.dst_port;
> filter->input.ip.v6.dst_port =
> udp_spec->hdr.src_port;
>- flow_type =
>- ICE_FLTR_PTYPE_NONF_IPV6_UDP;
> }
> }
> break;
>@@ -1788,6 +1790,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
> sctp_spec = item->spec;
> sctp_mask = item->mask;
>
>+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
>+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
>+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
>+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_SCTP;
>+
> if (sctp_spec && sctp_mask) {
> /* Check SCTP mask and update input set */
> if (sctp_mask->hdr.cksum) {
>@@ -1813,15 +1820,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
> sctp_spec->hdr.src_port;
> filter->input.ip.v4.src_port =
> sctp_spec->hdr.dst_port;
>- flow_type =
>- ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
> } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
> filter->input.ip.v6.dst_port =
> sctp_spec->hdr.src_port;
> filter->input.ip.v6.src_port =
> sctp_spec->hdr.dst_port;
>- flow_type =
>- ICE_FLTR_PTYPE_NONF_IPV6_SCTP;
> }
> }
> break;
>--
>2.13.6
>
Applied to dpdk-next-net-intel, Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-19 5:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 1:07 [dpdk-dev] [PATCH] net/ice: fix flow type selection for FDIR Qi Zhang
2019-11-19 2:07 ` Xing, Beilei
2019-11-19 5:03 ` 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).