+ action.queues_n = 1;
+ action.queues[0] = queue->index;
+ } else if (actions->type == RTE_FLOW_ACTION_TYPE_RSS) {
+ int i;
+ int ierr;
+ const struct rte_flow_action_rss *rss =
+ (const struct rte_flow_action_rss *)
+ actions->conf;
+
+ if (!priv->hw_rss) {
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ actions,
+ "RSS cannot be used with "
+ "the current configuration");
+ return -rte_errno;
+ }
+ if (!priv->isolated) {
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ actions,
+ "RSS cannot be used without "
+ "isolated mode");
+ return -rte_errno;
+ }
+ if (!rte_is_power_of_2(rss->num)) {
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ actions,
+ "the number of queues "
+ "should be power of two");
+ return -rte_errno;
+ }
+ if (priv->max_rss_tbl_sz < rss->num) {
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ actions,
+ "the number of queues "
+ "is too large");
+ return -rte_errno;
+ }
+ /* checking indexes array */
+ ierr = 0;
+ for (i = 0; i < rss->num; ++i) {
+ int j;
+ if (rss->queue[i] >= priv->rxqs_n)
+ ierr = 1;
+ /*
+ * Prevent the user from specifying
+ * the same queue twice in the RSS array.
+ */
+ for (j = i + 1; j < rss->num && !ierr; ++j)
+ if (rss->queue[j] == rss->queue[i])
+ ierr = 1;
+ if (ierr) {
+ rte_flow_error_set(
+ error,
+ ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_HANDLE,
+ NULL,
+ "RSS action only supports "
+ "unique queue indices "
+ "in a list");
+ return -rte_errno;
+ }
+ }
+ action.queue = 1;
+ action.queues_n = rss->num;
+ for (i = 0; i < rss->num; ++i)
+ action.queues[i] = rss->queue[i];