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 BDCCAA04C7; Tue, 15 Sep 2020 21:11:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 084041C1EB; Tue, 15 Sep 2020 21:08:44 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 7E0611C1EB for ; Tue, 15 Sep 2020 21:08:42 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190842euoutp01227f17729b5ba1e81c5c75336a5c9b4b~1Cp9lYPT40516505165euoutp01n; Tue, 15 Sep 2020 19:08:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200915190842euoutp01227f17729b5ba1e81c5c75336a5c9b4b~1Cp9lYPT40516505165euoutp01n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196922; bh=qVSmYkun2k36EKGsPQLrlSwrALp4hWMj7WN7omI+2SA=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=keX3Kc1QUvxiyw2T6vPE/SwNFwo1VsNcfa6dvL3/eWHfzkZ0AdEZ0SHs2xXl5+VK1 EvATQ2773ypKZrMyYpZi+MYr8XAiw81Axs1z1RXi7qYR6XJzE81R1UACHgoDeBiVM8 Bmw7r3+3ln1cV6RTiGJzJw5oD7l0LEEuXvc5hi18= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200915190842eucas1p172f9261cd09cc1f06745cea8ec256611~1Cp9aknRC0047600476eucas1p1l; Tue, 15 Sep 2020 19:08:42 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F5.63.06456.A31116F5; Tue, 15 Sep 2020 20:08:42 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200915190841eucas1p20ca62d955effb1ca2b22aea6b7170e2e~1Cp85i86V1274512745eucas1p2K; Tue, 15 Sep 2020 19:08:41 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190841eusmtrp1bb09a4b737b7a123df05f6633cde5af4~1Cp84xd7J3148631486eusmtrp1u; Tue, 15 Sep 2020 19:08:41 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-96-5f61113a5ef3 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 04.FB.06017.931116F5; Tue, 15 Sep 2020 20:08:41 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190839eusmtip2681b181fa67182b4b4f79058faef9c07~1Cp7KbkBn1712317123eusmtip2P; Tue, 15 Sep 2020 19:08:39 +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, 15 Sep 2020 22:07:17 +0300 Message-Id: <20200915190728.18143-23-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915190728.18143-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSb0xTZxTGc+69vffS0OVSSDxxRLJmWzaNqBnJTro5558sd9uXfTMxGVDH HSAUTStumJggOmRYGCDTrCzIIEgtWzqlpUBkYahFrMBgMnAiIgwJCIJAI2gda7mYfXue33me 97x584qsvpxfL6ZnHVYsWaZMA6/lGn3LPZuNUaakrSVDHLluVQKNDtewNFJ+j6fTcycZGnTu oCveHzVUdj+XoeKyJwx5HYU8TY/kcfR43svQUKtfIHtfnkDz7RMCFfVUAE0Ep1j6oWoBqKfS o6Hl31t4mg1Wc1T8rB/oO/cNoA7bE47Km5uA8gslmrtYJ1DN0AaaH7nBkf9Og0A/B3pZ8tx6 AVTa4QLqyl/RfPia/KyqViPXXJlk5DM/9bKy785ZQbZ1VjLypcdNjDz7Wz8vF7udIN8cPc3K 9f8s8Z9p92nfT1Ey048oli0fJGvT6gIeOPSn9mu37yGTC3NiIUSIKCVgwcIYXwhaUS85ALuv rTCqWQS8PTAoqGYB8NunA/Cy0vp0HNRBHWBgeHqtEgiZldtMOMVLb6G/oHJ1ECNd4tEbHAgZ UYyWPsWxUmM4w0lv4Nlg3irWSUbs7E5XF8Rh/a9tbFhHhHBfc78Q1nppAw6cX1w9EqU/RLQ7 znNqYQ/WOpvWbheNUx1uQdWx6D9j49TCKcDSxgZBNSWAJypm1lI70P2oWwjfgpXeRlfLFhXv xFNLC3wYo/QKDs5EhTEbkmWN51gV67AgX6+mDdjW2beGEV88j1SxjL0NLlZ9nlbAtvrLTAnE 2f/fVQXghHVKttWcqli3ZSlfxVtNZmt2Vmr8FwfNlyH0V/3/dsw3QaBvfztIIhgidVV3k5P0 GtMRa465HVBkDTG6XV3+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9En KkIVYRCuCAsJC1kHMl/JSbZ5t5RNUen5/Tyfwev+5wjGwz8L5fwa2mR91RtAP7pYE7XnyCn/ uHN4QfcOFPQyamfZ8FgGv+Ty0e0mp0Wzcdmo4GXpjluxondb6fwNvn6Pvf2S95X4dgYesG3F P+Nl5uUfWlqC7dPnUeZK+5LBhNbHQZGnHk0MeBzJ/51gp9tsMcElW8q9YpVmr5W1zp7Ypqr0 um91MkpIVSmWkzpB9RfiVBHbBwMAAA== X-CMS-MailID: 20200915190841eucas1p20ca62d955effb1ca2b22aea6b7170e2e X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190841eucas1p20ca62d955effb1ca2b22aea6b7170e2e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190841eucas1p20ca62d955effb1ca2b22aea6b7170e2e References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 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 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 9626c15b8..06328ddb2 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[RTE_ETH_LINK_MAX_STR_LEN]; /* check if port already initialized (multistream configuration) */ if (app_inited_port_mask & (1u << portid)) @@ -160,14 +161,9 @@ 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), &link); + printf("%s\n", link_status_text); + ret = rte_eth_promiscuous_enable(portid); if (ret != 0) rte_exit(EXIT_FAILURE, -- 2.17.1