patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/ice: fix pattern check for FDIR parser
@ 2021-12-22  8:02 Junfeng Guo
  2021-12-22  8:08 ` [PATCH v2] " Junfeng Guo
  0 siblings, 1 reply; 4+ messages in thread
From: Junfeng Guo @ 2021-12-22  8:02 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, beilei.xing
  Cc: dev, stable, ferruh.yigit, junfeng.guo

FDIR rules with masks are not supported in current code. Thus add
pattern check for IPv4/UDP/TCP/SCTP addr/port to terminate the FDIR
programming stage.

Fixes: 1b71ed2cdd5d ("net/ice: refactor flow pattern parser")
Cc: stable@dpdk.org

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 32 +++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 13a2ac42df..24278c1217 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -2037,6 +2037,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for IPv4 src/dst addrs not supported */
+			if (!ipv4_mask->hdr.src_addr &&
+				ipv4_mask->hdr.src_addr == UINT32_MAX)
+				return -rte_errno;
+			if (!ipv4_mask->hdr.dst_addr &&
+				ipv4_mask->hdr.dst_addr == UINT32_MAX)
+				return -rte_errno;
+
 			if (ipv4_mask->hdr.dst_addr == UINT32_MAX)
 				*input_set |= ICE_INSET_IPV4_DST;
 			if (ipv4_mask->hdr.src_addr == UINT32_MAX)
@@ -2178,6 +2186,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for TCP src/dst ports not supported */
+			if (!tcp_mask->hdr.src_port &&
+				tcp_mask->hdr.src_port == UINT16_MAX)
+				return -rte_errno;
+			if (!tcp_mask->hdr.dst_port &&
+				tcp_mask->hdr.dst_port == UINT16_MAX)
+				return -rte_errno;
+
 			if (tcp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_TCP_SRC_PORT;
 			if (tcp_mask->hdr.dst_port == UINT16_MAX)
@@ -2217,6 +2233,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for UDP src/dst ports not supported */
+			if (!udp_mask->hdr.src_port &&
+				udp_mask->hdr.src_port == UINT16_MAX)
+				return -rte_errno;
+			if (!udp_mask->hdr.dst_port &&
+				udp_mask->hdr.dst_port == UINT16_MAX)
+				return -rte_errno;
+
 			if (udp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_UDP_SRC_PORT;
 			if (udp_mask->hdr.dst_port == UINT16_MAX)
@@ -2254,6 +2278,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for SCTP src/dst ports not supported */
+			if (!sctp_mask->hdr.src_port &&
+				sctp_mask->hdr.src_port == UINT16_MAX)
+				return -rte_errno;
+			if (!sctp_mask->hdr.dst_port &&
+				sctp_mask->hdr.dst_port == UINT16_MAX)
+				return -rte_errno;
+
 			if (sctp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_SCTP_SRC_PORT;
 			if (sctp_mask->hdr.dst_port == UINT16_MAX)
-- 
2.25.1


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

* [PATCH v2] net/ice: fix pattern check for FDIR parser
  2021-12-22  8:02 [PATCH] net/ice: fix pattern check for FDIR parser Junfeng Guo
@ 2021-12-22  8:08 ` Junfeng Guo
  2021-12-22  8:11   ` [PATCH v3] " Junfeng Guo
  0 siblings, 1 reply; 4+ messages in thread
From: Junfeng Guo @ 2021-12-22  8:08 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, beilei.xing
  Cc: dev, stable, ferruh.yigit, junfeng.guo

FDIR rules with masks are not supported in current code. Thus add
pattern check for IPv4/UDP/TCP/SCTP addr/port to terminate the FDIR
programming stage.

Fixes: 1b71ed2cdd5d ("net/ice: refactor flow pattern parser")
Cc: stable@dpdk.org

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 32 +++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 13a2ac42df..989b5586b1 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -2037,6 +2037,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for IPv4 src/dst addrs not supported */
+			if (!ipv4_mask->hdr.src_addr &&
+				ipv4_mask->hdr.src_addr != UINT32_MAX)
+				return -rte_errno;
+			if (!ipv4_mask->hdr.dst_addr &&
+				ipv4_mask->hdr.dst_addr != UINT32_MAX)
+				return -rte_errno;
+
 			if (ipv4_mask->hdr.dst_addr == UINT32_MAX)
 				*input_set |= ICE_INSET_IPV4_DST;
 			if (ipv4_mask->hdr.src_addr == UINT32_MAX)
@@ -2178,6 +2186,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for TCP src/dst ports not supported */
+			if (!tcp_mask->hdr.src_port &&
+				tcp_mask->hdr.src_port != UINT16_MAX)
+				return -rte_errno;
+			if (!tcp_mask->hdr.dst_port &&
+				tcp_mask->hdr.dst_port != UINT16_MAX)
+				return -rte_errno;
+
 			if (tcp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_TCP_SRC_PORT;
 			if (tcp_mask->hdr.dst_port == UINT16_MAX)
@@ -2217,6 +2233,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for UDP src/dst ports not supported */
+			if (!udp_mask->hdr.src_port &&
+				udp_mask->hdr.src_port != UINT16_MAX)
+				return -rte_errno;
+			if (!udp_mask->hdr.dst_port &&
+				udp_mask->hdr.dst_port != UINT16_MAX)
+				return -rte_errno;
+
 			if (udp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_UDP_SRC_PORT;
 			if (udp_mask->hdr.dst_port == UINT16_MAX)
@@ -2254,6 +2278,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for SCTP src/dst ports not supported */
+			if (!sctp_mask->hdr.src_port &&
+				sctp_mask->hdr.src_port == UINT16_MAX)
+				return -rte_errno;
+			if (!sctp_mask->hdr.dst_port &&
+				sctp_mask->hdr.dst_port == UINT16_MAX)
+				return -rte_errno;
+
 			if (sctp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_SCTP_SRC_PORT;
 			if (sctp_mask->hdr.dst_port == UINT16_MAX)
-- 
2.25.1


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

* [PATCH v3] net/ice: fix pattern check for FDIR parser
  2021-12-22  8:08 ` [PATCH v2] " Junfeng Guo
