From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: "Min Hu (Connor)" <humin29@huawei.com>,
Yisen Zhuang <yisen.zhuang@huawei.com>,
Lijun Ou <oulijun@huawei.com>
Subject: [PATCH 3/9] net/hns3: dump device feature capability
Date: Fri, 11 Feb 2022 12:49:24 +0800 [thread overview]
Message-ID: <20220211044930.2449-4-humin29@huawei.com> (raw)
In-Reply-To: <20220211044930.2449-1-humin29@huawei.com>
Kunpeng 920 and Kunpeng 930 support different feature capability.
This patch dumps feature capability Current device supports.
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/hns3/hns3_ethdev_dump.c | 30 +++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/net/hns3/hns3_ethdev_dump.c b/drivers/net/hns3/hns3_ethdev_dump.c
index 094648cf47..80e7e0f996 100644
--- a/drivers/net/hns3/hns3_ethdev_dump.c
+++ b/drivers/net/hns3/hns3_ethdev_dump.c
@@ -54,6 +54,32 @@ get_io_func_hint_name(uint32_t hint)
}
}
+static void
+get_dev_feature_capability(FILE *file, struct hns3_hw *hw)
+{
+ const char * const caps_name[] = {
+ "DCB",
+ "COPPER",
+ "FD QUEUE REGION",
+ "PTP",
+ "TX PUSH",
+ "INDEP TXRX",
+ "STASH",
+ "SIMPLE BD",
+ "RXD Advanced Layout",
+ "OUTER UDP CKSUM",
+ "RAS IMP",
+ "TM",
+ "VF VLAN FILTER MOD",
+ };
+ uint32_t i;
+
+ fprintf(file, " - Dev Capability:\n");
+ for (i = 0; i < RTE_DIM(caps_name); i++)
+ fprintf(file, "\t -- support %s: %s\n", caps_name[i],
+ hw->capability & BIT(i) ? "yes" : "no");
+}
+
static void
get_device_basic_info(FILE *file, struct rte_eth_dev *dev)
{
@@ -93,7 +119,11 @@ get_device_basic_info(FILE *file, struct rte_eth_dev *dev)
int
hns3_eth_dev_priv_dump(struct rte_eth_dev *dev, FILE *file)
{
+ struct hns3_adapter *hns = dev->data->dev_private;
+ struct hns3_hw *hw = &hns->hw;
+
get_device_basic_info(file, dev);
+ get_dev_feature_capability(file, hw);
return 0;
}
--
2.33.0
next prev parent reply other threads:[~2022-02-11 4:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 4:49 [PATCH 0/9] dump device info Min Hu (Connor)
2022-02-11 4:49 ` [PATCH v4 1/9] ethdev: introduce dump API Min Hu (Connor)
2022-02-11 10:41 ` Ferruh Yigit
2022-02-11 4:49 ` [PATCH 2/9] net/hns3: dump device basic info Min Hu (Connor)
2022-02-11 4:49 ` Min Hu (Connor) [this message]
2022-02-11 4:49 ` [PATCH 4/9] net/hns3: dump device MAC info Min Hu (Connor)
2022-02-11 4:49 ` [PATCH 5/9] net/hns3: dump queue info Min Hu (Connor)
2022-02-11 4:49 ` [PATCH 6/9] net/hns3: dump VLAN configuration info Min Hu (Connor)
2022-02-11 4:49 ` [PATCH 7/9] net/hns3: dump flow director basic info Min Hu (Connor)
2022-02-11 4:49 ` [PATCH 8/9] net/hns3: dump TM configuration info Min Hu (Connor)
2022-02-11 4:49 ` [PATCH 9/9] net/hns3: dump flow control info Min Hu (Connor)
2022-02-11 18:04 ` [PATCH 0/9] dump device info 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=20220211044930.2449-4-humin29@huawei.com \
--to=humin29@huawei.com \
--cc=dev@dpdk.org \
--cc=oulijun@huawei.com \
--cc=yisen.zhuang@huawei.com \
/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).