net/mlx5: fix flow query routine in Direct Verbs

Message ID 1542203224-11936-1-git-send-email-viacheslavo@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Shahaf Shuler
Headers
Series net/mlx5: fix flow query routine in Direct Verbs |

Checks

Context Check Description
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Slava Ovsiienko Nov. 14, 2018, 1:47 p.m. UTC
  From: Viacheslav Ovsiienko <Viacheslav Ovsiienko viacheslavo@mellanox.com>

The flow_dv_query() just returns -ENOTSUP value and does not
set provided error parameter structure, that crashes the
port_flow_query(). The patch fixes flow_db_query(), now it
sets an error parameter structure.

Fixes: 684dafe795d0 ("net/mlx5: add flow query abstraction interface")
Cc: Moti Haimovsky <motih@mellanox.com>

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Shahaf Shuler Nov. 15, 2018, 8:49 a.m. UTC | #1
Wednesday, November 14, 2018 3:47 PM, Slava Ovsiienko:
> Subject: [PATCH] net/mlx5: fix flow query routine in Direct Verbs
> 
> From: Viacheslav Ovsiienko <Viacheslav Ovsiienko
> viacheslavo@mellanox.com>
> 
> The flow_dv_query() just returns -ENOTSUP value and does not set provided
> error parameter structure, that crashes the port_flow_query(). The patch
> fixes flow_db_query(), now it sets an error parameter structure.
> 
> Fixes: 684dafe795d0 ("net/mlx5: add flow query abstraction interface")
> Cc: Moti Haimovsky <motih@mellanox.com>
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

Applied to next-net-mlx, thanks.
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index a2edd16..9991cad 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -2275,8 +2275,10 @@ 
 	      void *data __rte_unused,
 	      struct rte_flow_error *error __rte_unused)
 {
-	rte_errno = ENOTSUP;
-	return -rte_errno;
+	return rte_flow_error_set(error, ENOTSUP,
+				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+				  NULL,
+				  "flow query with DV is not supported");
 }