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 007A3A00C5; Mon, 6 Jul 2020 22:27:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 908021DC74; Mon, 6 Jul 2020 22:26:55 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id B4A5B1DC8A for ; Mon, 6 Jul 2020 22:26:53 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202653euoutp015018deaf9c0f5b063c2d29c1530ae03c~fQ69Fi_KR3113131131euoutp01r; Mon, 6 Jul 2020 20:26:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706202653euoutp015018deaf9c0f5b063c2d29c1530ae03c~fQ69Fi_KR3113131131euoutp01r DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067213; bh=uryTUJWnZHC1KobIzwDiYco1DBs90ldLDdgUZPnDwJM=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=T517KIdYP3zyvYD108r7npDztvhHtwJQWLApyhD5Rd0euHZgkwUvgU2MM3wp+aJl9 iVeneAxD1je3lcMBPZLepUrmoiZ/fwve7XF/JTdeKr9QKlkXdVtemhrIxlz6wqYVkQ bhWd9kC/1Ruo4vhSbEVPMQTa0GCUuAmzPevK8yMg= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706202652eucas1p2d08b104fb82999813a52cc6f58c5f809~fQ68Kol250115501155eucas1p2h; Mon, 6 Jul 2020 20:26:52 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 51.96.06318.C09830F5; Mon, 6 Jul 2020 21:26:52 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706202650eucas1p129e158e9a86b26d047a592c32d019ab3~fQ66_tFiC0787207872eucas1p1V; Mon, 6 Jul 2020 20:26:50 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200706202650eusmtrp112d6002fc60cfe81ebfcd36c723fcaaf~fQ6694U3a2178321783eusmtrp1l; Mon, 6 Jul 2020 20:26:50 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-12-5f03890cf8ff Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 32.AF.06314.A09830F5; Mon, 6 Jul 2020 21:26:50 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202649eusmtip1eec2a40d04a2d7b6f6c7cb061f4602fe~fQ65NybE71500415004eusmtip1T; Mon, 6 Jul 2020 20:26:48 +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: Mon, 6 Jul 2020 23:25:54 +0300 Message-Id: <20200706202626.28628-5-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSaUwTaxSG881MZ4ZeqmPVeKLGpWoiJG7R5B6IUVxiJpq4/dBEI9xenYso raYVr8sfFG2gIAKiRtRaAYOihgpVFquBXmOBAiq5WI2ohKgNioDI0mpdaKfGf895z/ue8+Xk 42n1aXYin6TfJxn02mQNq2TuPPS3zInMoBPm59l4LGuyEOx8VURjR/5LFjP7jlH4rHQpOiov KDDvdSqF2XmfKKy8amaxu+Mogz39lRS233NzWNB6lMN+p5fDE4/OE/QG3tN4zvqZ4CPLbQX6 62pY7A0UMpj9pY3gSXs9QVfWJwbzq6sImswC9l0r4bCofQr2d9Qz6H5eweGNwSc03m76RjDX VUaw2fRDETdd/GK9ohCLHF2UeOryE1p8+PwMJ2Y1WCjxVk8VJfbeb2PFbHspERs7M2nx+hsf u165Rbl4h5SctF8yzFvyl3Ln8c5iau+PPw6UPH6pSCVfeTOJ4EFYBCbrWcpMlLxauErAPHIK uRgg0PD/EC0Xnwk8bfMyvyLDPY2s3CghUDHQF3YNEqjz3Ay5WGE2uNMtocHjhFssVAY8VLAx VlgBLzKPkSAzwiwocPSHAiohBjwZ/9Hyiqlw3VYb4gghFh70VrBBVgtTwHNpIDQUhMc8DHmb WTmwErrdNoXMY+G9y87JPBncp7LC7z4Mw+UeTg6nE3hVeDxsWgr2Dy0jzPO0EAVlNfNkeRlk ee1UUAZhFDz7OCYo0yOYd+csLcsqSDepZbcGahtawzLAt6+RsizCuxPt4fvcI/Dd52JzyNSC 37ushJSSCVKKUZcoGRfqpX/nGrU6Y4o+ce72PbpyMvJZ3d9dg1XkfuBvJxF4oolUdfB0glqh 3W88qHMS4GnNONXyZne8WrVDe/CQZNiTYEhJ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vso89nacik00SMIOQUgVLP/7CMbLLwvt7FCvJ4rc5w9ItVXbOVeb ui/dZ7QzerabT40hSiVm/iuu/XTbHikwNtPfZ1Xm2oVRj5dESwFxhXq7d6muq0y3ZvTYzbSV p1bP8lve46t4u2WBcW9QV27My5nyTYGO17ElKuqeXrGh/k5j4G4hadu8k8wO38gX2TeHCO2s N8FzazSUmGTgFpEW0fAHAhC1PQkDAAA= X-CMS-MailID: 20200706202650eucas1p129e158e9a86b26d047a592c32d019ab3 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202650eucas1p129e158e9a86b26d047a592c32d019ab3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202650eucas1p129e158e9a86b26d047a592c32d019ab3 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 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