[v4] net/i40e: fix argument in RSS action
diff mbox series

Message ID 20201112104245.91324-1-kumar.amber@intel.com
State New
Delegated to: Qi Zhang
Headers show
  • [v4] net/i40e: fix argument in RSS action
Related show


Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/checkpatch success coding style OK

Commit Message

Kumar Amber Nov. 12, 2020, 10:42 a.m. UTC
The driver must check for the queue number
in the RSS action list and if not should
return with a proper error message to user.

Bugzilla ID: 573
Fixes: 9486d60b94b5 ("net/i40e: fix flow RSS queue index check")
Cc: wei.zhao1@intel.com

Signed-off-by: Kumar Amber <kumar.amber@intel.com>
 drivers/net/i40e/i40e_flow.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff mbox series

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 5bec0c7a84..397ed0ae77 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4917,6 +4917,18 @@  i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	rss = act->conf;
+	/**
+	 * Check if Queue number is specified
+	 * in argument else throw an error.
+	 */
+	if (!rss->queue || !rss->queue_num) {
+		rte_flow_error_set(error, EINVAL,
+				act,
+			   "no valid queues");
+		return -rte_errno;
+	}
 	 * RSS only supports forwarding,
 	 * check if the first not void action is RSS.