[dpdk-dev] net/mlx5: fix flow creation with a single target queue

Message ID ffd35dbac5f6a705af1b8c7da8364f47b89ee560.1518620654.git.nelio.laranjeiro@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Nélio Laranjeiro Feb. 14, 2018, 3:04 p.m. UTC
  Adding a pattern targeting a single queues wrongly behaves as it is an RSS
request, ending by creating several Verbs flows rules to match the RSS
configuration.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Adrien Mazarguil Feb. 14, 2018, 3:40 p.m. UTC | #1
On Wed, Feb 14, 2018 at 04:04:45PM +0100, Nelio Laranjeiro wrote:
> Adding a pattern targeting a single queues wrongly behaves as it is an RSS
> request, ending by creating several Verbs flows rules to match the RSS
> configuration.
> 
> Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
  
Shahaf Shuler Feb. 28, 2018, 8:16 a.m. UTC | #2
Wednesday, February 14, 2018 5:40 PM, Adrien Mazarguil
> On Wed, Feb 14, 2018 at 04:04:45PM +0100, Nelio Laranjeiro wrote:
> > Adding a pattern targeting a single queues wrongly behaves as it is an
> > RSS request, ending by creating several Verbs flows rules to match the
> > RSS configuration.
> >
> > Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS
> > flow")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to next-net-mlx, thanks. 

> 
> --
> Adrien Mazarguil
> 6WIND
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 26002c4b9..42381c578 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -912,6 +912,15 @@  priv_flow_convert_finalise(struct priv *priv, struct mlx5_flow_parse *parser)
 	unsigned int i;
 
 	(void)priv;
+	/* Remove any other flow not matching the pattern. */
+	if (parser->queues_n == 1) {
+		for (i = 0; i != hash_rxq_init_n; ++i) {
+			if (i == parser->layer || !parser->queue[i].ibv_attr)
+				continue;
+			rte_free(parser->queue[i].ibv_attr);
+			parser->queue[i].ibv_attr = NULL;
+		}
+	}
 	if (parser->layer == HASH_RXQ_ETH) {
 		goto fill;
 	} else {