DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: add check for invalid VF queue number
@ 2017-04-18  8:46 Beilei Xing
  2017-04-18 13:29 ` Iremonger, Bernard
  0 siblings, 1 reply; 3+ messages in thread
From: Beilei Xing @ 2017-04-18  8:46 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev

Add check to avoid invalid VF queue number is used in
tunnel filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 8fe626c..0a0181f 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -1234,13 +1234,19 @@ i40e_flow_parse_tunnel_action(struct rte_eth_dev *dev,
 	if (act->type == RTE_FLOW_ACTION_TYPE_QUEUE) {
 		act_q = (const struct rte_flow_action_queue *)act->conf;
 		filter->queue_id = act_q->index;
-		if (!filter->is_to_vf)
-			if (filter->queue_id >= pf->dev_data->nb_rx_queues) {
-				rte_flow_error_set(error, EINVAL,
+		if ((!filter->is_to_vf) &&
+		    (filter->queue_id >= pf->dev_data->nb_rx_queues)) {
+			rte_flow_error_set(error, EINVAL,
 				   RTE_FLOW_ERROR_TYPE_ACTION,
 				   act, "Invalid queue ID for tunnel filter");
-				return -rte_errno;
-			}
+			return -rte_errno;
+		} else if (filter->is_to_vf &&
+			   (filter->queue_id >= pf->vf_nb_qps)) {
+			rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_ACTION,
+				   act, "Invalid queue ID for tunnel filter");
+			return -rte_errno;
+		}
 	}
 
 	/* Check if the next non-void item is END */
-- 
2.5.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: add check for invalid VF queue number
  2017-04-18  8:46 [dpdk-dev] [PATCH] net/i40e: add check for invalid VF queue number Beilei Xing
@ 2017-04-18 13:29 ` Iremonger, Bernard
  2017-04-19 10:46   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Iremonger, Bernard @ 2017-04-18 13:29 UTC (permalink / raw)
  To: Xing, Beilei, Wu, Jingjing; +Cc: dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Beilei Xing
> Sent: Tuesday, April 18, 2017 9:46 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: add check for invalid VF queue
> number
> 
> Add check to avoid invalid VF queue number is used in tunnel filter.
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: add check for invalid VF queue number
  2017-04-18 13:29 ` Iremonger, Bernard
@ 2017-04-19 10:46   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-04-19 10:46 UTC (permalink / raw)
  To: Iremonger, Bernard, Xing, Beilei, Wu, Jingjing; +Cc: dev

On 4/18/2017 2:29 PM, Iremonger, Bernard wrote:
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Beilei Xing
>> Sent: Tuesday, April 18, 2017 9:46 AM
>> To: Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: dev@dpdk.org
>> Subject: [dpdk-dev] [PATCH] net/i40e: add check for invalid VF queue
>> number
>>
>> Add check to avoid invalid VF queue number is used in tunnel filter.
>>
>> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> 
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-19 10:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18  8:46 [dpdk-dev] [PATCH] net/i40e: add check for invalid VF queue number Beilei Xing
2017-04-18 13:29 ` Iremonger, Bernard
2017-04-19 10:46   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).