Move "mlx5_devx_cmd_match_sample_info_query()" function to use
"DEVX_DRV_LOG" in case of "devx_general_cmd" failure.
This macro contains syndrome report and used by all other function
calling "devx_general_cmd".

Signed-off-by: Michael Baum <michae...@nvidia.com>
Acked-by: Suanming Mou <suanmi...@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c 
b/drivers/common/mlx5/mlx5_devx_cmds.c
index 68137dc535..b8f4a840e7 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -641,11 +641,10 @@ mlx5_devx_cmd_match_sample_info_query(void *ctx, uint32_t 
sample_field_id,
        MLX5_SET(query_match_sample_info_in, in, sample_field_id,
                 sample_field_id);
        rc = mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, sizeof(out));
-       if (rc) {
-               DRV_LOG(ERR, "Failed to query match sample info using DevX: %s",
-                       strerror(rc));
-               rte_errno = rc;
-               return -rc;
+       if (rc || MLX5_FW_STATUS(out)) {
+               DEVX_DRV_LOG(ERR, out, "query match sample info",
+                            "sample_field_id", sample_field_id);
+               return MLX5_DEVX_ERR_RC(rc);
        }
        attr->modify_field_id = MLX5_GET(query_match_sample_info_out, out,
                                         modify_field_id);
-- 
2.25.1

Reply via email to