From patchwork Wed Aug 17 07:10:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng Li X-Patchwork-Id: 1667104 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M6zhg5svfz1yYg for ; Wed, 17 Aug 2022 17:11:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BFF1140CF2; Wed, 17 Aug 2022 07:11:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BFF1140CF2 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id auMyUi6LcOk3; Wed, 17 Aug 2022 07:11:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id DFA904017A; Wed, 17 Aug 2022 07:11:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org DFA904017A Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B480BC0033; Wed, 17 Aug 2022 07:11:27 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 39197C002D for ; Wed, 17 Aug 2022 07:11:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F32304033D for ; Wed, 17 Aug 2022 07:11:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org F32304033D X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9tqxWYZy1Eqv for ; Wed, 17 Aug 2022 07:11:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 98C0640296 Received: from chinatelecom.cn (prt-mail.chinatelecom.cn [42.123.76.227]) by smtp4.osuosl.org (Postfix) with ESMTP id 98C0640296 for ; Wed, 17 Aug 2022 07:11:23 +0000 (UTC) HMM_SOURCE_IP: 172.18.0.48:37016.804598716 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-36.111.64.85 (unknown [172.18.0.48]) by chinatelecom.cn (HERMES) with SMTP id BE675280099; Wed, 17 Aug 2022 15:11:13 +0800 (CST) X-189-SAVE-TO-SEND: +lic121@chinatelecom.cn Received: from ([172.18.0.48]) by app0024 with ESMTP id 80c7b3e889804a799702e084ad2da5d7 for dev@openvswitch.org; Wed, 17 Aug 2022 15:11:14 CST X-Transaction-ID: 80c7b3e889804a799702e084ad2da5d7 X-Real-From: lic121@chinatelecom.cn X-Receive-IP: 172.18.0.48 X-MEDUSA-Status: 0 From: lic121 To: dev@openvswitch.org Date: Wed, 17 Aug 2022 07:10:55 +0000 Message-Id: <1660720255-25371-1-git-send-email-lic121@chinatelecom.cn> X-Mailer: git-send-email 1.8.3.1 Subject: [ovs-dev] [PATCH] dpif-netdev: not skip cycle metric for no-packet rxqs X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" In PMD, cycle cost for each rxq is saved so that we know each rxq's load. But rxq that doesn't receive a packet is skipped. In fact, polling no-packet rxq costs cycles as well. In my test, 100w pps rxq(vhostuser) cost cycles 87,553,850,086 while no-packet rxq costs cycles 353,402,306. In asign mode "group", ovs always pick the lowest load pmd. If we have too many(let's say 100) no-packet rxqs, these rxqs will be asigned to the same pmd. Because no load increase when a no-packet rxq to pmd. To avoid this, this patch count cycles for no-packet rxq as well. Signed-off-by: lic121 --- lib/dpif-netdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index a45b460..b30a098 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -5335,8 +5335,8 @@ dp_netdev_process_rxq_port(struct dp_netdev_pmd_thread *pmd, dp_netdev_pmd_flush_output_packets(pmd, false); } else { - /* Discard cycles. */ - cycle_timer_stop(&pmd->perf_stats, &timer); + cycles = cycle_timer_stop(&pmd->perf_stats, &timer); + dp_netdev_rxq_add_cycles(rxq, RXQ_CYCLES_PROC_CURR, cycles); if (error != EAGAIN && error != EOPNOTSUPP) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);