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 E5CD4A00C5; Mon, 6 Jul 2020 22:38:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E4FCB1DD4D; Mon, 6 Jul 2020 22:38:06 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id B38CF1DD4D for ; Mon, 6 Jul 2020 22:38:05 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203805euoutp02ae694034166a5d9f698ca0384710b589~fREvPPgpq1760117601euoutp02U; Mon, 6 Jul 2020 20:38:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706203805euoutp02ae694034166a5d9f698ca0384710b589~fREvPPgpq1760117601euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067885; bh=uryTUJWnZHC1KobIzwDiYco1DBs90ldLDdgUZPnDwJM=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=UNHArXEyxz9X1VxsexMxvzRSUP48tXhZSfOgBLgzt///WuseOd32BGf2ru5hXTqy/ sCruTI+2NS2aYt0BGYk0c0KX+KRPCqdcKMb+ot0XUwLEB+QL24pcZ8cCTWVLYOAbON FGH/yMVZUkhCrUaQGhWNLtCrFsZvowK6ziWAc85c= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203804eucas1p2b6597dd7bde6555a3d4c7637ca18b26f~fREuNUuwa2099120991eucas1p2o; Mon, 6 Jul 2020 20:38:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 40.C6.06318.CAB830F5; Mon, 6 Jul 2020 21:38:04 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706203803eucas1p26fa02f91c1c5f94b8ce724a75b341f31~fREs7J7e92121221212eucas1p20; Mon, 6 Jul 2020 20:38:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203803eusmtrp2d1375f922fcafabbc728621b35d70b43~fREs6Wwk20640206402eusmtrp2q; Mon, 6 Jul 2020 20:38:03 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-15-5f038baccfd0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 83.7E.06017.AAB830F5; Mon, 6 Jul 2020 21:38:02 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203801eusmtip116ff548553f824b861a12723b3d063c5~fRErIEsgk1500415004eusmtip1w; Mon, 6 Jul 2020 20:38:01 +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:37:18 +0300 Message-Id: <20200706203743.29416-5-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706203743.29416-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0xTZxjG853v9JxDtcuhmPAGF5Aum7JEHWMmr4aIF/44SxbHP0uWJYpV jngBJC143RKCg5HiUC5hEy0UqqviBWFAEYFhEYtUuQbBiIC4xekmCAoMKSDl1Oy/5/09z/s9 yZtPoNo8LkDYl5AkGxL0cTpOzVbfmW5ffSWTRn+WbfPFsnuFBIcHrBSH8h5zmPnqRwb7SiOw zn5OhTmDKQxm5YwxaL9o4vDfoVQWR8btDPbXu3gs6ErlcdzxjMef288SfOZ+QfGM5TXB9sIq FU7fquVw1F3CYtbbHoKnKlsIOk+OsZh3o4ZguknEV5dsPFr7A3F8qIVF18Pfebwy0Umx6t4s wWxnGcH76fOqTcHSW8sFlWSte85IucWdVLrzMJ+XTt4tZKTykRpGGm3o4aSsylIitQ5nUuny n/9xUerv1OExcty+Q7Jh7cad6r1pw+eZxPklR2wdj1UpZEYwER8BxC8ge66RmIha0IoXCcyn 5LPK8IbALXOa13lNYNRxinu/Mv5rrjdlI9DRPcIowwSB4hP9iylOXAWujMJFY5lYzoHd3ct4 DD9xK1iu/UU8mhU/hqa5UurRGnE9/O3OYpWKILh8vXGBC4KPuAHMzQEerBUDobfozeKbIHYI MGO5wCv5SLj9qIAq2g9eOCu9/EOYv1HEKPo4TFX08spyBoGBkjRvKAIq/2njPWVUDIGy2rUK 3gyDzadZDwbxA+h76evBdEHmVP9CFayBjHStktZB490uLwaYnVmqYAmemFKpcp56AtMtRexp ElTwf5eFkFLiLycb42NlY1iCfHiNUR9vTE6IXbP7YHwFWfirrjnnRA1pcO9yEFEguqWaIYFG a1X6Q8aj8Q4CAtUt02y579qh1cTojx6TDQejDclxstFBlguszl8TVvJ8u1aM1SfJB2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juzRrlx76YeX6up5lCUPPqqZPjmtmUZB7yGmNa4fe+KbfsTkvyO2cXE69ZV8Ck6gZCH V3+P3FFzWWyc3dIoLqnWrnN+znvywzB3s1dTXU77lmChwX99c3PZrq7Yop5CVRPltBvanIuM kXmdCkpMUquWkzpR/Rc2As6wBwMAAA== X-CMS-MailID: 20200706203803eucas1p26fa02f91c1c5f94b8ce724a75b341f31 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203803eucas1p26fa02f91c1c5f94b8ce724a75b341f31 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203803eucas1p26fa02f91c1c5f94b8ce724a75b341f31 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 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