From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6A0CC636D3 for ; Mon, 6 Feb 2023 15:06:42 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F095642D12; Mon, 6 Feb 2023 16:06:41 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id DD32840FAE for ; Mon, 6 Feb 2023 16:06:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675696000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XOFHmYznBDN7boZrWlVJq2KcqWwFaQQVnpOyGO598VU=; b=Q1n61hG4ym8ahmd+X1RBFTNmSLpAIDGC9NSMkvn+Qp3KMPk48JU9emjQZpuxesKkPB46vb WjjCDFU5tvboIeeg7YBu53jl9FnQz9DmklkEEul48166Pj/Ddj/zCdPZZ3RietFY5V0ENZ cNzSlcLL1mq7DnmR/WrVWj+hshy2NEo= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-584-CovCRGOwN2GYuBhx7QXbgg-1; Mon, 06 Feb 2023 10:06:38 -0500 X-MC-Unique: CovCRGOwN2GYuBhx7QXbgg-1 Received: by mail-pf1-f200.google.com with SMTP id k14-20020aa7972e000000b00593a8232ac3so6634434pfg.22 for ; Mon, 06 Feb 2023 07:06:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XOFHmYznBDN7boZrWlVJq2KcqWwFaQQVnpOyGO598VU=; b=phoCWUishE3zb7e+qjLdHH7ci3Q5w+jZI2W6E5wntC6/gQSn0V/PlPkSBXymYdw5XW ZoFICSeL3ujf8gl+lqh9oPfMZWZ+X/+v5Fw7ps6Bk84MQqcuU8LmubWF/3cSl7bKtD26 34u6dycBoR72/R1uUpRFHR5fk0mAbSOGU9PS1/wfs0etzagUayMoEbmmkh8wVkjvSGYf coDyI3AUjhX6upHGt8lYwJ9KVgURorA3dmMztHOKIMh3tV4gbzufkl85dEmgUz/kw3PL yKsPBXKNOcfnXH+G2utGwQeFVD9HSKi1Q8p6xZ2yzPNxoO0W2YCtwvGrGD9zNip0Rr9C p5KA== X-Gm-Message-State: AO0yUKW+3JbUlnzn4FANW72z2yXJz5KiIowhBCo5FdvIqGggWQsaUAeV wlkhP+Mty7vHz8Q0x4YkNhoYLYGxnenQOeAUfTy0sHfP3ELSGQ5DcM4aAeEmri/O5gJ5LSRWYIs XC+IVOF5nDuDNbAEG4bU= X-Received: by 2002:a17:90b:e17:b0:230:36c1:fde6 with SMTP id ge23-20020a17090b0e1700b0023036c1fde6mr3307093pjb.83.1675695996802; Mon, 06 Feb 2023 07:06:36 -0800 (PST) X-Google-Smtp-Source: AK7set9waaEzMV/XH47SkmjDncgCmT598oCI1KYWtdEWv7tSrw5Lk6J7W1xR1CPMz+eDsqaGrNXlxL7jgAiwRIAzo5g= X-Received: by 2002:a17:90b:e17:b0:230:36c1:fde6 with SMTP id ge23-20020a17090b0e1700b0023036c1fde6mr3307090pjb.83.1675695996504; Mon, 06 Feb 2023 07:06:36 -0800 (PST) MIME-Version: 1.0 References: <20221123102612.1688865-1-rjarry@redhat.com> <20230202134329.539625-1-rjarry@redhat.com> <20230202134329.539625-5-rjarry@redhat.com> In-Reply-To: From: David Marchand Date: Mon, 6 Feb 2023 16:06:25 +0100 Message-ID: Subject: Re: [PATCH v8 4/5] app/testpmd: report lcore usage To: Robin Jarry , Aman Singh , Yuying Zhang Cc: dev@dpdk.org, =?UTF-8?Q?Morten_Br=C3=B8rup?= , Konstantin Ananyev , Kevin Laatz X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 On Mon, Feb 6, 2023 at 10:08 AM Robin Jarry wrote: > > David Marchand, Feb 06, 2023 at 09:58: > > I have been playing a bit with this series with two lcores, each one > > polling a net/null port. > > At first it looked good, but then I started to have one idle lcore, by > > asking net/null not to receive anything. > > > > $ build-clang/app/dpdk-testpmd -c 7 --no-huge -m 40 -a 0:0.0 --vdev > > net_null1,no-rx=1 --vdev net_null2 -- --no-mlockall > > --total-num-mbufs=2048 -ia --record-core-cycles --nb-cores=2 > > > > One thing that struck me is that an idle lcore was always showing less > > "total_cycles" than a busy one. > > The more time testpmd was running, the bigger the divergence between > > lcores would be. > > > > Re-reading the API, it is unclear to me (which is the reason for my > > comments on patch 2). > > Let's first sort out my patch 2 comments and we may revisit this patch > > 4 implementation afterwards (as I think we are not accounting some > > mainloop cycles with current implementation). > > Indeed, we are not accounting for all cycles. Only the cycles spent in > the packet_fwd_t functions. This was already the case before my series > I only added the busy cycles accounting. "busy" cycles is what was already present in testpmd under the core_cycles report existing feature: get_end_cycles was only called with nb_rx + nb_tx > 0. The only change with this patch is its internal name, there is no addition on this topic. But this patch adds "total_cycles" for testpmd... > > > However, I agree that this should be updated to take all cycles into > account (as much as it is possible with the current code base). Maybe > this could be done as a separate patch or do you want to include it in > this series? ... and its implementation seems non compliant with the lcore_usage API as discussed in patch 2. As for how much cycles are counted as busy (meaning, should we count cycles spent in the mainloop too), I think it is better but that would be a change in the core_cycles report existing feature. I'd really like to hear from testpmd maintainers. -- David Marchand