get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104642,
    "url": "http://patchwork.dpdk.org/api/patches/104642/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1637735095-16900-1-git-send-email-chcchc88@163.com/",
    "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": "<1637735095-16900-1-git-send-email-chcchc88@163.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1637735095-16900-1-git-send-email-chcchc88@163.com",
    "date": "2021-11-24T06:24:55",
    "name": "ip_frag: add fragmenting IPv4 header optional field",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c62ad7ac289de5a286e838775456f1055749e1ba",
    "submitter": {
        "id": 2371,
        "url": "http://patchwork.dpdk.org/api/people/2371/?format=api",
        "name": "Huichao Cai",
        "email": "chcchc88@163.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1637735095-16900-1-git-send-email-chcchc88@163.com/mbox/",
    "series": [
        {
            "id": 20726,
            "url": "http://patchwork.dpdk.org/api/series/20726/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20726",
            "date": "2021-11-24T06:24:55",
            "name": "ip_frag: add fragmenting IPv4 header optional field",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/20726/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/104642/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/104642/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 90380A0C55;\n\tWed, 24 Nov 2021 07:25:28 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1968840A4B;\n\tWed, 24 Nov 2021 07:25:28 +0100 (CET)",
            "from m12-12.163.com (m12-12.163.com [220.181.12.12])\n by mails.dpdk.org (Postfix) with ESMTP id C6A3C40696\n for <dev@dpdk.org>; Wed, 24 Nov 2021 07:25:26 +0100 (CET)",
            "from bogon.localdomain (unknown [36.111.88.18])\n by smtp8 (Coremail) with SMTP id DMCowAC3b6_D2p1hFOu_CQ--.59680S2;\n Wed, 24 Nov 2021 14:25:21 +0800 (CST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n s=s110527; h=From:Subject:Date:Message-Id; bh=S9WRAY0a9QGilvdEsW\n Hq6UIz2ONcuaeKvqJsF0vZ1Uw=; b=bLG7Zl0Xq3ajoyZL6RcfQs6xYgseov0cFR\n tS1IzZNWfsT1ngeKfzrAA2+JvYEn5NAnLG84LZ6ptlc2CsYIw5TlS7FWYUCDn6/+\n uj7o+r5l2I4of8ZMak9y4Wzi8A0DrFbNYjDqi5kq5KVkfxiNZARUZ0vesatx6Hpo\n G7xY5R6yg=",
        "From": "Huichao Cai <chcchc88@163.com>",
        "To": "dev@dpdk.org",
        "Cc": "konstantin.ananyev@intel.com",
        "Subject": "[PATCH] ip_frag: add fragmenting IPv4 header optional field",
        "Date": "Wed, 24 Nov 2021 14:24:55 +0800",
        "Message-Id": "<1637735095-16900-1-git-send-email-chcchc88@163.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "X-CM-TRANSID": "DMCowAC3b6_D2p1hFOu_CQ--.59680S2",
        "X-Coremail-Antispam": "1Uf129KBjvJXoWxAr47uF1xZr4UXr17Wr1Utrb_yoW5WF17pF\n ykGrW5Xr15J3Z7W3yfXF4vqw4rKas2qF42yr9Ig3yxAF4kKFyvyayYyr13Kr12qr1kJw1v\n vwsIy3W5uF47Aw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UGeHkUUUUU=",
        "X-Originating-IP": "[36.111.88.18]",
        "X-CM-SenderInfo": "pfkfuxrfyyqiywtou0bp/xtbBDhJVF1rbNPy-nAAAs0",
        "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": "According to RFC791,the options may appear or not in datagrams.\nThey must be implemented by all IP modules (host and gateways).\nWhat is optional is their transmission in any particular datagram,\nnot their implementation.So we have to deal with it during the\nfragmenting process.\n\nSigned-off-by: Huichao Cai <chcchc88@163.com>\n---\n lib/ip_frag/rte_ipv4_fragmentation.c | 52 +++++++++++++++++++++++++++++++++++-\n 1 file changed, 51 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/ip_frag/rte_ipv4_fragmentation.c b/lib/ip_frag/rte_ipv4_fragmentation.c\nindex 2e7739d..bcafa29 100644\n--- a/lib/ip_frag/rte_ipv4_fragmentation.c\n+++ b/lib/ip_frag/rte_ipv4_fragmentation.c\n@@ -1,4 +1,4 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)\n  * Copyright(c) 2010-2014 Intel Corporation\n  */\n \n@@ -12,6 +12,13 @@\n \n #include \"ip_frag_common.h\"\n \n+/* IP options */\n+#define RTE_IPOPT_COPY\t\t\t\t0x80\n+#define RTE_IPOPT_CONTROL\t\t\t0x00\n+#define RTE_IPOPT_END\t\t\t\t(0 | RTE_IPOPT_CONTROL)\n+#define RTE_IPOPT_NOOP\t\t\t\t(1 | RTE_IPOPT_CONTROL)\n+#define RTE_IPOPT_COPIED(o)\t\t\t((o) & RTE_IPOPT_COPY)\n+\n /* Fragment Offset */\n #define\tRTE_IPV4_HDR_DF_SHIFT\t\t\t14\n #define\tRTE_IPV4_HDR_MF_SHIFT\t\t\t13\n@@ -41,6 +48,38 @@ static inline void __free_fragments(struct rte_mbuf *mb[], uint32_t num)\n \t\trte_pktmbuf_free(mb[i]);\n }\n \n+/*\n+ *\tOptions \"fragmenting\", just fill options not\n+ *\tallowed in fragments with NOOPs.\n+ *\tSimple and stupid 8), but the most efficient way.\n+ */\n+static inline void ip_options_fragment(struct rte_ipv4_hdr *iph)\n+{\n+\tunsigned char *optptr = (unsigned char *)iph +\n+\t    sizeof(struct rte_ipv4_hdr);\n+\tint l = (iph->version_ihl & RTE_IPV4_HDR_IHL_MASK) *\n+\t    RTE_IPV4_IHL_MULTIPLIER - sizeof(struct rte_ipv4_hdr);\n+\tint optlen;\n+\n+\twhile (l > 0) {\n+\t\tswitch (*optptr) {\n+\t\tcase RTE_IPOPT_END:\n+\t\t\treturn;\n+\t\tcase RTE_IPOPT_NOOP:\n+\t\t\tl--;\n+\t\t\toptptr++;\n+\t\t\tcontinue;\n+\t\t}\n+\t\toptlen = optptr[1];\n+\t\tif (optlen < 2 || optlen > l)\n+\t\t\treturn;\n+\t\tif (!RTE_IPOPT_COPIED(*optptr))\n+\t\t\tmemset(optptr, RTE_IPOPT_NOOP, optlen);\n+\t\tl -= optlen;\n+\t\toptptr += optlen;\n+\t}\n+}\n+\n /**\n  * IPv4 fragmentation.\n  *\n@@ -188,6 +227,17 @@ static inline void __free_fragments(struct rte_mbuf *mb[], uint32_t num)\n \t\t    (uint16_t)out_pkt->pkt_len,\n \t\t    flag_offset, fragment_offset, more_in_segs);\n \n+\t\t/*\n+\t\t * ANK: dirty, but effective trick. Upgrade options only if\n+\t\t * the segment to be fragmented was THE FIRST (otherwise,\n+\t\t * options are already fixed) and make it ONCE\n+\t\t * on the initial mbuf, so that all the following fragments\n+\t\t * will inherit fixed options.\n+\t\t */\n+\t\tif ((fragment_offset == 0) &&\n+\t\t\t    ((flag_offset & RTE_IPV4_HDR_OFFSET_MASK) == 0))\n+\t\t\tip_options_fragment(in_hdr);\n+\n \t\tfragment_offset = (uint16_t)(fragment_offset +\n \t\t    out_pkt->pkt_len - header_len);\n \n",
    "prefixes": []
}