get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 121886,
    "url": "https://patches.dpdk.org/api/patches/121886/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230112100106.2180665-1-amitprakashs@marvell.com/",
    "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": "<20230112100106.2180665-1-amitprakashs@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230112100106.2180665-1-amitprakashs@marvell.com",
    "date": "2023-01-12T10:01:04",
    "name": "[v3,1/3] pcapng: comment option support for epb",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4ce0270696dccca1d28cf3993baf1335c665c786",
    "submitter": {
        "id": 2699,
        "url": "https://patches.dpdk.org/api/people/2699/?format=api",
        "name": "Amit Prakash Shukla",
        "email": "amitprakashs@marvell.com"
    },
    "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/20230112100106.2180665-1-amitprakashs@marvell.com/mbox/",
    "series": [
        {
            "id": 26501,
            "url": "https://patches.dpdk.org/api/series/26501/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26501",
            "date": "2023-01-12T10:01:04",
            "name": "[v3,1/3] pcapng: comment option support for epb",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/26501/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/121886/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/121886/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 D7C02423B5;\n\tThu, 12 Jan 2023 11:01:15 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8A26F40156;\n\tThu, 12 Jan 2023 11:01:15 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 8DD07400EF\n for <dev@dpdk.org>; Thu, 12 Jan 2023 11:01:14 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 30C9df7M004775; Thu, 12 Jan 2023 02:01:13 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3n23b2hm7d-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 12 Jan 2023 02:01:13 -0800",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42;\n Thu, 12 Jan 2023 02:01:11 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend\n Transport; Thu, 12 Jan 2023 02:01:11 -0800",
            "from localhost.localdomain (unknown [10.28.36.157])\n by maili.marvell.com (Postfix) with ESMTP id 05E3C3F7088;\n Thu, 12 Jan 2023 02:01:09 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=TVVwvUoA0moGf1wDxeoHUQojowWsB819+7ZmbyTiDoA=;\n b=dSaMjEJa2RzTcCK7n0U0ChV6GW6iaKB14dnChNoW442PEw3vTulRmtobg+F67t05Z/oy\n iCjUAPIwskRa3NhDOrK44S/L3fICSr3drbhlrhPPFYLl3k0Bh4VdKfHM9lchZj76X64b\n LqTtc+C82a4+XqdHACISvqJEgpdL5Kiu3205fogeq0xq4le6uEYJsaYx2DRc6JGDVcY4\n VYoxiFcw+64QlOZBB7eUixEXfntQhALAdkjIeDgq5fPbyc/kNbFZayxjuutbv2qviwyX\n m33cSJyxZrG9qRjffPtDZJ3YLlOMQeSU85Qert3mdWCQnOCrtP9uArKA76PEb5aQviBi 3g==",
        "From": "Amit Prakash Shukla <amitprakashs@marvell.com>",
        "To": "Reshma Pattan <reshma.pattan@intel.com>, Stephen Hemminger\n <stephen@networkplumber.org>",
        "CC": "<dev@dpdk.org>, <jerinj@marvell.com>, Amit Prakash Shukla\n <amitprakashs@marvell.com>",
        "Subject": "[PATCH v3 1/3] pcapng: comment option support for epb",
        "Date": "Thu, 12 Jan 2023 15:31:04 +0530",
        "Message-ID": "<20230112100106.2180665-1-amitprakashs@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230111085343.2058993-1-amitprakashs@marvell.com>",
        "References": "<20230111085343.2058993-1-amitprakashs@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "p4nzR20yJNlzF7Io19QzZMuZc3sPOTlk",
        "X-Proofpoint-ORIG-GUID": "p4nzR20yJNlzF7Io19QzZMuZc3sPOTlk",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2023-01-12_06,2023-01-12_01,2022-06-22_01",
        "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": "This change enhances rte_pcapng_copy to have comment in enhanced\npacket block.\n\nSigned-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>\n---\nv2:\n - Fixed code style issue\n - Fixed CI compilation issue on github-robot\n\nv3:\n - Code review suggestion from Stephen\n - Fixed potential memory leak\n \n app/test/test_pcapng.c  |  4 ++--\n lib/pcapng/rte_pcapng.c | 10 +++++++++-\n lib/pcapng/rte_pcapng.h |  4 +++-\n lib/pdump/rte_pdump.c   |  2 +-\n 4 files changed, 15 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c\nindex a7acbdc058..303d3d66f9 100644\n--- a/app/test/test_pcapng.c\n+++ b/app/test/test_pcapng.c\n@@ -139,7 +139,7 @@ test_write_packets(void)\n \t\tstruct rte_mbuf *mc;\n \n \t\tmc = rte_pcapng_copy(port_id, 0, orig, mp, pkt_len,\n-\t\t\t\trte_get_tsc_cycles(), 0);\n+\t\t\t\trte_get_tsc_cycles(), 0, NULL);\n \t\tif (mc == NULL) {\n \t\t\tfprintf(stderr, \"Cannot copy packet\\n\");\n \t\t\treturn -1;\n@@ -255,7 +255,7 @@ test_write_over_limit_iov_max(void)\n \t\tstruct rte_mbuf *mc;\n \n \t\tmc = rte_pcapng_copy(port_id, 0, orig, mp, pkt_len,\n-\t\t\t\trte_get_tsc_cycles(), 0);\n+\t\t\t\trte_get_tsc_cycles(), 0, NULL);\n \t\tif (mc == NULL) {\n \t\t\tfprintf(stderr, \"Cannot copy packet\\n\");\n \t\t\treturn -1;\ndiff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c\nindex 80d08e1a3b..acb31a9d93 100644\n--- a/lib/pcapng/rte_pcapng.c\n+++ b/lib/pcapng/rte_pcapng.c\n@@ -450,7 +450,8 @@ rte_pcapng_copy(uint16_t port_id, uint32_t queue,\n \t\tconst struct rte_mbuf *md,\n \t\tstruct rte_mempool *mp,\n \t\tuint32_t length, uint64_t cycles,\n-\t\tenum rte_pcapng_direction direction)\n+\t\tenum rte_pcapng_direction direction,\n+\t\tconst char *comment)\n {\n \tstruct pcapng_enhance_packet_block *epb;\n \tuint32_t orig_len, data_len, padding, flags;\n@@ -511,6 +512,9 @@ rte_pcapng_copy(uint16_t port_id, uint32_t queue,\n \tif (rss_hash)\n \t\toptlen += pcapng_optlen(sizeof(uint8_t) + sizeof(uint32_t));\n \n+\tif (comment)\n+\t\toptlen += pcapng_optlen(strlen(comment));\n+\n \t/* reserve trailing options and block length */\n \topt = (struct pcapng_option *)\n \t\trte_pktmbuf_append(mc, optlen + sizeof(uint32_t));\n@@ -548,6 +552,10 @@ rte_pcapng_copy(uint16_t port_id, uint32_t queue,\n \t\t\t\t\t&hash_opt, sizeof(hash_opt));\n \t}\n \n+\tif (comment)\n+\t\topt = pcapng_add_option(opt, PCAPNG_OPT_COMMENT, comment,\n+\t\t\t\t\tstrlen(comment));\n+\n \t/* Note: END_OPT necessary here. Wireshark doesn't do it. */\n \n \t/* Add PCAPNG packet header */\ndiff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h\nindex 7d2697c647..6d286cda41 100644\n--- a/lib/pcapng/rte_pcapng.h\n+++ b/lib/pcapng/rte_pcapng.h\n@@ -100,6 +100,8 @@ enum rte_pcapng_direction {\n  *   The timestamp in TSC cycles.\n  * @param direction\n  *   The direction of the packer: receive, transmit or unknown.\n+ * @param comment\n+ *   Packet comment.\n  *\n  * @return\n  *   - The pointer to the new mbuf formatted for pcapng_write\n@@ -111,7 +113,7 @@ struct rte_mbuf *\n rte_pcapng_copy(uint16_t port_id, uint32_t queue,\n \t\tconst struct rte_mbuf *m, struct rte_mempool *mp,\n \t\tuint32_t length, uint64_t timestamp,\n-\t\tenum rte_pcapng_direction direction);\n+\t\tenum rte_pcapng_direction direction, const char *comment);\n \n \n /**\ndiff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c\nindex a81544cb57..9bc4bab4f2 100644\n--- a/lib/pdump/rte_pdump.c\n+++ b/lib/pdump/rte_pdump.c\n@@ -122,7 +122,7 @@ pdump_copy(uint16_t port_id, uint16_t queue,\n \t\tif (cbs->ver == V2)\n \t\t\tp = rte_pcapng_copy(port_id, queue,\n \t\t\t\t\t    pkts[i], mp, cbs->snaplen,\n-\t\t\t\t\t    ts, direction);\n+\t\t\t\t\t    ts, direction, NULL);\n \t\telse\n \t\t\tp = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);\n \n",
    "prefixes": [
        "v3",
        "1/3"
    ]
}