get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/139612/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 139612,
    "url": "http://patchwork.dpdk.org/api/patches/139612/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240422152336.147553-2-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20240422152336.147553-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240422152336.147553-2-stephen@networkplumber.org",
    "date": "2024-04-22T15:21:31",
    "name": "[v5,1/9] latencystats: replace use of VLA",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7728e7fb3ead8e6739491719736f5cf2547ceafe",
    "submitter": {
        "id": 27,
        "url": "http://patchwork.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240422152336.147553-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 31803,
            "url": "http://patchwork.dpdk.org/api/series/31803/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31803",
            "date": "2024-04-22T15:21:30",
            "name": "latencystats: improve algorithms and tests",
            "version": 5,
            "mbox": "http://patchwork.dpdk.org/series/31803/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139612/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/139612/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 3FF3F43EDB;\n\tMon, 22 Apr 2024 17:23:53 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 095E0409FA;\n\tMon, 22 Apr 2024 17:23:51 +0200 (CEST)",
            "from mail-il1-f170.google.com (mail-il1-f170.google.com\n [209.85.166.170])\n by mails.dpdk.org (Postfix) with ESMTP id 9CA7B40265\n for <dev@dpdk.org>; Mon, 22 Apr 2024 17:23:47 +0200 (CEST)",
            "by mail-il1-f170.google.com with SMTP id\n e9e14a558f8ab-36c00924fc1so12998825ab.2\n for <dev@dpdk.org>; Mon, 22 Apr 2024 08:23:47 -0700 (PDT)",
            "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n cb17-20020a056a02071100b0060063c4be3bsm1402783pgb.14.2024.04.22.08.23.46\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 22 Apr 2024 08:23:46 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713799427;\n x=1714404227; 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=1iMXXGjOoTwNd9pOuzO/FsZahJFsBN6I19d6MX2wr/Q=;\n b=Mzvff90E265up4jZ4XcI4E+lBam5XFhclXsYYqAfpzCumz+OMcoTPkgeeqBDoQpI+F\n oKlsTUY1riL5gwY/bFbV2P310G0Ypfiv3yo9ZhYE2ro/4BY3yW0Z2v4OTLfToXjb2wCu\n lq6fZ+ARS9gIEKC7aAQu7J+Cz4RzGK3kJfSKsxqHAKmhTighQOD7ty9LG8tmWg2KVprl\n IPk4XvgTO++P4xrxv6JIGpQdDZqVyISoupnyDrm0iK+qoU7zbqUHORdcss1E47mn1ewl\n UN8xwDa5CpYc/rX6Lj0EyiV4T44wqAwyuz9kRp3OEbWOub4s7bLTBjuW+GN82MpJqtE8\n S2og==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1713799427; x=1714404227;\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=1iMXXGjOoTwNd9pOuzO/FsZahJFsBN6I19d6MX2wr/Q=;\n b=HpQT20p8vTMGuUkG17ylo4nrcZHBXFxteH5z+NSsrLpao5aN/B7PQL4f8MXFmsXjy5\n xZFiR7Y/u/quHCjwugJvFZ4QRw8c1IRLfLdQ7BJbW4SYUBLLhSKSxoqh574PJ2nZnZsM\n mWzUp70qiDJ20obm/j5gwtxyjXh0AXs+FSMtWE0ZzO576uhjCrexlU4RKjoJTYPQ6wEF\n b/0IIthhWSW7O6k8Og+uxZ6j5EV5QZY9WJcAStFTasMrhKZ3JM02ffWJsfsbohf03lWk\n VoUNNLeemkg9opKeABEaTIWhBIDcU2OTe141KBdeG43AM4ZAcB6OMs5LMJgpLn2ycr5b\n CjFQ==",
        "X-Gm-Message-State": "AOJu0YxK+P3lilotUJGAwRgp0cjXdfgRhYsG0P33DihAkk5q9WqONSNI\n lDv0zUCd9PlnWvZE0s1hasItRYADzktG89nJ42aKFEEhZYoEO0T9hdBNh/04xu7cNiC458dsR/d\n G",
        "X-Google-Smtp-Source": "\n AGHT+IF6FYf/p7LJCAitcrAQ2HtL9rElVICoKZQaNWbqFb6jFumIVMcO5FpnmiS8rI4XWwMB0wGQlQ==",
        "X-Received": "by 2002:a05:6e02:1609:b0:368:a724:f757 with SMTP id\n t9-20020a056e02160900b00368a724f757mr15310076ilu.6.1713799426951;\n Mon, 22 Apr 2024 08:23:46 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>, =?utf-8?q?Morten_Br?=\n\t=?utf-8?q?=C3=B8rup?= <mb@smartsharesystems.com>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>,\n Reshma Pattan <reshma.pattan@intel.com>",
        "Subject": "[PATCH v5 1/9] latencystats: replace use of VLA",
        "Date": "Mon, 22 Apr 2024 08:21:31 -0700",
        "Message-ID": "<20240422152336.147553-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240422152336.147553-1-stephen@networkplumber.org>",
        "References": "<20240408195036.182545-1-stephen@networkplumber.org>\n <20240422152336.147553-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "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": "The temporary array latencystats is not needed if the algorithm\nis converted into one pass.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\nAcked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n lib/latencystats/rte_latencystats.c | 31 +++++++++++++++--------------\n 1 file changed, 16 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c\nindex 4ea9b0d75b..9b345bfb33 100644\n--- a/lib/latencystats/rte_latencystats.c\n+++ b/lib/latencystats/rte_latencystats.c\n@@ -157,9 +157,9 @@ calc_latency(uint16_t pid __rte_unused,\n \t\tuint16_t nb_pkts,\n \t\tvoid *_ __rte_unused)\n {\n-\tunsigned int i, cnt = 0;\n+\tunsigned int i;\n \tuint64_t now;\n-\tfloat latency[nb_pkts];\n+\tfloat latency;\n \tstatic float prev_latency;\n \t/*\n \t * Alpha represents degree of weighting decrease in EWMA,\n@@ -169,13 +169,14 @@ calc_latency(uint16_t pid __rte_unused,\n \tconst float alpha = 0.2;\n \n \tnow = rte_rdtsc();\n-\tfor (i = 0; i < nb_pkts; i++) {\n-\t\tif (pkts[i]->ol_flags & timestamp_dynflag)\n-\t\t\tlatency[cnt++] = now - *timestamp_dynfield(pkts[i]);\n-\t}\n \n \trte_spinlock_lock(&glob_stats->lock);\n-\tfor (i = 0; i < cnt; i++) {\n+\tfor (i = 0; i < nb_pkts; i++) {\n+\t\tif (!(pkts[i]->ol_flags & timestamp_dynflag))\n+\t\t\tcontinue;\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@@ -187,22 +188,22 @@ calc_latency(uint16_t pid __rte_unused,\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 +=  (fabsf(prev_latency - latency[i])\n+\t\tglob_stats->jitter +=  (fabsf(prev_latency - latency)\n \t\t\t\t\t- glob_stats->jitter)/16;\n \t\tif (glob_stats->min_latency == 0)\n-\t\t\tglob_stats->min_latency = latency[i];\n-\t\telse if (latency[i] < glob_stats->min_latency)\n-\t\t\tglob_stats->min_latency = latency[i];\n-\t\telse if (latency[i] > glob_stats->max_latency)\n-\t\t\tglob_stats->max_latency = latency[i];\n+\t\t\tglob_stats->min_latency = latency;\n+\t\telse if (latency < glob_stats->min_latency)\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\tglob_stats->avg_latency +=\n-\t\t\talpha * (latency[i] - glob_stats->avg_latency);\n-\t\tprev_latency = latency[i];\n+\t\t\talpha * (latency - glob_stats->avg_latency);\n+\t\tprev_latency = latency;\n \t}\n \trte_spinlock_unlock(&glob_stats->lock);\n \n",
    "prefixes": [
        "v5",
        "1/9"
    ]
}