* [dpdk-dev] [PATCH] net/ixgbe: add queue index check in filter
@ 2017-07-17 6:12 Wei Zhao
0 siblings, 0 replies; 4+ messages in thread
From: Wei Zhao @ 2017-07-17 6:12 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, root, Wei Zhao
From: root <root@dpdk2.bj.intel.com>
Add queue index check when create filter rule, or
filter with invalid queue id can be created successfully.
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
drivers/net/ixgbe/ixgbe_flow.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 6885abd..6d4a0be 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -488,9 +488,7 @@ ixgbe_parse_ntuple_filter(struct rte_eth_dev *dev,
return -rte_errno;
}
- if (filter->queue >= IXGBE_MAX_RX_QUEUE_NUM ||
- filter->priority > IXGBE_5TUPLE_MAX_PRI ||
- filter->priority < IXGBE_5TUPLE_MIN_PRI)
+ if (filter->queue >= dev->data->nb_rx_queues)
return -rte_errno;
/* fixed value for ixgbe */
@@ -707,7 +705,7 @@ ixgbe_parse_ethertype_filter(struct rte_eth_dev *dev,
return -rte_errno;
}
- if (filter->queue >= IXGBE_MAX_RX_QUEUE_NUM) {
+ if (filter->queue >= dev->data->nb_rx_queues) {
memset(filter, 0, sizeof(struct rte_eth_ethertype_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -984,6 +982,9 @@ ixgbe_parse_syn_filter(struct rte_eth_dev *dev,
ret = cons_parse_syn_filter(attr, pattern,
actions, filter, error);
+ if (filter->queue >= dev->data->nb_rx_queues)
+ return -rte_errno;
+
if (ret)
return ret;
@@ -1177,6 +1178,9 @@ ixgbe_parse_l2_tn_filter(struct rte_eth_dev *dev,
return -rte_errno;
}
+ if (filter->queue >= dev->data->nb_rx_queues)
+ return -rte_errno;
+
return ret;
}
@@ -2542,6 +2546,10 @@ ixgbe_parse_fdir_filter(struct rte_eth_dev *dev,
if (fdir_mode == RTE_FDIR_MODE_NONE ||
fdir_mode != rule->mode)
return -ENOTSUP;
+
+ if (rule->queue >= dev->data->nb_rx_queues)
+ return -ENOTSUP;
+
return ret;
}
--
2.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH] net/ixgbe: add queue index check in filter
@ 2017-07-17 6:13 Wei Zhao
2017-07-18 10:43 ` Ferruh Yigit
0 siblings, 1 reply; 4+ messages in thread
From: Wei Zhao @ 2017-07-17 6:13 UTC (permalink / raw)
To: dev; +Cc: wenzhuo.lu, Wei Zhao
Add queue index check when create filter rule, or
filter with invalid queue id can be created successfully.
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
drivers/net/ixgbe/ixgbe_flow.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 6885abd..6d4a0be 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -488,9 +488,7 @@ ixgbe_parse_ntuple_filter(struct rte_eth_dev *dev,
return -rte_errno;
}
- if (filter->queue >= IXGBE_MAX_RX_QUEUE_NUM ||
- filter->priority > IXGBE_5TUPLE_MAX_PRI ||
- filter->priority < IXGBE_5TUPLE_MIN_PRI)
+ if (filter->queue >= dev->data->nb_rx_queues)
return -rte_errno;
/* fixed value for ixgbe */
@@ -707,7 +705,7 @@ ixgbe_parse_ethertype_filter(struct rte_eth_dev *dev,
return -rte_errno;
}
- if (filter->queue >= IXGBE_MAX_RX_QUEUE_NUM) {
+ if (filter->queue >= dev->data->nb_rx_queues) {
memset(filter, 0, sizeof(struct rte_eth_ethertype_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -984,6 +982,9 @@ ixgbe_parse_syn_filter(struct rte_eth_dev *dev,
ret = cons_parse_syn_filter(attr, pattern,
actions, filter, error);
+ if (filter->queue >= dev->data->nb_rx_queues)
+ return -rte_errno;
+
if (ret)
return ret;
@@ -1177,6 +1178,9 @@ ixgbe_parse_l2_tn_filter(struct rte_eth_dev *dev,
return -rte_errno;
}
+ if (filter->queue >= dev->data->nb_rx_queues)
+ return -rte_errno;
+
return ret;
}
@@ -2542,6 +2546,10 @@ ixgbe_parse_fdir_filter(struct rte_eth_dev *dev,
if (fdir_mode == RTE_FDIR_MODE_NONE ||
fdir_mode != rule->mode)
return -ENOTSUP;
+
+ if (rule->queue >= dev->data->nb_rx_queues)
+ return -ENOTSUP;
+
return ret;
}
--
2.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbe: add queue index check in filter
2017-07-17 6:13 Wei Zhao
@ 2017-07-18 10:43 ` Ferruh Yigit
2017-07-19 3:50 ` Zhao1, Wei
0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2017-07-18 10:43 UTC (permalink / raw)
To: Wei Zhao, dev; +Cc: wenzhuo.lu
On 7/17/2017 7:13 AM, Wei Zhao wrote:
> Add queue index check when create filter rule, or
> filter with invalid queue id can be created successfully.
>
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
<...>
> @@ -1177,6 +1178,9 @@ ixgbe_parse_l2_tn_filter(struct rte_eth_dev *dev,
> return -rte_errno;
> }
>
> + if (filter->queue >= dev->data->nb_rx_queues)
> + return -rte_errno;
> +
This is giving following build error [1].
[1]
.../drivers/net/ixgbe/ixgbe_flow.c:1180:6:
error: use of undeclared identifier 'filter'
if (filter->queue >= dev->data->nb_rx_queues)
^
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbe: add queue index check in filter
2017-07-18 10:43 ` Ferruh Yigit
@ 2017-07-19 3:50 ` Zhao1, Wei
0 siblings, 0 replies; 4+ messages in thread
From: Zhao1, Wei @ 2017-07-19 3:50 UTC (permalink / raw)
To: Yigit, Ferruh, dev; +Cc: Lu, Wenzhuo
Hi, Ferruh
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Tuesday, July 18, 2017 6:44 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: add queue index check in filter
>
> On 7/17/2017 7:13 AM, Wei Zhao wrote:
> > Add queue index check when create filter rule, or filter with invalid
> > queue id can be created successfully.
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
>
> <...>
>
> > @@ -1177,6 +1178,9 @@ ixgbe_parse_l2_tn_filter(struct rte_eth_dev
> *dev,
> > return -rte_errno;
> > }
> >
> > + if (filter->queue >= dev->data->nb_rx_queues)
> > + return -rte_errno;
> > +
>
> This is giving following build error [1].
>
> [1]
> .../drivers/net/ixgbe/ixgbe_flow.c:1180:6:
> error: use of undeclared identifier 'filter'
> if (filter->queue >= dev->data->nb_rx_queues)
> ^
Thank you, a new v2 patch has been commit to DPDK.org
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-19 3:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 6:12 [dpdk-dev] [PATCH] net/ixgbe: add queue index check in filter Wei Zhao
2017-07-17 6:13 Wei Zhao
2017-07-18 10:43 ` Ferruh Yigit
2017-07-19 3:50 ` Zhao1, Wei
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).