[6/8] cryptodev: fix possible data conversion error

Message ID 20221208080540.62913-7-lihuisong@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series fix possible data truncation and conversion error |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

lihuisong (C) Dec. 8, 2022, 8:05 a.m. UTC
  The 'u32' data can not assigned to 'int' type variable. The 'u32' data need
to use the 'u32' telemetry API to add.

Fixes: d3d98f5ce9d0 ("cryptodev: support telemetry")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 lib/cryptodev/rte_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 2165a0688c..8e19411164 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2692,7 +2692,7 @@  cryptodev_handle_dev_info(const char *cmd __rte_unused,
 	rte_tel_data_start_dict(d);
 	rte_tel_data_add_dict_string(d, "device_name",
 		cryptodev_info.device->name);
-	rte_tel_data_add_dict_int(d, "max_nb_queue_pairs",
+	rte_tel_data_add_dict_u32(d, "max_nb_queue_pairs",
 		cryptodev_info.max_nb_queue_pairs);
 
 	return 0;