From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 626CF429AC for ; Fri, 21 Apr 2023 11:55:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A3B4427F5; Fri, 21 Apr 2023 11:55:15 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id A52A4410F3; Fri, 21 Apr 2023 11:55:12 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Q2qY812JNzng0h; Fri, 21 Apr 2023 17:51:24 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 21 Apr 2023 17:55:10 +0800 From: Dongdong Liu To: , , , , CC: , Subject: [PATCH 2/2] net/hns3: support dump media type Date: Fri, 21 Apr 2023 17:53:22 +0800 Message-ID: <20230421095322.30374-3-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20230421095322.30374-1-liudongdong3@huawei.com> References: <20230421095322.30374-1-liudongdong3@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Chengwen Feng 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 Signed-off-by: Dongdong Liu --- 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