From: Dongdong Liu <liudongdong3@huawei.com>
To: <dev@dpdk.org>, <ferruh.yigit@amd.com>, <thomas@monjalon.net>,
<andrew.rybchenko@oktetlabs.ru>, <fengchengwen@huawei.com>
Cc: <stable@dpdk.org>, <liudongdong3@huawei.com>
Subject: [PATCH 2/2] net/hns3: support dump media type
Date: Fri, 21 Apr 2023 17:53:22 +0800 [thread overview]
Message-ID: <20230421095322.30374-3-liudongdong3@huawei.com> (raw)
In-Reply-To: <20230421095322.30374-1-liudongdong3@huawei.com>
From: Chengwen Feng <fengchengwen@huawei.com>
The media type information helps locate faults such as AN or rate
switching, so add dump media type in eth_dev_priv_dump ops.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
drivers/net/hns3/hns3_dump.c | 2 ++
drivers/net/hns3/hns3_ethdev.c | 2 +-
drivers/net/hns3/hns3_ethdev.h | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/hns3/hns3_dump.c b/drivers/net/hns3/hns3_dump.c
index 8d723f1876..0af3c2ce09 100644
--- a/drivers/net/hns3/hns3_dump.c
+++ b/drivers/net/hns3/hns3_dump.c
@@ -68,12 +68,14 @@ hns3_get_dev_mac_info(FILE *file, struct hns3_adapter *hns)
fprintf(file, " - MAC Info:\n");
fprintf(file,
+ "\t -- media_type=%s\n"
"\t -- query_type=%u\n"
"\t -- supported_speed=0x%x\n"
"\t -- advertising=0x%x\n"
"\t -- lp_advertising=0x%x\n"
"\t -- support_autoneg=%s\n"
"\t -- support_fc_autoneg=%s\n",
+ hns3_get_media_type_name(hw->mac.media_type),
hw->mac.query_type,
hw->mac.supported_speed,
hw->mac.advertising,
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index a872cb8dd7..d97280e647 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -4891,7 +4891,7 @@ hns3_set_fiber_port_link_speed(struct hns3_hw *hw,
return hns3_cfg_mac_speed_dup(hw, cfg->speed, cfg->duplex);
}
-static const char *
+const char *
hns3_get_media_type_name(uint8_t media_type)
{
if (media_type == HNS3_MEDIA_TYPE_FIBER)
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index ee4dd18d7b..8268dba788 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -1054,6 +1054,8 @@ int hns3_timesync_write_time(struct rte_eth_dev *dev,
const struct timespec *ts);
int hns3_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta);
+const char *hns3_get_media_type_name(uint8_t media_type);
+
static inline bool
is_reset_pending(struct hns3_adapter *hns)
{
--
2.22.0
next prev parent reply other threads:[~2023-04-21 9:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 9:53 [PATCH 0/2] net/hns3: add some features for hns3 pmd Dongdong Liu
2023-04-21 9:53 ` [PATCH 1/2] net/hns3: simplify for hardware csum offloading Dongdong Liu
2023-04-21 9:53 ` Dongdong Liu [this message]
2023-05-16 11:15 ` [PATCH 0/2] net/hns3: add some features for hns3 pmd Dongdong Liu
2023-05-17 21:36 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230421095322.30374-3-liudongdong3@huawei.com \
--to=liudongdong3@huawei.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=ferruh.yigit@amd.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).