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 7441F41C35; Wed, 8 Feb 2023 03:59:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 559B940DFD; Wed, 8 Feb 2023 03:59:33 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 87F3940DDB for ; Wed, 8 Feb 2023 03:59:31 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PBPmY538PzmW4r; Wed, 8 Feb 2023 10:57:17 +0800 (CST) Received: from [10.67.103.231] (10.67.103.231) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 8 Feb 2023 10:59:29 +0800 Message-ID: <530634d8-bb7e-17ae-7141-c95ada6a3d9b@huawei.com> Date: Wed, 8 Feb 2023 10:59:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v9 4/5] app/testpmd: report lcore usage To: Robin Jarry , CC: =?UTF-8?Q?Morten_Br=c3=b8rup?= , Konstantin Ananyev , Kevin Laatz , Aman Singh , Yuying Zhang References: <20221123102612.1688865-1-rjarry@redhat.com> <20230207193731.1242505-5-rjarry@redhat.com> From: "lihuisong (C)" In-Reply-To: <20230207193731.1242505-5-rjarry@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.231] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600004.china.huawei.com (7.193.23.242) 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 在 2023/2/8 3:37, Robin Jarry 写道: > The --record-core-cycles option already accounts for busy cycles. One > turn of packet_fwd_t is considered "busy" if there was at least one > received or transmitted packet. > > Rename core_cycles to busy_cycles in struct fwd_stream to make it more > explicit. Add total_cycles to struct fwd_lcore. Add cycles accounting in > noisy_vnf where it was missing. > > When --record-core-cycles is specified, register a callback with > rte_lcore_register_usage_cb() and update total_cycles every turn of > lcore loop based on a starting tsc value. > > In the callback, resolve the proper struct fwd_lcore based on lcore_id > and return the lcore total_cycles and the sum of busy_cycles of all its > 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 > --- ... > static inline void > diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c > index 021624952daa..c4e1c2aa2af1 100644 > --- a/app/test-pmd/txonly.c > +++ b/app/test-pmd/txonly.c > @@ -331,7 +331,7 @@ pkt_burst_transmit(struct fwd_stream *fs) > struct rte_mbuf *pkt; > struct rte_mempool *mbp; > struct rte_ether_hdr eth_hdr; > - uint16_t nb_tx; > + uint16_t nb_tx = 0; useless modify? > uint16_t nb_pkt; > uint16_t vlan_tci, vlan_tci_outer; > uint32_t retry;