get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139456,
    "url": "https://patches.dpdk.org/api/patches/139456/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240417170908.76701-2-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-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240417170908.76701-2-stephen@networkplumber.org",
    "date": "2024-04-17T17:07:23",
    "name": "[v3,1/5] latencystats: replace use of VLA",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "7728e7fb3ead8e6739491719736f5cf2547ceafe",
    "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-2-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/139456/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/139456/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 8F3CA43E94;\n\tWed, 17 Apr 2024 19:09:19 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 485F8427DB;\n\tWed, 17 Apr 2024 19:09:15 +0200 (CEST)",
            "from mail-pl1-f177.google.com (mail-pl1-f177.google.com\n [209.85.214.177])\n by mails.dpdk.org (Postfix) with ESMTP id 5A24140DDA\n for <dev@dpdk.org>; Wed, 17 Apr 2024 19:09:12 +0200 (CEST)",
            "by mail-pl1-f177.google.com with SMTP id\n d9443c01a7336-1e65b29f703so32053865ad.3\n for <dev@dpdk.org>; Wed, 17 Apr 2024 10:09:12 -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.10\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 17 Apr 2024 10:09:11 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713373751;\n x=1713978551; 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=09UyrYX1Vh02PraxkSf5Xu2VMzlVl81VvnMGrlBxTxw=;\n b=GlwPLgFM41wqVhvIYODY37nYnF3jFXSXRO5mjZH4CDT9SacJPKmEzPKqvdryFynq88\n 18gv7QrU6fuy5CXJcAZZ1n9YfYc/c2O47FByCoOKMNndmewo8KlMQpT8KBJNxlWfwq7k\n zX0cG6wWTVVxfZvad217OTgiHKBKxQGYNT4odL84p80YzSiVMYExxfXm8zT+eBjQKdb7\n h9lT9sXyG3/+zXIm8fSMGVNMwo4JBZDIvlg0h+omhkR35ehHpBTW/zwqwL91rmPC4LpL\n V4Ej1Zb7O1fZZRuP32aRNof1COMU/r3TzpuZ1Uhf0J4TYNbwsXmkVx27U4399NjtkxKi\n fLSA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1713373751; x=1713978551;\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=09UyrYX1Vh02PraxkSf5Xu2VMzlVl81VvnMGrlBxTxw=;\n b=HJ2DCsvH9DvzRkdnWCiw2cWVhw+Uae5aU9K6/bufvKSLQKEbn4Es2lCqjp4rAnBRuU\n 8ELWCziwwu7fCUPX6cXGepp91c+Tay8Hg6iupAFMrt68TSYl9aIwc2yvSrFkDeRQxNmr\n GStpeHHS3NBeTJvr4rKsptS9gP1DE2TrJZh83qCwBfPTggRkFHmX6bvyw7pxmbebvf2Z\n E4ncNVx5A64TtIN4DH5pc9HB6o92UME20cjQMDLuomrwttr8IWhThabd+76Dc5t1Gic0\n kyGxkpak2XLnPfUpQKSPOInQFN2e+S95IGrZNmGSOPAQn8Io7VpOMnEq+2kFiM/rJpp5\n Jdkw==",
        "X-Gm-Message-State": "AOJu0YyYtwtClxX+JNtrXbCdUFGI9Mp4CJsusCsrn12oiN/Mk45AiZz3\n rZfo7MIwUAyxgVxIUotf5p7Zhr19vtWlrm9CHUsDCXeihp6dyXqZ/9QR6moaBL0mHvFd4rOyyCj\n e",
        "X-Google-Smtp-Source": "\n AGHT+IFYwn+vOt+uax703s4Mgo51/1oMquSccnGY1kZKhsAo1VzXO+7c73ZWHRDbbYtBP/4erSg9xw==",
        "X-Received": "by 2002:a17:902:8c94:b0:1e2:bf94:487 with SMTP id\n t20-20020a1709028c9400b001e2bf940487mr76871plo.57.1713373751411;\n Wed, 17 Apr 2024 10:09:11 -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 1/5] latencystats: replace use of VLA",
        "Date": "Wed, 17 Apr 2024 10:07:23 -0700",
        "Message-ID": "<20240417170908.76701-2-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": "The temporary array latencystats is not needed if the algorithm\nis converted into one pass.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\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": [
        "v3",
        "1/5"
    ]
}