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 18002A0093; Mon, 15 Jun 2020 11:02:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 88D3B100C; Mon, 15 Jun 2020 11:02:17 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 165D35F69 for ; Mon, 15 Jun 2020 11:02:16 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200615090215euoutp0233bb465d7927c69ed9ba770c38ef67a0~YrCM6dpTE3224032240euoutp02e for ; Mon, 15 Jun 2020 09:02:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200615090215euoutp0233bb465d7927c69ed9ba770c38ef67a0~YrCM6dpTE3224032240euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592211735; bh=A6zgX5YAfMFydedCCJ/j1XKLfexQTiX5nuYt4o3aWGo=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=IMhe/qbQGkxtsHuGrnQrQ32EnI7/3PJwDCEOamSp9XDbvu8319VqUYcy2BZqdwJ0G O5S4e0zMEFUDoMLnp7vvY4ZQ0qOMugcXFMCdGwbV+/QXlrm3mzObFKRDn9w4NtzIzg MLhVKPVhvN8XFoNazbVJPJkUDkRehvJpRnjCK8Mo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200615090215eucas1p13049cdbc360c516825e528268d72e14b~YrCMqa4Zn0033700337eucas1p1D; Mon, 15 Jun 2020 09:02:15 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F0.0F.61286.71937EE5; Mon, 15 Jun 2020 10:02:15 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200615090214eucas1p21d345bc83cb8b8403c54958b0e7f6462~YrCMXdVif0461704617eucas1p2_; Mon, 15 Jun 2020 09:02:14 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200615090214eusmtrp14f2424bf7f1e5037ad302033423aa739~YrCMWkPnD1019610196eusmtrp1P; Mon, 15 Jun 2020 09:02:14 +0000 (GMT) X-AuditID: cbfec7f2-f0bff7000001ef66-aa-5ee73917c7d1 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A2.D3.07950.61937EE5; Mon, 15 Jun 2020 10:02:14 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200615090214eusmtip1741cfbeafd99a5ae15f0554eca14c18f~YrCLlrdG50240902409eusmtip1L; Mon, 15 Jun 2020 09:02:14 +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: Mon, 15 Jun 2020 12:01:52 +0300 Message-Id: <20200615090158.18912-5-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200615090158.18912-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsWy7djPc7rils/jDA4c5rV4MOUum0X3hxYm i+0rutgs3n3azmRxZ+9pdotZl5rYLZ7/ecVsMWXn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rMpyi8tSVXIyC8usVWKNrQw 0jO0tNAzMrHUMzQ2j7UyMlXSt7NJSc3JLEst0rdL0Mv4+eYOS8E77oquFfUNjK84uhg5OSQE TCRefjrJBGILCSxllJg4ObqLkQMoLiHx+gkzRImwxJ9rXWxdjFxAJZ8ZJSZ9ecEIkmAT0JA4 3TGPCSQhIrCESWLvqnNgCWEBR4nvS76CDWURUJVY1nECbBKvgKXEvdM72CCmykus3nAALM4p YCVx8eAMdogjMiVezb/DCmHLSVyf/4VpAiPfAkaGVYwiqaXFuem5xUZ6xYm5xaV56XrJ+bmb GIHhvu3Yzy07GLveBR9iFOBgVOLhtQh9FifEmlhWXJl7iFGCg1lJhNfp7Ok4Id6UxMqq1KL8 +KLSnNTiQ4ymQAdOZJYSTc4HxmJeSbyhqaG5haWhubG5sZmFkjhvh8DBGCGB9MSS1OzU1ILU Ipg+Jg5OqQZGjhUHO9be/rZ9qcJihbOPTy/U314/J08tVkH638qNbPY3Qn8JfOA5mxtTxtdq JluaJfCuzel4xYkU7eo25of93ZcLBabdnq61cvsx+ZqXPx+L79muCIz8zgSOjz86wybtNIhh mxDqP+Vwd8G+nHsXpMW3Pb/nJLXJ/Y9z/WyX1udp/7SC/SSVWIozEg21mIuKEwFGZsy8jQIA AA== X-CMS-MailID: 20200615090214eucas1p21d345bc83cb8b8403c54958b0e7f6462 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200615090214eucas1p21d345bc83cb8b8403c54958b0e7f6462 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200615090214eucas1p21d345bc83cb8b8403c54958b0e7f6462 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200615090158.18912-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v3 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_format 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..d1ac35be8 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 text[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_format(text, 200, NULL, &link); + printf("Port %d %s\n\n", port_id, text); + } } This function is called when a link status interrupt is present for the right port. -- 2.17.1