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 92395A0526; Fri, 10 Jul 2020 09:03:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F264A1DBC7; Fri, 10 Jul 2020 09:02:50 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 4E97A1DB40 for ; Fri, 10 Jul 2020 09:02:49 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070248euoutp023e147084eac30cfc368a6cf58634bf72~gUiCxDwrA1730917309euoutp02U; Fri, 10 Jul 2020 07:02:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710070248euoutp023e147084eac30cfc368a6cf58634bf72~gUiCxDwrA1730917309euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364568; bh=uryTUJWnZHC1KobIzwDiYco1DBs90ldLDdgUZPnDwJM=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=XEu/KpiwLgt/SvvOwXu/Gi8aS/7OdstJo0u+otqEaYrwHGs6r8vhdCNENUEt7PvSr oMgoNwHGQ/fZj29BvYBOwSLOl+pRpgnmUabPNn26loogyEKh3waqXHU50lPI31Y0// lqyi4eTv4IQzqz5XdKnFUjhLHwYBOXWxkUwGZc/4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200710070248eucas1p283291e3436438d69a8c81d07d9f089fc~gUiCY5DJC1196011960eucas1p2K; Fri, 10 Jul 2020 07:02:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 90.3F.06456.792180F5; Fri, 10 Jul 2020 08:02:47 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200710070247eucas1p100e76f67d55a3ab78c21cd197937fed6~gUiCE1DCP2360423604eucas1p1U; Fri, 10 Jul 2020 07:02:47 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200710070247eusmtrp2a993d82a4e2681a35cd806d2ce5aa9d3~gUiCAlbb92959129591eusmtrp2x; Fri, 10 Jul 2020 07:02:47 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-d5-5f081297e96b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9E.F3.06017.792180F5; Fri, 10 Jul 2020 08:02:47 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070245eusmtip1772cbb96753bf05a0225a5543acb00d4~gUiARhAZu1592215922eusmtip1L; Fri, 10 Jul 2020 07:02:45 +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: Fri, 10 Jul 2020 10:02:02 +0300 Message-Id: <20200710070226.6045-5-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710070226.6045-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0xTZxjG851zes6ho+Z4cPONc6JdvCYqZi57Xcyclz+O/qPRzFuiUPUE LxRID+DcYkLMaFhliKgQFSpQEKkXRMo1KEgWQYsiTRCIoJU5DZRJKRCngJVyavzveX/P87xv 8uXjafEcO4s/FJsgm2INMXpWy1Tee/doabbIR0a4h1ZjaYuVYO8zG43usz0snvT+QWGnfQ3W VeVoMPN5MoXpmUMUVl2xsDjgPsHgG18Vhd23nRxecJ3g0Nf4msO/Wi8SfD3eT+P5vGGCrdYK Db67W8vi4HgBg+nv2wmecjQTbEobYvBsTTVBs0VAb0kxh7buOehzNzPo7Crn8NpoG40VLRME TzeVEnxo9mt+nie9zyvSSLa6Pko6k99GS/e6sjgp7b6VksreVFPS4J12Vkp32In0oPckLV19 +T+7Rbtbu/qAHHMoSTYt/ylKezClt5CK93/xa/HjHk0yGeMtJIQHYSWMFvUwFqLlReEKgZzC CU4dRghkWp20OgwT+OB5ST5Vmm2eYKWYgC+nSKMOowS81x2aQIoVFoEz1UoFjBlCGQtV4x1U wAgT1kOW5y4d0IwwHxq6nkyt1QkIf3Znc+qJcLh6s2EqEyKsghRLwRQXhTnQcWlkaikILTyY +4cYtbABPGe8wXIY9Dc5gno2+GsuUar+Hd7e6uDUciqBZwUpwdAacHgeTWqep4XFUFq7XMVr oS7NyQYwCNOg87/pAUxPyszKbFrFOkg1i2paDw33XUEMMDEWqmIJJm5mBR+rjkBubT2dQcIv fL6VR4idzJQTFWO0rKyIlY8uUwxGJTE2etn+OOMtMvlZnR+afNVk1LWvkQg80Yfqqv1spKgx JCnHjI0EeFo/Q7fuoXOvqDtgOPabbIqLNCXGyEoj+Zpn9DN13xX07RGFaEO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sKIsGVPd3yW PuSzB7//yamN2fv1h2Mc2pGGCscR4bliUhvgutccynWfvGLvihh2io3LKEuo47YnB/q1Xb37 8L2iMz/SNV8Yuc0QLzUhyn33iaDM2Kgvh6oSWrSVT700zkleq8LIlK1ehsR2p+zquMRbkxGf TqsoKVxQbyaNkvAPw5zG+QkDAAA= X-CMS-MailID: 20200710070247eucas1p100e76f67d55a3ab78c21cd197937fed6 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070247eucas1p100e76f67d55a3ab78c21cd197937fed6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070247eucas1p100e76f67d55a3ab78c21cd197937fed6 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 04/25] 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_strf function to example applications Signed-off-by: Ivan Dyukov --- doc/guides/sample_app_ug/link_status_intr.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 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..596782b9d 100644 --- a/doc/guides/sample_app_ug/link_status_intr.rst +++ b/doc/guides/sample_app_ug/link_status_intr.rst @@ -158,6 +158,7 @@ An example callback function that has been written as indicated below. { struct rte_eth_link link; int ret; + char link_status[200]; RTE_SET_USED(param); @@ -169,11 +170,10 @@ An example callback function that has been written as indicated below. if (ret < 0) { 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")); - } else - printf("Port %d Link Down\n\n", port_id); + } else { + rte_eth_link_strf(link_status, 200, NULL, &link); + printf("Port %d %s\n\n", port_id, link_status); + } } This function is called when a link status interrupt is present for the right port. -- 2.17.1