struct rte_flow_error *error)
{
struct hns3_adapter *hns = dev->data->dev_private;
- struct hns3_hw *hw = &hns->hw;
const struct rte_flow_action_queue *queue;
+ struct hns3_hw *hw = &hns->hw;
queue = (const struct rte_flow_action_queue *)action->conf;
- if (queue->index >= hw->data->nb_rx_queues)
+ if (queue->index >= hw->used_rx_queues) {
+ hns3_err(hw, "queue ID(%d) is greater than number of "
+ "available queue (%d) in driver.",
+ queue->index, hw->used_rx_queues);
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, action,
"Invalid queue ID in PF");
+ }
+
rule->queue_id = queue->index;
rule->action = HNS3_FD_ACTION_ACCEPT_PACKET;
return 0;