82599 and X540 cannot match on SCTP ports, so SCTP items with port masks
are rejected on them. However, SCTP items with a mask that does not
include ports are rejected as well.
Only reject SCTP items on such hardware if a port mask is set.
Fixes: ea0f9067b2cf ("net/ixgbe: reimplement FDIR parser")
Signed-off-by: Anatoly Burakov <[email protected]>
---
drivers/net/intel/ixgbe/ixgbe_flow_fdir.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/intel/ixgbe/ixgbe_flow_fdir.c
b/drivers/net/intel/ixgbe/ixgbe_flow_fdir.c
index 9c9dc8846fa..0a7e96a030d 100644
--- a/drivers/net/intel/ixgbe/ixgbe_flow_fdir.c
+++ b/drivers/net/intel/ixgbe/ixgbe_flow_fdir.c
@@ -411,11 +411,9 @@ ixgbe_validate_fdir_normal_sctp(const void *ctx,
"SCTP tag/cksum not supported");
}
- /*
- * SCTP mask is not NULL, which means we are potentially looking at
- * masking SCTP ports, so check hardware support.
- */
- if (!fdir_ctx->supports_sctp_ports) {
+ /* SCTP port filtering is only supported on some hardware. */
+ if (!fdir_ctx->supports_sctp_ports &&
+ (sctp_mask->hdr.src_port || sctp_mask->hdr.dst_port)) {
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM, item,
"SCTP port filtering not supported by
hardware");
--
2.52.0