* [PATCH] net/mlx4: fix targetless internal rule creation
@ 2017-10-24 8:45 Matan Azrad
2017-10-24 9:21 ` Adrien Mazarguil
2017-10-24 10:05 ` [PATCH v2] " Matan Azrad
0 siblings, 2 replies; 4+ messages in thread
From: Matan Azrad @ 2017-10-24 8:45 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: dev
The corrupted code allowed to create internal rule with no any target queue
in case the rule creation ocured before queues creation.
For example, when user calls rte_eth_dev_default_mac_addr_set after probe
and before dev_configure, mlx4 failis because the RSS queue number was 0.
The fix prevents internal rules creation before queues creation based on
future creation before traffic start.
Fixes: 7d8675956f57 ("net/mlx4: add RSS support outside flow API")
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
drivers/net/mlx4/mlx4_flow.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index a0f431b..7a6097f 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -1290,6 +1290,9 @@ struct mlx4_drop {
unsigned int i;
int err = 0;
+ /* Nothing to be done if there are no Rx queues. */
+ if (!queues)
+ goto error;
/* Prepare default RSS configuration. */
*rss_conf = (struct rte_flow_action_rss){
.rss_conf = NULL, /* Rely on default fallback settings. */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net/mlx4: fix targetless internal rule creation
2017-10-24 8:45 [PATCH] net/mlx4: fix targetless internal rule creation Matan Azrad
@ 2017-10-24 9:21 ` Adrien Mazarguil
2017-10-24 10:05 ` [PATCH v2] " Matan Azrad
1 sibling, 0 replies; 4+ messages in thread
From: Adrien Mazarguil @ 2017-10-24 9:21 UTC (permalink / raw)
To: Matan Azrad; +Cc: dev
On Tue, Oct 24, 2017 at 08:45:30AM +0000, Matan Azrad wrote:
> The corrupted code allowed to create internal rule with no any target queue
> in case the rule creation ocured before queues creation.
ocured => occurred
>
> For example, when user calls rte_eth_dev_default_mac_addr_set after probe
> and before dev_configure, mlx4 failis because the RSS queue number was 0.
failis => fails
>
> The fix prevents internal rules creation before queues creation based on
> future creation before traffic start.
>
> Fixes: 7d8675956f57 ("net/mlx4: add RSS support outside flow API")
Since adding MAC addresses before dev_configure() was not taken into account
in the design of the affected function, I suggest appending:
Fixes: bdcad2f4843a ("net/mlx4: refactor internal flow rules")
> Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Thanks.
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] net/mlx4: fix targetless internal rule creation
2017-10-24 8:45 [PATCH] net/mlx4: fix targetless internal rule creation Matan Azrad
2017-10-24 9:21 ` Adrien Mazarguil
@ 2017-10-24 10:05 ` Matan Azrad
2017-10-24 18:18 ` Ferruh Yigit
1 sibling, 1 reply; 4+ messages in thread
From: Matan Azrad @ 2017-10-24 10:05 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: dev
The corrupted code allowed to create internal rule with no any target queue
in case the rule creation occurred before queues creation.
For example, when user calls rte_eth_dev_default_mac_addr_set after probe
and before dev_configure, mlx4 fails because the RSS queue number was 0.
The fix prevents internal rules creation before queues creation based on
future creation before traffic start.
Fixes: 7d8675956f57 ("net/mlx4: add RSS support outside flow API")
Fixes: bdcad2f4843a ("net/mlx4: refactor internal flow rules")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4_flow.c | 3 +++
1 file changed, 3 insertions(+)
V2:
Fix typos in commit log.
Append fixes line.
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index a0f431b..7a6097f 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -1290,6 +1290,9 @@ struct mlx4_drop {
unsigned int i;
int err = 0;
+ /* Nothing to be done if there are no Rx queues. */
+ if (!queues)
+ goto error;
/* Prepare default RSS configuration. */
*rss_conf = (struct rte_flow_action_rss){
.rss_conf = NULL, /* Rely on default fallback settings. */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] net/mlx4: fix targetless internal rule creation
2017-10-24 10:05 ` [PATCH v2] " Matan Azrad
@ 2017-10-24 18:18 ` Ferruh Yigit
0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-10-24 18:18 UTC (permalink / raw)
To: Matan Azrad, Adrien Mazarguil; +Cc: dev
On 10/24/2017 3:05 AM, Matan Azrad wrote:
> The corrupted code allowed to create internal rule with no any target queue
> in case the rule creation occurred before queues creation.
>
> For example, when user calls rte_eth_dev_default_mac_addr_set after probe
> and before dev_configure, mlx4 fails because the RSS queue number was 0.
>
> The fix prevents internal rules creation before queues creation based on
> future creation before traffic start.
>
> Fixes: 7d8675956f57 ("net/mlx4: add RSS support outside flow API")
> Fixes: bdcad2f4843a ("net/mlx4: refactor internal flow rules")
>
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-24 18:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24 8:45 [PATCH] net/mlx4: fix targetless internal rule creation Matan Azrad
2017-10-24 9:21 ` Adrien Mazarguil
2017-10-24 10:05 ` [PATCH v2] " Matan Azrad
2017-10-24 18:18 ` Ferruh Yigit
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.