Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/139460/?format=api
https://patches.dpdk.org/api/patches/139460/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240417170908.76701-6-stephen@networkplumber.org/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20240417170908.76701-6-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20240417170908.76701-6-stephen@networkplumber.org", "date": "2024-04-17T17:07:27", "name": "[v3,5/5] latencystats: include file cleanup", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f7a5b7604563a2ade4236dd52cc4799009b04842", "submitter": { "id": 27, "url": "https://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240417170908.76701-6-stephen@networkplumber.org/mbox/", "series": [ { "id": 31774, "url": "https://patches.dpdk.org/api/series/31774/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31774", "date": "2024-04-17T17:07:22", "name": "latencystats: cleanups", "version": 3, "mbox": "https://patches.dpdk.org/series/31774/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/139460/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/139460/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A65D343E94;\n\tWed, 17 Apr 2024 19:09:44 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2D911427DA;\n\tWed, 17 Apr 2024 19:09:21 +0200 (CEST)", "from mail-pl1-f181.google.com (mail-pl1-f181.google.com\n [209.85.214.181])\n by mails.dpdk.org (Postfix) with ESMTP id 5EE0E427DD\n for <dev@dpdk.org>; Wed, 17 Apr 2024 19:09:15 +0200 (CEST)", "by mail-pl1-f181.google.com with SMTP id\n d9443c01a7336-1e2178b2cf2so52764335ad.0\n for <dev@dpdk.org>; Wed, 17 Apr 2024 10:09:15 -0700 (PDT)", "from hermes.lan (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n l5-20020a170903120500b001e4458831afsm11832442plh.227.2024.04.17.10.09.13\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 17 Apr 2024 10:09:14 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713373754;\n x=1713978554; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=eWXQpRBTA/1MVLUFmfw6CtiM8QVScfWJV0ddb94LcXQ=;\n b=QiL8o1LSgxDf8HG2P9ai+EGxvW7zLTeYenTC/oLRWsIG+/vAm0SFFDbtuAR5RfnrsJ\n wol4eGu4JX0ZBriIAJt6gUXlTCFmr59eshqBiXZK4LHdTahDJ0yz/3sJEX5x31G4p+Ji\n 2ULy6ZBm4enctbC2URKfgJKoGAQe2jBXeRr1XKNKbFgXQaMLLvv8N75Naqji5OS45YlC\n jvchlyCl1UbBjbSbShZEUvfP6E3O9pgTe2a24C4gdCOfh/Ez9KVfhSERh+/vNmcLKAg3\n UWT37M6xRwEM2fHBC+VnaiYnBTBWzosUkF7NO9MKVPeftlRQbsWRNndGQ5EQkTTlymFg\n /MBA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1713373754; x=1713978554;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=eWXQpRBTA/1MVLUFmfw6CtiM8QVScfWJV0ddb94LcXQ=;\n b=hKRNuiheKptUKqXXjEuBg6/25c+M1jNWtrFo4l/KxneYNGyp0dQ+Wot69pXF3h+XTU\n nH0sO+O2wSLo8qFSZeuTlPXemp8m579k6KOim4XtLkZAIlj0x0fvzflxOPYSnIgk+eTE\n fnDFHJRjAZV2M3/HNoiZ3bVR8tMCa7zBuLu1DRa0QKNhHPWTZkk3hvmFkstIj5sQDNAo\n t8Wc8uZvWK8FqqW9wmXB492ogFNSlrfxWiMMYEmUJudFA5mUkqRjgep+uRDzTuVEKLB5\n RMezhoLl/YI50ELElZ2rSdz4CKSSYwFmyUodf4z6eksSriDOwaT355hAcRrgCjZu0YLJ\n Djtg==", "X-Gm-Message-State": "AOJu0YyBK3orujOO/vipnIf1wNjNBn9BYTiIDbtJu0v4XQT7VucvxWKv\n yLYHvVCAUqsOBOtTWBlnSKvI6D/pnoMWxp6bAthYKS/2aK4YbaK127u3vog4SwYhTbxExQ/ZjeF\n P", "X-Google-Smtp-Source": "\n AGHT+IHBUjviD11CWpvmlRw+m2IlxLIhjty70mTBAhysOJrWd06EwMl42h5Kx3fz8406cagdUcZqQw==", "X-Received": "by 2002:a17:902:e807:b0:1e7:d482:9e07 with SMTP id\n u7-20020a170902e80700b001e7d4829e07mr144097plg.12.1713373754501;\n Wed, 17 Apr 2024 10:09:14 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Reshma Pattan <reshma.pattan@intel.com>", "Subject": "[PATCH v3 5/5] latencystats: include file cleanup", "Date": "Wed, 17 Apr 2024 10:07:27 -0700", "Message-ID": "<20240417170908.76701-6-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20240417170908.76701-1-stephen@networkplumber.org>", "References": "<0240408195036.182545-1-stephen@networkplumber.org>\n <20240417170908.76701-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Include what is used here.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/latencystats/rte_latencystats.c | 85 ++++++++++++++++++-----------\n 1 file changed, 52 insertions(+), 33 deletions(-)", "diff": "diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c\nindex 62038a9f5d..31e7a6eb88 100644\n--- a/lib/latencystats/rte_latencystats.c\n+++ b/lib/latencystats/rte_latencystats.c\n@@ -2,16 +2,25 @@\n * Copyright(c) 2018 Intel Corporation\n */\n \n+#include <errno.h>\n #include <math.h>\n+#include <stdbool.h>\n+#include <stddef.h>\n+#include <string.h>\n \n-#include <rte_string_fns.h>\n-#include <rte_mbuf_dyn.h>\n-#include <rte_log.h>\n+#include <rte_common.h>\n #include <rte_cycles.h>\n+#include <rte_eal.h>\n+#include <rte_errno.h>\n #include <rte_ethdev.h>\n-#include <rte_metrics.h>\n-#include <rte_memzone.h>\n #include <rte_lcore.h>\n+#include <rte_log.h>\n+#include <rte_mbuf.h>\n+#include <rte_mbuf_dyn.h>\n+#include <rte_memzone.h>\n+#include <rte_metrics.h>\n+#include <rte_spinlock.h>\n+#include <rte_string_fns.h>\n \n #include \"rte_latencystats.h\"\n \n@@ -148,14 +157,15 @@ add_time_stamps(uint16_t pid __rte_unused,\n \n static uint16_t\n calc_latency(uint16_t pid __rte_unused,\n-\t\tuint16_t qid __rte_unused,\n-\t\tstruct rte_mbuf **pkts,\n-\t\tuint16_t nb_pkts,\n-\t\tvoid *_ __rte_unused)\n+\t uint16_t qid __rte_unused,\n+\t struct rte_mbuf **pkts,\n+\t uint16_t nb_pkts,\n+\t void *_ __rte_unused)\n {\n \tunsigned int i;\n \tuint64_t now, latency;\n \tstatic uint64_t prev_latency;\n+\tstatic bool first_sample = true;\n \n \tnow = rte_rdtsc();\n \n@@ -166,32 +176,41 @@ calc_latency(uint16_t pid __rte_unused,\n \n \t\tlatency = now - *timestamp_dynfield(pkts[i]);\n \n-\t\t/*\n-\t\t * The jitter is calculated as statistical mean of interpacket\n-\t\t * delay variation. The \"jitter estimate\" is computed by taking\n-\t\t * the absolute values of the ipdv sequence and applying an\n-\t\t * exponential filter with parameter 1/16 to generate the\n-\t\t * estimate. i.e J=J+(|D(i-1,i)|-J)/16. Where J is jitter,\n-\t\t * D(i-1,i) is difference in latency of two consecutive packets\n-\t\t * i-1 and i.\n-\t\t * Reference: Calculated as per RFC 5481, sec 4.1,\n-\t\t * RFC 3393 sec 4.5, RFC 1889 sec.\n-\t\t */\n-\t\tglob_stats->jitter += ((prev_latency - latency) - glob_stats->jitter) / 16;\n-\t\tif (glob_stats->min_latency == 0)\n-\t\t\tglob_stats->min_latency = latency;\n-\t\telse if (latency < glob_stats->min_latency)\n+\t\tif (first_sample) {\n+\t\t\tfirst_sample = false;\n+\n \t\t\tglob_stats->min_latency = latency;\n-\t\telse if (latency > glob_stats->max_latency)\n \t\t\tglob_stats->max_latency = latency;\n-\t\t/*\n-\t\t * The average latency is measured using exponential moving\n-\t\t * average, i.e. using EWMA\n-\t\t * https://en.wikipedia.org/wiki/Moving_average\n-\t\t *\n-\t\t * Alpha is .25\n-\t\t */\n-\t\tglob_stats->avg_latency += (latency - glob_stats->avg_latency) / 4;\n+\t\t\tglob_stats->avg_latency = latency;\n+\t\t\tglob_stats->jitter = 0;\n+\t\t} else {\n+\t\t\t/*\n+\t\t\t * The jitter is calculated as statistical mean of interpacket\n+\t\t\t * delay variation. The \"jitter estimate\" is computed by taking\n+\t\t\t * the absolute values of the ipdv sequence and applying an\n+\t\t\t * exponential filter with parameter 1/16 to generate the\n+\t\t\t * estimate. i.e J=J+(|D(i-1,i)|-J)/16. Where J is jitter,\n+\t\t\t * D(i-1,i) is difference in latency of two consecutive packets\n+\t\t\t * i-1 and i.\n+\t\t\t * Reference: Calculated as per RFC 5481, sec 4.1,\n+\t\t\t * RFC 3393 sec 4.5, RFC 1889 sec.\n+\t\t\t */\n+\t\t\tglob_stats->jitter += ((prev_latency - latency)\n+\t\t\t\t\t - glob_stats->jitter) / 16;\n+\t\t\tif (latency < glob_stats->min_latency)\n+\t\t\t\tglob_stats->min_latency = latency;\n+\t\t\tif (latency > glob_stats->max_latency)\n+\t\t\t\tglob_stats->max_latency = latency;\n+\t\t\t/*\n+\t\t\t * The average latency is measured using exponential moving\n+\t\t\t * average, i.e. using EWMA\n+\t\t\t * https://en.wikipedia.org/wiki/Moving_average\n+\t\t\t *\n+\t\t\t * Alpha is .25\n+\t\t\t */\n+\t\t\tglob_stats->avg_latency += (latency - glob_stats->avg_latency) / 4;\n+\t\t}\n+\n \t\tprev_latency = latency;\n \t}\n \trte_spinlock_unlock(&glob_stats->lock);\n", "prefixes": [ "v3", "5/5" ] }{ "id": 139460, "url": "