[v3] net/ice: fix pattern check logic in FDIR
Checks
Commit Message
Mask for IPv4/UDP/TCP/SCTP addr/port are not supported in current
code. Thus we need to check each pattern mask. Only zero-mask and
full-mask are allowed to pass the pattern parse, otherwise will
return failure.
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(-)
Comments
> -----Original Message-----
> From: Guo, Junfeng <junfeng.guo@intel.com>
> Sent: Tuesday, February 8, 2022 3:09 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; Guo, Junfeng <junfeng.guo@intel.com>
> Subject: [PATCH v3] net/ice: fix pattern check logic in FDIR
>
> Mask for IPv4/UDP/TCP/SCTP addr/port are not supported in current code.
> Thus we need to check each pattern mask. Only zero-mask and full-mask are
> allowed to pass the pattern parse, otherwise will return failure.
>
> Fixes: 54be6102ef97 ("net/ice: fix pattern check for FDIR 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
@@ -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_mask->hdr.src_addr &&
ipv4_mask->hdr.src_addr != UINT32_MAX)
return -rte_errno;
- if (!ipv4_mask->hdr.dst_addr &&
+ if (ipv4_mask->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_mask->hdr.src_port &&
tcp_mask->hdr.src_port != UINT16_MAX)
return -rte_errno;
- if (!tcp_mask->hdr.dst_port &&
+ if (tcp_mask->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_mask->hdr.src_port &&
udp_mask->hdr.src_port != UINT16_MAX)
return -rte_errno;
- if (!udp_mask->hdr.dst_port &&
+ if (udp_mask->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_mask->hdr.src_port &&
sctp_mask->hdr.src_port != UINT16_MAX)
return -rte_errno;
- if (!sctp_mask->hdr.dst_port &&
+ if (sctp_mask->hdr.dst_port &&
sctp_mask->hdr.dst_port != UINT16_MAX)
return -rte_errno;