From b2753f9ef7b836d955ae625c078651d5a600ea6a Mon Sep 17 00:00:00 2001 From: Beilei Xing Date: Fri, 14 Jul 2017 14:51:36 +0800 Subject: [PATCH] net/i40e: check invalid VF queue id for FDIR There's only invalid queue id checking for PF when creating FDIR rules, this patch adds checking invalid queue id for VF. Signed-off-by: Beilei Xing --- drivers/net/i40e/i40e_flow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 93ecee2cc0..95af7013c2 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2846,7 +2846,10 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, case RTE_FLOW_ACTION_TYPE_QUEUE: act_q = (const struct rte_flow_action_queue *)act->conf; filter->action.rx_queue = act_q->index; - if (filter->action.rx_queue >= pf->dev_data->nb_rx_queues) { + if ((!filter->input.flow_ext.is_vf && + filter->action.rx_queue >= pf->dev_data->nb_rx_queues) || + (filter->input.flow_ext.is_vf && + filter->action.rx_queue >= pf->vf_nb_qps)) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, "Invalid queue ID for FDIR."); -- 2.20.1