diff mbox series

[07/17] net/bnxt: fix RSS action support

Message ID 20220427145821.5987-8-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Accepted
Delegated to: Ajit Khaparde
Headers show
Series bnxt PMD fixes | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kalesh Anakkur Purayil April 27, 2022, 2:58 p.m. UTC
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Specifying a subset of Rx queues created by the application in
the "flow create" command is invalid.
User must either specify all Rx queues created or no queues.

Also removed a wrong comment as RSS action will not be supported
if user or application specifies MARK or COUNT action.

Fixes: 239695f754cb ("net/bnxt: enhance RSS action support")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 71a8edd..bd96bba 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1074,7 +1074,6 @@  bnxt_update_filter_flags_en(struct bnxt_filter_info *filter,
 		filter1, filter->fw_l2_filter_id, filter->l2_ref_cnt);
 }
 
-/* Valid actions supported along with RSS are count and mark. */
 static int
 bnxt_validate_rss_action(const struct rte_flow_action actions[])
 {
@@ -1123,6 +1122,17 @@  bnxt_vnic_rss_cfg_update(struct bnxt *bp,
 
 	rss = (const struct rte_flow_action_rss *)act->conf;
 
+	/* must specify either all the Rx queues created by application or zero queues */
+	if (rss->queue_num && vnic->rx_queue_cnt != rss->queue_num) {
+		rte_flow_error_set(error,
+				   EINVAL,
+				   RTE_FLOW_ERROR_TYPE_ACTION,
+				   act,
+				   "Incorrect RXQ count");
+		rc = -rte_errno;
+		goto ret;
+	}
+
 	/* Currently only Toeplitz hash is supported. */
 	if (rss->func != RTE_ETH_HASH_FUNCTION_DEFAULT &&
 	    rss->func != RTE_ETH_HASH_FUNCTION_TOEPLITZ) {