From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2246B41BE4; Mon, 6 Feb 2023 04:31:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A482840A7D; Mon, 6 Feb 2023 04:31:20 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 21255406A2 for ; Mon, 6 Feb 2023 04:31:19 +0100 (CET) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4P9BcP2S84zfYxw for ; Mon, 6 Feb 2023 11:31:01 +0800 (CST) Received: from [10.67.100.224] (10.67.100.224) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 6 Feb 2023 11:31:16 +0800 Subject: Re: [PATCH v8 4/5] app/testpmd: report lcore usage To: References: <20221123102612.1688865-1-rjarry@redhat.com> <20230202134329.539625-1-rjarry@redhat.com> <20230202134329.539625-5-rjarry@redhat.com> From: fengchengwen Message-ID: <5fc46aca-9912-9493-0527-0dd45c2d6010@huawei.com> Date: Mon, 6 Feb 2023 11:31:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20230202134329.539625-5-rjarry@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Suggest add field "busy ratio" to reduce hand-computing and improve readability. With above add, Acked-by: Chengwen Feng On 2023/2/2 21:43, Robin Jarry wrote: > Reuse the --record-core-cycles option to account for busy cycles. One > turn of packet_fwd_t is considered "busy" if there was at least one > received or transmitted packet. > > Add a new busy_cycles field in struct fwd_stream. Update get_end_cycles > to accept an additional argument for the number of processed packets. > Update fwd_stream.busy_cycles when the number of packets is greater than > zero. > > When --record-core-cycles is specified, register a callback with > rte_lcore_register_usage_cb(). In the callback, use the new lcore_id > field in struct fwd_lcore to identify the correct index in fwd_lcores > and return the sum of busy/total cycles of all fwd_streams. > > This makes the cycles counters available in rte_lcore_dump() and the > lcore telemetry API: > > testpmd> dump_lcores > lcore 3, socket 0, role RTE, cpuset 3 > lcore 4, socket 0, role RTE, cpuset 4, busy cycles 1228584096/9239923140 > lcore 5, socket 0, role RTE, cpuset 5, busy cycles 1255661768/9218141538 > > --> /eal/lcore/info,4 > { > "/eal/lcore/info": { > "lcore_id": 4, > "socket": 0, > "role": "RTE", > "cpuset": [ > 4 > ], > "busy_cycles": 10623340318, > "total_cycles": 55331167354 > } > } > > Signed-off-by: Robin Jarry > Acked-by: Morten Brørup > Acked-by: Konstantin Ananyev > Reviewed-by: Kevin Laatz > --- > ...