patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com
Cc: dev@dpdk.org, stable@dpdk.org, junfeng.guo@intel.com
Subject: [PATCH v2] net/ice: fix pattern check logic in FDIR
Date: Tue,  8 Feb 2022 12:34:48 +0800	[thread overview]
Message-ID: <20220208043448.2654636-1-junfeng.guo@intel.com> (raw)
In-Reply-To: <20220208042922.2644996-1-junfeng.guo@intel.com>

Mask for IPv4/UDP/TCP/SCTP addr/port are not supported in current
code. Thus we need to check the pattern with non-zero spec value.
If the spec is non-zero value but its mask is not full-mask, this
Flow Director rule is not supported and will return failed.

Fixes: 54be6102ef97 ("net/ice: fix pattern check for FDIR parser")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 287032a6a7..9e4a0f158f 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -2038,10 +2038,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			}
 
 			/* Mask for IPv4 src/dst addrs not supported */
-			if (!ipv4_mask->hdr.src_addr &&
+			if (ipv4_spec->hdr.src_addr &&
 				ipv4_mask->hdr.src_addr != UINT32_MAX)
 				return -rte_errno;
-			if (!ipv4_mask->hdr.dst_addr &&
+			if (ipv4_spec->hdr.dst_addr &&
 				ipv4_mask->hdr.dst_addr != UINT32_MAX)
 				return -rte_errno;
 
@@ -2187,10 +2187,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			}
 
 			/* Mask for TCP src/dst ports not supported */
-			if (!tcp_mask->hdr.src_port &&
+			if (tcp_spec->hdr.src_port &&
 				tcp_mask->hdr.src_port != UINT16_MAX)
 				return -rte_errno;
-			if (!tcp_mask->hdr.dst_port &&
+			if (tcp_spec->hdr.dst_port &&
 				tcp_mask->hdr.dst_port != UINT16_MAX)
 				return -rte_errno;
 
@@ -2234,10 +2234,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			}
 
 			/* Mask for UDP src/dst ports not supported */
-			if (!udp_mask->hdr.src_port &&
+			if (udp_spec->hdr.src_port &&
 				udp_mask->hdr.src_port != UINT16_MAX)
 				return -rte_errno;
-			if (!udp_mask->hdr.dst_port &&
+			if (udp_spec->hdr.dst_port &&
 				udp_mask->hdr.dst_port != UINT16_MAX)
 				return -rte_errno;
 
@@ -2279,10 +2279,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			}
 
 			/* Mask for SCTP src/dst ports not supported */
-			if (!sctp_mask->hdr.src_port &&
+			if (sctp_spec->hdr.src_port &&
 				sctp_mask->hdr.src_port != UINT16_MAX)
 				return -rte_errno;
-			if (!sctp_mask->hdr.dst_port &&
+			if (sctp_spec->hdr.dst_port &&
 				sctp_mask->hdr.dst_port != UINT16_MAX)
 				return -rte_errno;
 
-- 
2.25.1


  reply	other threads:[~2022-02-08  4:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08  4:29 [PATCH] " Junfeng Guo
2022-02-08  4:34 ` Junfeng Guo [this message]
2022-02-08  7:09   ` [PATCH v3] " Junfeng Guo
2022-02-11  1:08     ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220208043448.2654636-1-junfeng.guo@intel.com \
    --to=junfeng.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).