From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83325A00BE; Mon, 27 Apr 2020 11:58:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ECF461D160; Mon, 27 Apr 2020 11:58:13 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 6237F1D14A for ; Mon, 27 Apr 2020 11:58:01 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200427095801euoutp012329dc4b14a72b47c9b5730c6ff7ebb1~JpL5gJYGc2274222742euoutp01L for ; Mon, 27 Apr 2020 09:58:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200427095801euoutp012329dc4b14a72b47c9b5730c6ff7ebb1~JpL5gJYGc2274222742euoutp01L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1587981481; bh=XnHqu+IdM/7bZbkoAb33eDgSbMCwNbJNnFgWiM2eKm0=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=BWM0cDdeGMLeLAzaiSm/N0cvIvx1OUWQGMX76638pu1x+sdGt4zQnUCA0o9ywKfJI bQ8wQ8p9/NgRYI9pdlzvFyOGgkC3OJO1vBzXYsRBP1f+7Nq4vUFdXkRgxaMoYoH+e5 dpAtfJULPLVxzUfkG40eb4OYTGqFIriRsvZz4w8o= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200427095800eucas1p237dfffd010b0c0c319274af7bc15b561~JpL5SBYL30741307413eucas1p2E; Mon, 27 Apr 2020 09:58:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 1D.E3.60679.8ACA6AE5; Mon, 27 Apr 2020 10:58:00 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200427095800eucas1p16c30ec18649efe66b831728fe661703f~JpL5DWyzF3112831128eucas1p1R; Mon, 27 Apr 2020 09:58:00 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200427095800eusmtrp11d4d58f403ceb49099b5d966bf29bfb7~JpL5CvdSN2270622706eusmtrp1N; Mon, 27 Apr 2020 09:58:00 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-2e-5ea6aca85f12 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B2.AF.07950.8ACA6AE5; Mon, 27 Apr 2020 10:58:00 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200427095800eusmtip19013d37ed95f3da1f93db71ba12fc8f6~JpL4kKYLN1184111841eusmtip13; Mon, 27 Apr 2020 09:58:00 +0000 (GMT) From: Ivan Dyukov To: dev@dpdk.org, i.dyukov@samsung.com, v.kuramshin@samsung.com, thomas@monjalon.net, david.marchand@redhat.com, ferruh.yigit@intel.com, arybchenko@solarflare.com Date: Mon, 27 Apr 2020 12:57:28 +0300 Message-Id: <20200427095737.11082-7-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200427095737.11082-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDIsWRmVeSWpSXmKPExsWy7djPc7or1iyLM3i0zsLiwZS7bBbbV3Sx Wbz7tJ3J4s7e0+wWsy41sVt8enCCxeL0zc3sDuwevxYsZfVYvOclk8exm9PYPd7vu8rm0bdl FaPH6ic/2ALYorh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ixacAvI4QBKSEi8 fsIMUSMs8edaFxtEzWdGiX/7VjKCJNgENCROd8xjAkmICKxjlPg48w1Yh7CAvUTfCogiFgFV ia61DUwgNq+ApcSshuVsEFPlJVZvOMAMsoxTwEri2f9kkLCQQLjExSu/wcJCAsoSn68mTGDk W8DIsIpRJLW0ODc9t9hIrzgxt7g0L10vOT93EyMwdLcd+7llB2PXu+BDjAIcjEo8vBzbl8YJ sSaWFVfmHmKU4GBWEuF9lLEsTog3JbGyKrUoP76oNCe1+BCjKdB5E5mlRJPzgXGVVxJvaGpo bmFpaG5sbmxmoSTO2yFwMEZIID2xJDU7NbUgtQimj4mDU6qB0ZFR+HbP9Cmz9vw5s/xqqpHu 5fO6/z0el5su/X7tot6xgPUzbf7xlIpWNtw8ouOT42SjpirVPzPyxpdzETUZlnVnnycw3pQu Md9sxs8u3i9zPOT/wbc2VhHz9n7xb28PtZqm8Yrhjxmrdpi6vs6ShxvjL2yKLj1wncfk0/bs FX6xOw/9qAzqVWIpzkg01GIuKk4EAJhr6d9zAgAA X-CMS-MailID: 20200427095800eucas1p16c30ec18649efe66b831728fe661703f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200427095800eucas1p16c30ec18649efe66b831728fe661703f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200427095800eucas1p16c30ec18649efe66b831728fe661703f References: <4816966.qqrk5fENW1@thomas> <20200427095737.11082-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v1 6/6] ethdev: UNKNOWN link speed print format X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: 4816966.qqrk5fENW1@thomas.org List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Ivan Dyukov --- app/proc-info/main.c | 7 ++++++- app/test-pipeline/init.c | 14 ++++++++------ app/test-pmd/config.c | 10 ++++++---- app/test-pmd/testpmd.c | 4 +++- app/test/test_pmd_perf.c | 4 +++- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index b1a025a36..27065a231 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -685,10 +685,15 @@ show_port(void) printf("Link get failed (port %u): %s\n", i, rte_strerror(-ret)); } else { - printf("\t -- link speed %u duplex %d," + printf("\t -- link speed %u%s duplex %d%s," " auto neg %d status %d\n", link.link_speed, + (link.link_speed == UINT32_MAX) ? + ("(UNKNOWN)") : (" Mbps"), link.link_duplex, + (link.link_duplex == + ETH_LINK_FULL_DUPLEX) ? + ("(full)") : ("(half)"), link.link_autoneg, link.link_status); } diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c index 67d54ae05..09b762a4e 100644 --- a/app/test-pipeline/init.c +++ b/app/test-pipeline/init.c @@ -173,12 +173,14 @@ app_ports_check_link(void) all_ports_up = 0; continue; } - - RTE_LOG(INFO, USER1, "Port %u (%u Gbps) %s\n", - port, - link.link_speed / 1000, - link.link_status ? "UP" : "DOWN"); - + if (link.link_speed == UINT32_MAX) + RTE_LOG(INFO, USER1, "Port %u (UNKNOWN Gbps) %s\n", + port, link.link_status ? "UP" : "DOWN"); + else + RTE_LOG(INFO, USER1, "Port %u (%u Gbps) %s\n", + port, + link.link_speed / 1000, + link.link_status ? "UP" : "DOWN"); if (link.link_status == ETH_LINK_DOWN) all_ports_up = 0; } diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 661297ddd..96e668ae5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -577,7 +577,8 @@ port_infos_display(portid_t port_id) printf("\nmemory allocation on the socket: %u",port->socket_id); printf("\nLink status: %s\n", (link.link_status) ? ("up") : ("down")); - printf("Link speed: %u Mbps\n", link.link_speed); + printf("Link speed: %u%s\n", link.link_speed, + (link.link_speed == UINT32_MAX) ? ("(UNKNOWN)") : (" Mbps")); printf("Link duplex: %s\n", (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex")); @@ -722,12 +723,13 @@ port_summary_display(portid_t port_id) if (ret != 0) return; - printf("%-4d %02X:%02X:%02X:%02X:%02X:%02X %-12s %-14s %-8s %uMbps\n", + printf("%-4d %02X:%02X:%02X:%02X:%02X:%02X %-12s %-14s %-8s %u%s\n", port_id, mac_addr.addr_bytes[0], mac_addr.addr_bytes[1], mac_addr.addr_bytes[2], mac_addr.addr_bytes[3], mac_addr.addr_bytes[4], mac_addr.addr_bytes[5], name, dev_info.driver_name, (link.link_status) ? ("up") : ("down"), - link.link_speed); + link.link_speed, + (link.link_speed == UINT32_MAX) ? ("(UNKNOWN)") : (" Mbps")); } void @@ -3787,7 +3789,7 @@ set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate) ret = eth_link_get_nowait_print_err(port_id, &link); if (ret < 0) return 1; - if (rate > link.link_speed) { + if (link.link_speed != UINT32_MAX && rate > link.link_speed) { printf("Invalid rate value:%u bigger than link speed: %u\n", rate, link.link_speed); return 1; diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d4df23a93..9b47886f7 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3002,8 +3002,10 @@ check_all_ports_link_status(uint32_t port_mask) if (print_flag == 1) { if (link.link_status) printf( - "Port%d Link Up. speed %u Mbps- %s\n", + "Port%d Link Up. speed %u%s- %s\n", portid, link.link_speed, + (link.link_speed == UINT32_MAX) ? + ("(UNKNOWN)") : (" Mbps"), (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex")); else diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index 352cd4715..c8124676d 100644 --- a/app/test/test_pmd_perf.c +++ b/app/test/test_pmd_perf.c @@ -148,8 +148,10 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) if (print_flag == 1) { if (link.link_status) { printf( - "Port%d Link Up. Speed %u Mbps - %s\n", + "Port%d Link Up. Speed %u%s - %s\n", portid, link.link_speed, + (link.link_speed == UINT32_MAX) ? + ("(UNKNOWN)") : (" Mbps"), (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex")); if (link_mbps == 0) -- 2.17.1