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 A7752A0528; Sat, 11 Jul 2020 12:48:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 240F31DA99; Sat, 11 Jul 2020 12:45:33 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 3EB221DB47 for ; Sat, 11 Jul 2020 12:45:31 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104531euoutp025f561fb2a66fe188f2495a702f2c1301~grNx6qyo41781617816euoutp02d; Sat, 11 Jul 2020 10:45:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200711104531euoutp025f561fb2a66fe188f2495a702f2c1301~grNx6qyo41781617816euoutp02d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464331; bh=vt5/65wO/zNN0SJP1aLH1ptRLWzuOqXtrZ48Ij7JIF8=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=cDs+5119QFeNg7IcSy5z9tffgNmD+EQEkdMoSAxl5CuzuRYCR4JP7mQ7YENPFGK4U +ww0j0fEr96Lwa4OHzn6PVj1AzHIcNqf6YlojMBPxfoaf0DG8qBfgOA7TTEmLCRoiP b0DgyFvWSCnsam7lVw6AuyqkDbI22Zn6YgdHZY3U= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200711104530eucas1p20bede2f3a5375bb4f15bf0f57fed5682~grNxINv8z2330823308eucas1p2j; Sat, 11 Jul 2020 10:45:30 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 69.2F.05997.A48990F5; Sat, 11 Jul 2020 11:45:30 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200711104529eucas1p26b12b796729eb0b94a42ac78c247bbaf~grNwot6_p2338123381eucas1p2q; Sat, 11 Jul 2020 10:45:29 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200711104529eusmtrp19de620884b965ae016965689f0008104~grNwn4uY52954729547eusmtrp1I; Sat, 11 Jul 2020 10:45:29 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-7a-5f09984aa937 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 46.96.06017.948990F5; Sat, 11 Jul 2020 11:45:29 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104527eusmtip16e7a024360338dbb1a5f4ef2be071297~grNu2iHFh0946309463eusmtip1-; Sat, 11 Jul 2020 10:45:27 +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: Sat, 11 Jul 2020 13:44:10 +0300 Message-Id: <20200711104414.15422-24-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0xTZxjG/c45PedQrTtWFt+ogdnF3RJ1m5q9LkSHl+zEmGhiYnbRsU5P isrF9IiKOiUqpBREBLxQtVbIhoNqBQtlBMTVaHVFUYMp9YKNMXFqBQqoqBRHe2r873l+3/N8 75svH09ry9iJ/NqMjZIxQ5+mY9VMw6VX7dMWH45L+bK2XIWONivBB12VNAbK7rFY0LuHws7q edjsOqrCkvs5FBaVhCh0nTSzGAzsYrC7z0Xh3RYvh5abuzjscz/icG/7EYKPhp7QWG7rJ9hu rVfhq3+aWOwZqmCw6PUtgvuclwl6CkMMlv3dSDDPLGDvX1UcVt5NwL7AZQa9/rMc2p/foLG+ LUxwv8dB8GreW9V3U8TXtj9UYmXzY0osPXGDFi/5D3Ji4RUrJdZ2N1Jiz7lbrFjkrCbivw8K aLHm4SC7TP2TOmmNlLZ2k2ScMfdXdWrLn2/YDfmjt1RdzOdyyEPeTOJ4EGaB6Wg9ZyZqXiuc JHCk2UMUM0DgtC1AKaafwICvnH5XCZw5FktVEfDc9sfMcwINjv9UkRQrfAZekzVajxdqWXAN +UYMz48XlsDp/GWRDCNMhY7DFjaiNcK30OQvJcqERKg5cz46LW6Eh3uuR7VWSADf8YHonSB0 8GDvLYkVFsKp5kMxPR6eeJycoieDt7SQUfQ2eFnn45SyiUBXRW4sNA+cT69xkeVo4XNwNM1Q cDL4Td3RnUEYC53PxkUwPSJLGg7RCtaAKU+rpHVw/srNGAYIvxmjYBE6nMOx520hMBgOMsUk 0fJ+lo2QajJBypLTDZL8dYa0ebqsT5ezMgzTV2em15GRv+od9gw0kqah39xE4IlujMam51O0 Kv0mOTvdTYCndfGa+Ve9v2g1a/TZWyVjZooxK02S3WQSz+g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pqQWoRTB8TB6dUA6Pyhe+sbVz7Z576nl7kttYpZctXW2PW rJPJEiu0DTkFZa1DL+6/dXGff15Yb4xb/tEfkgFuYs1VR3m/vd/4OHv5pVrFpdNWxAk+ubl2 l9+OdwZPN61VjIp5OW9HVeyUQ88PR4Y13UrLkrnCxOIqKahQIKgqqMXX+oBHzLHmznFzpk1n zI8v26XEUpyRaKjFXFScCACVcH2SCAMAAA== X-CMS-MailID: 20200711104529eucas1p26b12b796729eb0b94a42ac78c247bbaf X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104529eucas1p26b12b796729eb0b94a42ac78c247bbaf X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104529eucas1p26b12b796729eb0b94a42ac78c247bbaf References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 23/24] examples/server_nod*: 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/server_node_efd/server/init.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c index 378a74fa5..b62ddf68b 100644 --- a/examples/server_node_efd/server/init.c +++ b/examples/server_node_efd/server/init.c @@ -247,6 +247,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret; + char link_status_text[60]; printf("\nChecking link status"); fflush(stdout); @@ -266,16 +267,10 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf( - "Port%d Link Up. Speed %u Mbps - %s\n", - info->id[portid], - link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - info->id[portid]); + rte_eth_link_to_str(link_status_text, 60, NULL, + &link); + printf("Port %d %s", info->id[portid], + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1