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 8CBC7A04D9; Tue, 11 Aug 2020 10:59:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA1C71C20A; Tue, 11 Aug 2020 10:53:45 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id DC60B1C204 for ; Tue, 11 Aug 2020 10:53:44 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085344euoutp018c1cec1311ee601357792456a7215629~qKsCfvC_G0904509045euoutp01Z; Tue, 11 Aug 2020 08:53:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200811085344euoutp018c1cec1311ee601357792456a7215629~qKsCfvC_G0904509045euoutp01Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136024; bh=+UcMist8Ega1rfcImf6H5u2W7IOStGDetiboH2IeCCg=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=u38CBT7t48osU9+gmQbxOw9yUlPvQdy3ads4ziDW2N0mqWjhLvlZPs5ce5Nz1BmzX kZERXrjZw7cSAFk2aSiXubo706UjpDgaE8oe3SL69ZT4T7D+0oij7C7/ZbT05YCCli ruBwW6y0xPPKLAmkcjnYwLhchWSVMUXvmppGQW8g= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085344eucas1p11aedea324284a7dfe911d8f1d915b5fa~qKsCOTSFk1585815858eucas1p1c; Tue, 11 Aug 2020 08:53:44 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BC.C1.06456.89C523F5; Tue, 11 Aug 2020 09:53:44 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085344eucas1p2301dcc589febbf13d1d3d72713e55404~qKsB424c50326203262eucas1p2T; Tue, 11 Aug 2020 08:53:44 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085343eusmtrp1a61a189661de0f79e1d9f6c1a097565f~qKsB4BUq81667616676eusmtrp12; Tue, 11 Aug 2020 08:53:43 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-64-5f325c98afc7 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 2F.6D.06017.79C523F5; Tue, 11 Aug 2020 09:53:43 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085341eusmtip1bbc0ace3b9990f9c295c9a79a54f1314~qKr--k-r31664316643eusmtip17; Tue, 11 Aug 2020 08:53:41 +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, wei.zhao1@intel.com, jia.guo@intel.com, beilei.xing@intel.com, qiming.yang@intel.com, wenzhuo.lu@intel.com, mb@smartsharesystems.com, stephen@networkplumber.org, nicolas.chautru@intel.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, cristian.dumitrescu@intel.com, radu.nicolau@intel.com, akhil.goyal@nxp.com, declan.doherty@intel.com, skori@marvell.com, pbhagavatula@marvell.com, jerinj@marvell.com, kirankumark@marvell.com, david.hunt@intel.com, anatoly.burakov@intel.com, xiaoyun.li@intel.com, jingjing.wu@intel.com, john.mcnamara@intel.com, jasvinder.singh@intel.com, byron.marohn@intel.com, yipeng1.wang@intel.com Date: Tue, 11 Aug 2020 11:52:41 +0300 Message-Id: <20200811085246.28735-23-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811085246.28735-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSaUxUVxiGPXdnZMx10PjFEpcx2g0X2pp8sUaK0eRGjfpDSWqwdIRbRFkm c4FWf1TKKDWAA4JREcVhkICDlVKGRQItjgvLoIRBCgQXJFaCBUEc0iqLZbiY/nvP877v+b6c HIHWZXOLhajYeNkUa4jWcxqm8u6b1tXnQz8LW+dq9sPSljyCfY8LaOw984jDtJHjFHbZg7C2 6iKLWU+SKLRkvaKwqjiVw8HeZAZfjlZR+LDOxeMFdzKPo85+Hk+15hLsn3hBY471NcHWvAoW 39ys4XB4wsag5W0HwQxHI8GG9FcMnrlRTTAlVcSRq0U8FjxcgqO9jQy6ust5vDbWRmNFyyTB 0w2lBO+lvGO/Wi69tRayUkHtACVl57fR0t3us7yU3pRHSWUvqylp+PcOTrI47ERq7kujpZJn /3K7Nfs0GyPk6KhE2bR207eag41XPjX2an4w2wrpJOIRUomPAOIX8G7oJpNKNIJOLCZwYmqE 9Ro60UPA4Q5SjdcEespq+PeN7vEeVjWKCFhvWWfrYwSSr9tmUpz4EbhO5lFeY4FYxkHVRCfl NfzEbdB8Z4TxakZcCRbP4ExBK26A5mt1RB2xFEp+rae92meal+Q+odWdlkDnZc/MpSC2CPDg 0lNWLWyBc035tKr94EWDY3ZXf3BlpzNq4WcCpyvLefWQScCcOzSbCgLH3/entSDQ4sdQWrNW xcHwrMfOeDGI86BraL4X09Myq/IcrWItnEzRqWk91De5ZzHA5LivKiXILFfU96kjUNyaxmeS pRf+H2UlxE4WyQlKTKSsBMbK369RDDFKQmzkmvC4mN/I9Fd1TTWMVpMx9wEnEQWi99UavwwM 07GGROVIjJOAQOsXaDffc32j00YYjhyVTXFhpoRoWXGSDwRGv0j7uW1gv06MNMTLh2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Lcz02awy/Kft+/ PPpRwrZmOY8Eth91qex61BOX36QuMjVVSN2E453lodKM4JUTrl3Hnlgp2nXqTIf38eHSoAx2 reiB0+tVNy9tmD0lDvSfP9N44JB2Y0uN7dJt9cm47+oO3/0LibHVL7vSPIyBe2dOu4hUm81z zjKCj1IptuB6XvUPy2VATAgDAAA= X-CMS-MailID: 20200811085344eucas1p2301dcc589febbf13d1d3d72713e55404 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085344eucas1p2301dcc589febbf13d1d3d72713e55404 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085344eucas1p2301dcc589febbf13d1d3d72713e55404 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 22/24] examples/qos_sched: new link status print format X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: i.dyukov@samsung.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add usage of rte_eth_link_to_str function to example applications Signed-off-by: Ivan Dyukov --- examples/qos_sched/init.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 9626c15b8..99521bc4a 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -76,6 +76,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp) uint16_t rx_size; uint16_t tx_size; struct rte_eth_conf local_port_conf = port_conf; + char link_status_text[ETH_LINK_MAX_STR_LEN]; /* check if port already initialized (multistream configuration) */ if (app_inited_port_mask & (1u << portid)) @@ -160,14 +161,10 @@ app_init_port(uint16_t portid, struct rte_mempool *mp) "rte_eth_link_get: err=%d, port=%u: %s\n", ret, portid, rte_strerror(-ret)); - if (link.link_status) { - printf(" Link Up - speed %u Mbps - %s\n", - (uint32_t) link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - } else { - printf(" Link Down\n"); - } + rte_eth_link_to_str(link_status_text, sizeof(link_status_text), + NULL, &link); + printf("%s\n", link_status_text); + ret = rte_eth_promiscuous_enable(portid); if (ret != 0) rte_exit(EXIT_FAILURE, -- 2.17.1