From patchwork Tue Jan 10 13:47:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Traynor X-Patchwork-Id: 1724084 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::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a/TRB8ui; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4NrsZH223yz23g8 for ; Wed, 11 Jan 2023 00:47:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 98B204176D; Tue, 10 Jan 2023 13:47:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 98B204176D Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a/TRB8ui 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 WNG8WuwmUB-9; Tue, 10 Jan 2023 13:47:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 601B341691; Tue, 10 Jan 2023 13:47:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 601B341691 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 43EF8C0033; Tue, 10 Jan 2023 13:47:31 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 79F99C002D for ; Tue, 10 Jan 2023 13:47:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5537181E7C for ; Tue, 10 Jan 2023 13:47:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5537181E7C Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a/TRB8ui X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DGqoS6aF24JN for ; Tue, 10 Jan 2023 13:47:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5ACDD81E62 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 5ACDD81E62 for ; Tue, 10 Jan 2023 13:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673358448; 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: content-transfer-encoding:content-transfer-encoding; bh=RiblBpi91cnjEWi5vEls5SSLvoc5G7oB+rSabfaaT7o=; b=a/TRB8uizXwcv6YETr7k1Z5ZeaVrY3KvmAMNVS3FBnNLdGRlneKmcmpGPXX8pDlJVYWSun 861VIASoOcdBtsyPtVuzuIHKzDJo17swFiQPN2hJ7x/T77MITU+W6DKbkEtmZDfRJi63+v SNnudiSEzwsuIhlFQ1vzpV/ChLyFXEo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-590--KeSLRrUNCK-BYDFsKpJvQ-1; Tue, 10 Jan 2023 08:47:25 -0500 X-MC-Unique: -KeSLRrUNCK-BYDFsKpJvQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0CFCD858F0E; Tue, 10 Jan 2023 13:47:25 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.193.107]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E42D492B00; Tue, 10 Jan 2023 13:47:22 +0000 (UTC) From: Kevin Traynor To: dev@openvswitch.org Date: Tue, 10 Jan 2023 13:47:13 +0000 Message-Id: <20230110134715.99051-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: i.maximets@ovn.org, david.marchand@redhat.com Subject: [ovs-dev] [PATCH v4 0/2] Add pmd sleeping. 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This series is to allow PMD threads to sleep under no and low load conditions. GHA: https://github.com/kevintraynor/ovs/actions/runs/3883046560 v4: - Fixed coding stds for xnanosleep fns - Minor updates to NEWS and docs - Updated some define names e.g. remove '_PWR_' - Reformatted Sleep time stat to fit in better with existing stats - Updated pmd time ctx after sleep so any pending PMD overhead work can be done immediately rather than waiting for next iteration. v3: - Renamed 'pmd-powersave-maxsleep' to 'pmd-maxsleep' - Removed 'pmd-powersave' param so 'pmd-maxsleep' can also be used to enable (max >0) and disable (max =0) sleeping - Changed resolution of sleeps to 10 us to avoid requesting sleeps < 10 us and to consider that typically sleep resolutions will be higher in practice - Created new xnanosleep_no_queisce() util function and sent this as patch 1/2. Used this instead of calling calling nanosleep() directly in dpif-netdev. - Changed no-sleep hit thresh stat to be how many iterations a sleep took place in. This is more intuitive for the user - Some minor changes in logging to account for updates to params and stats - Fixed issue with Tx flush issue where it could be forced even though sleeping is disabled - Moved reset of sleep time to keep sleep code in one block - Updated docs and unit tests for changes in operation and logging - Added NEWS - Other minor updates v2: - Updated to mark feature as experimental as there is still discussion on it's operation and control knobs - Added pmd-powersave-maxsleep to set the max requested sleep time - Added unit tests for pmd-powersave and pmd-powersave-maxsleep config knobs - Added docs to explain that requested sleep time and actual sleep time may differ - Added actual measurement of sleep time instead of reporting requested time - Removed Max sleep hit statistics - Added total sleep time statistic for the length of the measurement period (avg. uS per iteration still exists also) - Updated other statistics to account for sleep time - Some renaming - Replaced xnanosleep with nanosleep to avoid having to start/end quiesce for every sleep (this may KO this feature on Windows) - Limited max requested sleep to max PMD quiesce time (10 ms) - Adapted ALB measurement about whether a PMD is overloaded to account for time spent sleeping Kevin Traynor (2): util: Add non quiesce xnanosleep. dpif-netdev: Add PMD load based sleeping. Documentation/topics/dpdk/pmd.rst | 54 +++++++++++++++++++++++++ NEWS | 3 ++ lib/dpif-netdev-perf.c | 24 +++++++++--- lib/dpif-netdev-perf.h | 5 ++- lib/dpif-netdev.c | 65 +++++++++++++++++++++++++++++-- lib/util.c | 21 ++++++++-- lib/util.h | 1 + tests/pmd.at | 46 ++++++++++++++++++++++ vswitchd/vswitch.xml | 26 +++++++++++++ 9 files changed, 231 insertions(+), 14 deletions(-)