DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] net/iavf: fix pattern check for flow director parser
@ 2022-08-10  6:47 Steve Yang
  2022-08-12  4:13 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Yang @ 2022-08-10  6:47 UTC (permalink / raw)
  To: dev; +Cc: jingjing.wu, beilei.xing, Steve Yang, stable

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: d5eb3e600d9e ("net/iavf: support flow director basic rule")
Cc: stable@dpdk.org

Signed-off-by: Steve Yang <stevex.yang@intel.com>
---
 drivers/net/iavf/iavf_fdir.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index 2e6b3a9097..a397047fdb 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -932,6 +932,14 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_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.type_of_service ==
 			    UINT8_MAX) {
 				input_set |= IAVF_INSET_IPV4_TOS;
@@ -1122,6 +1130,14 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_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 |= IAVF_INSET_UDP_SRC_PORT;
 					VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, UDP, SRC_PORT);
@@ -1171,6 +1187,14 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_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 |= IAVF_INSET_TCP_SRC_PORT;
 					VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, TCP, SRC_PORT);
@@ -1214,6 +1238,14 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_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 |= IAVF_INSET_SCTP_SRC_PORT;
 					VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, SCTP, SRC_PORT);
-- 
2.25.1


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

* RE: [PATCH v1] net/iavf: fix pattern check for flow director parser
  2022-08-10  6:47 [PATCH v1] net/iavf: fix pattern check for flow director parser Steve Yang
@ 2022-08-12  4:13 ` Zhang, Qi Z
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2022-08-12  4:13 UTC (permalink / raw)
  To: Yang, SteveX, dev; +Cc: Wu, Jingjing, Xing, Beilei, Yang, SteveX, stable



> -----Original Message-----
> From: Steve Yang <stevex.yang@intel.com>
> Sent: Wednesday, August 10, 2022 2:48 PM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Yang, SteveX <stevex.yang@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v1] net/iavf: fix pattern check for flow director 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: d5eb3e600d9e ("net/iavf: support flow director basic rule")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Steve Yang <stevex.yang@intel.com>

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

Applied to dpdk-next-net-intel.

Thanks
Qi


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

end of thread, other threads:[~2022-08-12  4:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10  6:47 [PATCH v1] net/iavf: fix pattern check for flow director parser Steve Yang
2022-08-12  4:13 ` 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).