@ 2021-12-22  8:11   ` Junfeng Guo
  2021-12-22 10:44     ` Zhang, Qi Z
  0 siblings, 1 reply; 4+ messages in thread
From: Junfeng Guo @ 2021-12-22  8:11 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, beilei.xing
  Cc: dev, stable, ferruh.yigit, junfeng.guo

FDIR rules with masks are not supported in current code. Thus add
pattern check for IPv4/UDP/TCP/SCTP addr/port to terminate the FDIR
programming stage.

Fixes: 1b71ed2cdd5d ("net/ice: refactor flow pattern parser")
Cc: stable@dpdk.org

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 32 +++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 13a2ac42df..287032a6a7 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -2037,6 +2037,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for IPv4 src/dst addrs not supported */
+			if (!ipv4_mask->hdr.src_addr &&
+				ipv4_mask->hdr.src_addr != UINT32_MAX)
+				return -rte_errno;
+			if (!ipv4_mask->hdr.dst_addr &&
+				ipv4_mask->hdr.dst_addr != UINT32_MAX)
+				return -rte_errno;
+
 			if (ipv4_mask->hdr.dst_addr == UINT32_MAX)
 				*input_set |= ICE_INSET_IPV4_DST;
 			if (ipv4_mask->hdr.src_addr == UINT32_MAX)
@@ -2178,6 +2186,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for TCP src/dst ports not supported */
+			if (!tcp_mask->hdr.src_port &&
+				tcp_mask->hdr.src_port != UINT16_MAX)
+				return -rte_errno;
+			if (!tcp_mask->hdr.dst_port &&
+				tcp_mask->hdr.dst_port != UINT16_MAX)
+				return -rte_errno;
+
 			if (tcp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_TCP_SRC_PORT;
 			if (tcp_mask->hdr.dst_port == UINT16_MAX)
@@ -2217,6 +2233,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for UDP src/dst ports not supported */
+			if (!udp_mask->hdr.src_port &&
+				udp_mask->hdr.src_port != UINT16_MAX)
+				return -rte_errno;
+			if (!udp_mask->hdr.dst_port &&
+				udp_mask->hdr.dst_port != UINT16_MAX)
+				return -rte_errno;
+
 			if (udp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_UDP_SRC_PORT;
 			if (udp_mask->hdr.dst_port == UINT16_MAX)
@@ -2254,6 +2278,14 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				return -rte_errno;
 			}
 
+			/* Mask for SCTP src/dst ports not supported */
+			if (!sctp_mask->hdr.src_port &&
+				sctp_mask->hdr.src_port != UINT16_MAX)
+				return -rte_errno;
+			if (!sctp_mask->hdr.dst_port &&
+				sctp_mask->hdr.dst_port != UINT16_MAX)
+				return -rte_errno;
+
 			if (sctp_mask->hdr.src_port == UINT16_MAX)
 				*input_set |= ICE_INSET_SCTP_SRC_PORT;
 			if (sctp_mask->hdr.dst_port == UINT16_MAX)
-- 
2.25.1


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

* RE: [PATCH v3] net/ice: fix pattern check for FDIR parser
  2021-12-22  8:11   ` [PATCH v3] " Junfeng Guo
@ 2021-12-22 10:44     ` Zhang, Qi Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2021-12-22 10:44 UTC (permalink / raw)
  To: Guo, Junfeng, Wu, Jingjing, Xing, Beilei; +Cc: dev, stable, Yigit, Ferruh



> -----Original Message-----
> From: Guo, Junfeng <junfeng.guo@intel.com>
> Sent: Wednesday, December 22, 2021 4:12 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>;
> Guo, Junfeng <junfeng.guo@intel.com>
> Subject: [PATCH v3] net/ice: fix pattern check for FDIR parser
> 
> FDIR rules with masks are not supported in current code. Thus add pattern
> check for IPv4/UDP/TCP/SCTP addr/port to terminate the FDIR programming
> stage.
> 
> Fixes: 1b71ed2cdd5d ("net/ice: refactor flow pattern parser")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi


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

end of thread, other threads:[~2021-12-22 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22  8:02 [PATCH] net/ice: fix pattern check for FDIR parser Junfeng Guo
2021-12-22  8:08 ` [PATCH v2] " Junfeng Guo
2021-12-22  8:11   ` [PATCH v3] " Junfeng Guo
2021-12-22 10:44     ` Zhang, Qi Z

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