代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 2dcb9886c4939afcbd0ef4983a52541c3cdc92fb Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 12 Jan 2023 17:41:10 +0000
Subject: telemetry: rename unsigned 64-bit enum value to uint
[ upstream commit 2d2c55e4ae5ad9ddd24567d2c4695c5bc4ea017c ]
For telemetry data, rather than having unsigned 64-bit values and signed
32-bit values, we want to just have unsigned and signed values, each
stored with the max bit-width i.e. 64-bits. To that end, we rename the
U64 enum entry to "UINT" to have a more generic name
For backward API-level compatibility, we can use a macro to alias the
old name to the new.
Suggested-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
app/test/test_telemetry_data.c | 10 +++++-----
drivers/net/cnxk/cnxk_ethdev_telemetry.c | 2 +-
lib/cryptodev/rte_cryptodev.c | 2 +-
lib/ethdev/rte_ethdev.c | 2 +-
lib/ipsec/ipsec_telemetry.c | 2 +-
lib/security/rte_security.c | 4 ++--
lib/telemetry/rte_telemetry.h | 6 ++++--
lib/telemetry/telemetry.c | 4 ++--
lib/telemetry/telemetry_data.c | 4 ++--
9 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/app/test/test_telemetry_data.c b/app/test/test_telemetry_data.c
index 7d9be37..8bce86b 100644
--- a/app/test/test_telemetry_data.c
+++ b/app/test/test_telemetry_data.c
@@ -393,7 +393,7 @@ test_case_array_u64(void)
{
int i;
- rte_tel_data_start_array(&response_data, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(&response_data, RTE_TEL_UINT_VAL);
for (i = 0; i < 5; i++)
rte_tel_data_add_array_u64(&response_data, i);
return CHECK_OUTPUT("[0,1,2,3,4]");
@@ -444,10 +444,10 @@ test_dict_with_array_u64_values(void)
int i;
struct rte_tel_data *child_data = rte_tel_data_alloc();
- rte_tel_data_start_array(child_data, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(child_data, RTE_TEL_UINT_VAL);
struct rte_tel_data *child_data2 = rte_tel_data_alloc();
- rte_tel_data_start_array(child_data2, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(child_data2, RTE_TEL_UINT_VAL);
rte_tel_data_start_dict(&response_data);
@@ -470,10 +470,10 @@ test_array_with_array_u64_values(void)
int i;
struct rte_tel_data *child_data = rte_tel_data_alloc();
- rte_tel_data_start_array(child_data, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(child_data, RTE_TEL_UINT_VAL);
struct rte_tel_data *child_data2 = rte_tel_data_alloc();
- rte_tel_data_start_array(child_data2, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(child_data2, RTE_TEL_UINT_VAL);
rte_tel_data_start_array(&response_data, RTE_TEL_CONTAINER);
diff --git a/drivers/net/cnxk/cnxk_ethdev_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_telemetry.c
index 4fd9048..d73d715 100644
--- a/drivers/net/cnxk/cnxk_ethdev_telemetry.c
+++ b/drivers/net/cnxk/cnxk_ethdev_telemetry.c
@@ -51,7 +51,7 @@ ethdev_tel_handle_info(const char *cmd __rte_unused,
i_data = rte_tel_data_alloc();
if (i_data == NULL)
return -ENOMEM;
- rte_tel_data_start_array(i_data, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(i_data, RTE_TEL_UINT_VAL);
for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
/* Skip if port is unused */
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 23e079d..ae20d19 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2524,7 +2524,7 @@ crypto_caps_array(struct rte_tel_data *d,
uint64_t caps_val[CRYPTO_CAPS_SZ];
unsigned int i = 0, j;
- rte_tel_data_start_array(d, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(d, RTE_TEL_UINT_VAL);
while ((dev_caps = &capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index c65dc8b..8a35521 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6211,7 +6211,7 @@ eth_dev_add_port_queue_stats(struct rte_tel_data *d, uint64_t *q_stats,
struct rte_tel_data *q_data = rte_tel_data_alloc();
if (q_data == NULL)
return;
- rte_tel_data_start_array(q_data, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(q_data, RTE_TEL_UINT_VAL);
for (q = 0; q < RTE_ETHDEV_QUEUE_STAT_CNTRS; q++)
rte_tel_data_add_array_u64(q_data, q_stats[q]);
rte_tel_data_add_dict_container(d, stat_name, q_data, 0);
diff --git a/lib/ipsec/ipsec_telemetry.c b/lib/ipsec/ipsec_telemetry.c
index 9a91e47..1147de6 100644
--- a/lib/ipsec/ipsec_telemetry.c
+++ b/lib/ipsec/ipsec_telemetry.c
@@ -21,7 +21,7 @@ handle_telemetry_cmd_ipsec_sa_list(const char *cmd __rte_unused,
struct rte_tel_data *data)
{
struct ipsec_telemetry_entry *entry;
- rte_tel_data_start_array(data, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(data, RTE_TEL_UINT_VAL);
LIST_FOREACH(entry, &ipsec_telemetry_list, next) {
const struct rte_ipsec_sa *sa = entry->sa;
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index 6e45a03..fda8c47 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -237,7 +237,7 @@ crypto_caps_array(struct rte_tel_data *d,
uint64_t caps_val[CRYPTO_CAPS_SZ];
unsigned int i = 0, j;
- rte_tel_data_start_array(d, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(d, RTE_TEL_UINT_VAL);
while ((dev_caps = &capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
@@ -262,7 +262,7 @@ sec_caps_array(struct rte_tel_data *d,
uint64_t caps_val[SEC_CAPS_SZ];
unsigned int i = 0, j;
- rte_tel_data_start_array(d, RTE_TEL_U64_VAL);
+ rte_tel_data_start_array(d, RTE_TEL_UINT_VAL);
while ((dev_caps = &capabilities[i++])->action !=
RTE_SECURITY_ACTION_TYPE_NONE) {
diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h
index 5d5b75b..05e64d4 100644
--- a/lib/telemetry/rte_telemetry.h
+++ b/lib/telemetry/rte_telemetry.h
@@ -43,10 +43,12 @@ struct rte_tel_data;
enum rte_tel_value_type {
RTE_TEL_STRING_VAL, /** a string value */
RTE_TEL_INT_VAL, /** a signed 32-bit int value */
- RTE_TEL_U64_VAL, /** an unsigned 64-bit int value */
+ RTE_TEL_UINT_VAL, /** an unsigned 64-bit int value */
RTE_TEL_CONTAINER, /** a container struct */
};
+#define RTE_TEL_U64_VAL RTE_TEL_UINT_VAL
+
/**
* Start an array of the specified type for returning from a callback
*
@@ -121,7 +123,7 @@ rte_tel_data_add_array_int(struct rte_tel_data *d, int x);
/**
* Add a uint64_t to an array.
* The array must have been started by rte_tel_data_start_array() with
- * RTE_TEL_U64_VAL as the type parameter.
+ * RTE_TEL_UINT_VAL as the type parameter.
*
* @param d
* The data structure passed to the callback
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 8f2aef4..f4c886d 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -200,7 +200,7 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
buf_len, used,
v->name, v->value.ival);
break;
- case RTE_TEL_U64_VAL:
+ case RTE_TEL_UINT_VAL:
used = rte_tel_json_add_obj_u64(out_buf,
buf_len, used,
v->name, v->value.u64val);
@@ -267,7 +267,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
buf_len, used,
v->name, v->value.ival);
break;
- case RTE_TEL_U64_VAL:
+ case RTE_TEL_UINT_VAL:
used = rte_tel_json_add_obj_u64(cb_data_buf,
buf_len, used,
v->name, v->value.u64val);
diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c
index 7204c34..4c661db 100644
--- a/lib/telemetry/telemetry_data.c
+++ b/lib/telemetry/telemetry_data.c
@@ -18,7 +18,7 @@ rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type)
enum tel_container_types array_types[] = {
[RTE_TEL_STRING_VAL] = TEL_ARRAY_STRING,
[RTE_TEL_INT_VAL] = TEL_ARRAY_INT,
- [RTE_TEL_U64_VAL] = TEL_ARRAY_U64,
+ [RTE_TEL_UINT_VAL] = TEL_ARRAY_U64,
[RTE_TEL_CONTAINER] = TEL_ARRAY_CONTAINER,
};
d->type = array_types[type];
@@ -227,7 +227,7 @@ rte_tel_data_add_dict_u64(struct rte_tel_data *d,
return -EINVAL;
d->data_len++;
- e->type = RTE_TEL_U64_VAL;
+ e->type = RTE_TEL_UINT_VAL;
e->value.u64val = val;
const size_t bytes = strlcpy(e->name, name, RTE_TEL_MAX_STRING_LEN);
return bytes < RTE_TEL_MAX_STRING_LEN ? 0 : E2BIG;
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。