代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From db1ea57482d4d11c1c86ad9941c6be782a17ec57 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 16 Feb 2022 15:13:16 +0100
Subject: ethdev: fix MAC address in telemetry device info
[ upstream commit ffe77e911f6a3d62757bc740670c4fda28f882f2 ]
The right size for a human readable MAC is RTE_ETHER_ADDR_FMT_SIZE.
While at it, the net library provides a helper for MAC address
formatting. Prefer it.
Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")
Cc: stable@dpdk.org
Reported-by: Christophe Fontaine <cfontain@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/ethdev/rte_ethdev.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index d466efffc7..d82819a458 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6358,7 +6358,7 @@ eth_dev_handle_port_info(const char *cmd __rte_unused,
struct rte_tel_data *d)
{
struct rte_tel_data *rxq_state, *txq_state;
- char mac_addr[RTE_ETHER_ADDR_LEN];
+ char mac_addr[RTE_ETHER_ADDR_FMT_SIZE];
struct rte_eth_dev *eth_dev;
char *end_param;
int port_id, i;
@@ -6401,13 +6401,8 @@ eth_dev_handle_port_info(const char *cmd __rte_unused,
eth_dev->data->min_rx_buf_size);
rte_tel_data_add_dict_int(d, "rx_mbuf_alloc_fail",
eth_dev->data->rx_mbuf_alloc_failed);
- snprintf(mac_addr, RTE_ETHER_ADDR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x",
- eth_dev->data->mac_addrs->addr_bytes[0],
- eth_dev->data->mac_addrs->addr_bytes[1],
- eth_dev->data->mac_addrs->addr_bytes[2],
- eth_dev->data->mac_addrs->addr_bytes[3],
- eth_dev->data->mac_addrs->addr_bytes[4],
- eth_dev->data->mac_addrs->addr_bytes[5]);
+ rte_ether_format_addr(mac_addr, sizeof(mac_addr),
+ eth_dev->data->mac_addrs);
rte_tel_data_add_dict_string(d, "mac_addr", mac_addr);
rte_tel_data_add_dict_int(d, "promiscuous",
eth_dev->data->promiscuous);
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。