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 64CF8A04A4; Tue, 26 May 2020 21:11:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D07C1D8FC; Tue, 26 May 2020 21:10:59 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 45F241D670 for ; Tue, 26 May 2020 21:10:56 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200526191056euoutp029828936fc24622e5b6ef707a22b52e4f~Sqb8EfC6R1916119161euoutp02T for ; Tue, 26 May 2020 19:10:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200526191056euoutp029828936fc24622e5b6ef707a22b52e4f~Sqb8EfC6R1916119161euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590520256; bh=ZipdGY2cAx7vDrJLPB9oB2xWunr5C/DPzf/7eMfNA2U=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=GZ/tfuomG6EUMrl1xvjDIj1UFhWJTnYwGEjfLZVyMO1J5OMnCDca1m03gPTUCSoJ3 q347+WHKQkSpi+y599QwgALWfBSPyL1PIZcRQRQh3HG+zj80nmDyQQimrmeLh4n7yl KTBMg3B27IA0OSMs4N6YfqLAOP/MY5TNnKkILASA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200526191055eucas1p2698fc4d6d511850d3d5734c02a523b98~Sqb7ToukU0385303853eucas1p2O; Tue, 26 May 2020 19:10:55 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 05.B3.61286.FB96DCE5; Tue, 26 May 2020 20:10:55 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200526191054eucas1p27defd4f1d656f07f1d9d5a95be369de9~Sqb6e_6Ln0765607656eucas1p2R; Tue, 26 May 2020 19:10:54 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200526191054eusmtrp2fb13d6402f12112aeac9bb5c43db305a~Sqb6eYzPk0898208982eusmtrp2-; Tue, 26 May 2020 19:10:54 +0000 (GMT) X-AuditID: cbfec7f2-f0bff7000001ef66-e1-5ecd69bf28b1 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 92.F4.08375.EB96DCE5; Tue, 26 May 2020 20:10:54 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200526191053eusmtip120e26ab967e137c5d3825dc9492a1f7a~Sqb5r_1Cz1925319253eusmtip1t; Tue, 26 May 2020 19:10:53 +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 Date: Tue, 26 May 2020 22:10:07 +0300 Message-Id: <20200526191033.16459-5-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200526191033.16459-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBKsWRmVeSWpSXmKPExsWy7djPc7r7M8/GGcx/L2nxYMpdNovuDy1M FttXdLFZvPu0ncnizt7T7BazLjWxWzz/84rZYsrOHYwWnx6cYL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FUhI7+4xFYp2tDC SM/Q0kLPyMRSz9DYPNbKyFRJ384mJTUnsyy1SN8uQS+jddMKxoL1PBUnXx9mb2Dcw9nFyMkh IWAi8XLVa9YuRi4OIYGljBLz3v1i7mLkAEpISLx+wgxRIyzx51oXG0TNZ0aJ1iPdTCAJNgEN idMd85hAEiICS5gk9q46xwiSEBZwlHj/cyZYN4uAqsSDhlNsIDavgKXEvbk/2SGmykus3nAA rIZTwErizZflLCC2kECmxPo789kgbDmJ6/O/ME1g5FvAyLCKUSS1tDg3PbfYUK84Mbe4NC9d Lzk/dxMjMOS3Hfu5eQfjpY3BhxgFOBiVeHgTfp+JE2JNLCuuzD3EKMHBrCTC63T2dJwQb0pi ZVVqUX58UWlOavEhRlOgAycyS4km5wPjMa8k3tDU0NzC0tDc2NzYzEJJnLdD4GCMkEB6Yklq dmpqQWoRTB8TB6dUA6NixqX9vVuucssf1e7lcjtrenCfms9OW/my/80x0kH88ikXZ9wouMwS Z6yyNbjG46vChc2fY5ibD30506GirJMhw+R7w9c/6uGUnY9K59zYO4OJIVFVYL0bt9/fkuQe y2nX5+2RYbr9P7Xh02y3jUbFJ1ZZ8c19xr0nXmatg/KfTrf/AdOSgpVYijMSDbWYi4oTAWFS /a6PAgAA X-CMS-MailID: 20200526191054eucas1p27defd4f1d656f07f1d9d5a95be369de9 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200526191054eucas1p27defd4f1d656f07f1d9d5a95be369de9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200526191054eucas1p27defd4f1d656f07f1d9d5a95be369de9 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200526191033.16459-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v2 4/7] doc: update sample app with unknown speed 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_prepare_text function to example applications Signed-off-by: Ivan Dyukov --- doc/guides/sample_app_ug/link_status_intr.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst index 04c40f285..bdefcd17b 100644 --- a/doc/guides/sample_app_ug/link_status_intr.rst +++ b/doc/guides/sample_app_ug/link_status_intr.rst @@ -157,6 +157,7 @@ An example callback function that has been written as indicated below. lsi_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param) { struct rte_eth_link link; + struct rte_eth_link_text link_text; int ret; RTE_SET_USED(param); @@ -170,8 +171,9 @@ An example callback function that has been written as indicated below. printf("Failed to get port %d link status: %s\n\n", port_id, rte_strerror(-ret)); } else if (link.link_status) { - printf("Port %d Link Up - speed %u Mbps - %s\n\n", port_id, (unsigned)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex")); + rte_eth_link_prepare_text(&link), ETH_SPEED_UNIT_MBPS, &link_text); + printf("Port %d Link Up - speed %s Mbps - %s\n\n", port_id, link_text.link_speed, + link_text.link_duplex); } else printf("Port %d Link Down\n\n", port_id); } -- 2.17.1