From patchwork Fri Feb 11 04:49:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 107337 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E65AA00BE; Fri, 11 Feb 2022 05:49:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 506C0426D8; Fri, 11 Feb 2022 05:49:35 +0100 (CET) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id C7295426E0 for ; Fri, 11 Feb 2022 05:49:33 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Jw1KQ3hFfzdZdx for ; Fri, 11 Feb 2022 12:46:18 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Fri, 11 Feb 2022 12:49:32 +0800 From: "Min Hu (Connor)" To: CC: "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou Subject: [PATCH 3/9] net/hns3: dump device feature capability Date: Fri, 11 Feb 2022 12:49:24 +0800 Message-ID: <20220211044930.2449-4-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220211044930.2449-1-humin29@huawei.com> References: <20220211044930.2449-1-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Kunpeng 920 and Kunpeng 930 support different feature capability. This patch dumps feature capability Current device supports. Signed-off-by: Min Hu (Connor) --- 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; }