+ rule->nb_queues = 1;
+ rule->action = HNS3_FD_ACTION_ACCEPT_PACKET;
+ return 0;
+}
+
+static int
+hns3_handle_action_queue_region(struct rte_eth_dev *dev,
+ const struct rte_flow_action *action,
+ struct hns3_fdir_rule *rule,
+ struct rte_flow_error *error)
+{
+ struct hns3_adapter *hns = dev->data->dev_private;
+ const struct rte_flow_action_rss *conf = action->conf;
+ struct hns3_hw *hw = &hns->hw;
+ uint16_t idx;
+
+ if (!hns3_dev_fd_queue_region_supported(hw))
+ return rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION, action,
+ "Not support config queue region!");
+
+ if ((!rte_is_power_of_2(conf->queue_num)) ||
+ conf->queue_num > hw->rss_size_max ||
+ conf->queue[0] >= hw->used_rx_queues ||
+ conf->queue[0] + conf->queue_num > hw->used_rx_queues) {
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION_CONF, action,
+ "Invalid start queue ID and queue num! the start queue "
+ "ID must valid, the queue num must be power of 2 and "
+ "<= rss_size_max.");
+ }
+
+ for (idx = 1; idx < conf->queue_num; idx++) {
+ if (conf->queue[idx] != conf->queue[idx - 1] + 1)
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION_CONF, action,
+ "Invalid queue ID sequence! the queue ID "
+ "must be continuous increment.");
+ }
+
+ rule->queue_id = conf->queue[0];
+ rule->nb_queues = conf->queue_num;