From: Jie Liu <[email protected]>

The rss->level/key_len/queue_num checks only set the rte_flow_error
but still return 0 (success), so invalid RSS configurations are
accepted instead of being rejected with ENOTSUP.

Return the error code from the validation checks, matching the
behavior in the V3 implementation.

Cc: [email protected]
Cc: [email protected]
Signed-off-by: Jie Liu <[email protected]>
---
 drivers/net/sxe2/sxe2_flow_parse_action.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sxe2/sxe2_flow_parse_action.c 
b/drivers/net/sxe2/sxe2_flow_parse_action.c
index db70b146c6..867d90ae1d 100644
--- a/drivers/net/sxe2/sxe2_flow_parse_action.c
+++ b/drivers/net/sxe2/sxe2_flow_parse_action.c
@@ -25,15 +25,21 @@ static int32_t sxe2_flow_check_rss_action_attr(const struct 
rte_flow_action_rss
                goto l_end;
        }
 
-       if (rss->level > 2)
+       if (rss->level > 2) {
                rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, 
NULL,
                        "RSS  level is could not be greater than 2");
-       if (rss->key_len)
+               goto l_end;
+       }
+       if (rss->key_len) {
                rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, 
NULL,
                        "a nonzero RSS key_len is not supported");
-       if (rss->queue_num)
+               goto l_end;
+       }
+       if (rss->queue_num) {
                rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, 
NULL,
                        "a non-NULL RSS queue is not supported");
+               goto l_end;
+       }
        ret = 0;
 l_end:
        return ret;
-- 
2.52.0

Reply via email to