get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 60613,
    "url": "https://patches.dpdk.org/api/patches/60613/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191007130254.3064-4-marcinx.smoczynski@intel.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": "<20191007130254.3064-4-marcinx.smoczynski@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191007130254.3064-4-marcinx.smoczynski@intel.com",
    "date": "2019-10-07T13:02:53",
    "name": "[v6,3/4] examples/ipsec-secgw: add frag TTL cmdline option",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "81995198d2fff3bbdfea41d218c3be32c7f50fc5",
    "submitter": {
        "id": 1293,
        "url": "https://patches.dpdk.org/api/people/1293/?format=api",
        "name": "Marcin Smoczynski",
        "email": "marcinx.smoczynski@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191007130254.3064-4-marcinx.smoczynski@intel.com/mbox/",
    "series": [
        {
            "id": 6719,
            "url": "https://patches.dpdk.org/api/series/6719/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6719",
            "date": "2019-10-07T13:02:50",
            "name": "add fallback session",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/6719/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/60613/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/60613/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BB7261C25A;\n\tMon,  7 Oct 2019 15:03:28 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id D780E1C1FE\n\tfor <dev@dpdk.org>; Mon,  7 Oct 2019 15:03:25 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Oct 2019 06:03:25 -0700",
            "from msmoczyx-mobl.ger.corp.intel.com ([10.103.104.110])\n\tby fmsmga002.fm.intel.com with ESMTP; 07 Oct 2019 06:03:24 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.67,268,1566889200\"; d=\"scan'208\";a=\"222900686\"",
        "From": "Marcin Smoczynski <marcinx.smoczynski@intel.com>",
        "To": "anoobj@marvell.com,\n\takhil.goyal@nxp.com,\n\tkonstantin.ananyev@intel.com",
        "Cc": "dev@dpdk.org,\n\tMarcin Smoczynski <marcinx.smoczynski@intel.com>",
        "Date": "Mon,  7 Oct 2019 15:02:53 +0200",
        "Message-Id": "<20191007130254.3064-4-marcinx.smoczynski@intel.com>",
        "X-Mailer": "git-send-email 2.21.0.windows.1",
        "In-Reply-To": "<20191007130254.3064-1-marcinx.smoczynski@intel.com>",
        "References": "<20190927155446.19136-1-marcinx.smoczynski@intel.com>\n\t<20191007130254.3064-1-marcinx.smoczynski@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 3/4] examples/ipsec-secgw: add frag TTL\n\tcmdline option",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Due to fragment loss on highly saturated links and long fragment\nlifetime, ipsec-secgw application quickly runs out of free reassembly\nbuckets. As a result new fragments are being dropped.\n\nIntroduce --frag-ttl option which allow user to lower default fragment\nlifitime which solves problem of saturated reassembly buckets with high\nbandwidth fragmented traffic.\n\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\nTested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\nSigned-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>\n---\n doc/guides/sample_app_ug/ipsec_secgw.rst |  7 +++++\n examples/ipsec-secgw/ipsec-secgw.c       | 40 ++++++++++++++++++------\n 2 files changed, 37 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/doc/guides/sample_app_ug/ipsec_secgw.rst b/doc/guides/sample_app_ug/ipsec_secgw.rst\nindex 45478e2a5..279ad4126 100644\n--- a/doc/guides/sample_app_ug/ipsec_secgw.rst\n+++ b/doc/guides/sample_app_ug/ipsec_secgw.rst\n@@ -154,6 +154,13 @@ Where:\n     Incoming packets with length bigger then MTU will be discarded.\n     Default value: 1500.\n \n+*   ``--frag-ttl FRAG_TTL_NS``: fragment lifetime (in nanoseconds).\n+    If packet is not reassembled within this time, received fragments\n+    will be discarded. Fragment lifetime should be decreased when\n+    there is a high fragmented traffic loss in high bandwidth networks.\n+    Should be lower for for low number of reassembly buckets.\n+    Valid values: from 1 ns to 10 s. Default value: 10000000 (10 s).\n+\n *   ``--reassemble NUM``: max number of entries in reassemble fragment table.\n     Zero value disables reassembly functionality.\n     Default value: 0.\ndiff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c\nindex 641ed3767..1d415ace8 100644\n--- a/examples/ipsec-secgw/ipsec-secgw.c\n+++ b/examples/ipsec-secgw/ipsec-secgw.c\n@@ -112,7 +112,7 @@ static uint16_t nb_txd = IPSEC_SECGW_TX_DESC_DEFAULT;\n \t\t0, 0)\n \n #define\tFRAG_TBL_BUCKET_ENTRIES\t4\n-#define\tFRAG_TTL_MS\t\t(10 * MS_PER_S)\n+#define\tMAX_FRAG_TTL_NS\t\t(10LL * NS_PER_S)\n \n #define MTU_TO_FRAMELEN(x)\t((x) + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN)\n \n@@ -135,6 +135,7 @@ struct ethaddr_info ethaddr_tbl[RTE_MAX_ETHPORTS] = {\n #define CMD_LINE_OPT_TX_OFFLOAD\t\t\"txoffload\"\n #define CMD_LINE_OPT_REASSEMBLE\t\t\"reassemble\"\n #define CMD_LINE_OPT_MTU\t\t\"mtu\"\n+#define CMD_LINE_OPT_FRAG_TTL\t\t\"frag-ttl\"\n \n enum {\n \t/* long options mapped to a short option */\n@@ -150,6 +151,7 @@ enum {\n \tCMD_LINE_OPT_TX_OFFLOAD_NUM,\n \tCMD_LINE_OPT_REASSEMBLE_NUM,\n \tCMD_LINE_OPT_MTU_NUM,\n+\tCMD_LINE_OPT_FRAG_TTL_NUM,\n };\n \n static const struct option lgopts[] = {\n@@ -160,6 +162,7 @@ static const struct option lgopts[] = {\n \t{CMD_LINE_OPT_TX_OFFLOAD, 1, 0, CMD_LINE_OPT_TX_OFFLOAD_NUM},\n \t{CMD_LINE_OPT_REASSEMBLE, 1, 0, CMD_LINE_OPT_REASSEMBLE_NUM},\n \t{CMD_LINE_OPT_MTU, 1, 0, CMD_LINE_OPT_MTU_NUM},\n+\t{CMD_LINE_OPT_FRAG_TTL, 1, 0, CMD_LINE_OPT_FRAG_TTL_NUM},\n \t{NULL, 0, 0, 0}\n };\n \n@@ -186,6 +189,7 @@ static uint64_t dev_tx_offload = UINT64_MAX;\n static uint32_t frag_tbl_sz;\n static uint32_t frame_buf_size = RTE_MBUF_DEFAULT_BUF_SIZE;\n static uint32_t mtu_size = RTE_ETHER_MTU;\n+static uint64_t frag_ttl_ns = MAX_FRAG_TTL_NS;\n \n /* application wide librte_ipsec/SA parameters */\n struct app_sa_prm app_sa_prm = {.enable = 0};\n@@ -1302,6 +1306,9 @@ print_usage(const char *prgname)\n \t\t\": MTU value on all ports (default value: 1500)\\n\"\n \t\t\"    outgoing packets with bigger size will be fragmented\\n\"\n \t\t\"    incoming packets with bigger size will be discarded\\n\"\n+\t\t\"  --\" CMD_LINE_OPT_FRAG_TTL \" FRAG_TTL_NS\"\n+\t\t\": fragments lifetime in nanoseconds, default\\n\"\n+\t\t\"    and maximum value is 10.000.000.000 ns (10 s)\\n\"\n \t\t\"\\n\",\n \t\tprgname);\n }\n@@ -1338,14 +1345,15 @@ parse_portmask(const char *portmask)\n \treturn pm;\n }\n \n-static int32_t\n+static int64_t\n parse_decimal(const char *str)\n {\n \tchar *end = NULL;\n-\tunsigned long num;\n+\tuint64_t num;\n \n-\tnum = strtoul(str, &end, 10);\n-\tif ((str[0] == '\\0') || (end == NULL) || (*end != '\\0'))\n+\tnum = strtoull(str, &end, 10);\n+\tif ((str[0] == '\\0') || (end == NULL) || (*end != '\\0')\n+\t\t|| num > INT64_MAX)\n \t\treturn -1;\n \n \treturn num;\n@@ -1419,12 +1427,14 @@ print_app_sa_prm(const struct app_sa_prm *prm)\n \tprintf(\"replay window size: %u\\n\", prm->window_size);\n \tprintf(\"ESN: %s\\n\", (prm->enable_esn == 0) ? \"disabled\" : \"enabled\");\n \tprintf(\"SA flags: %#\" PRIx64 \"\\n\", prm->flags);\n+\tprintf(\"Frag TTL: %\" PRIu64 \" ns\\n\", frag_ttl_ns);\n }\n \n static int32_t\n parse_args(int32_t argc, char **argv)\n {\n-\tint32_t opt, ret;\n+\tint opt;\n+\tint64_t ret;\n \tchar **argvopt;\n \tint32_t option_index;\n \tchar *prgname = argv[0];\n@@ -1503,7 +1513,7 @@ parse_args(int32_t argc, char **argv)\n \t\t\tbreak;\n \t\tcase CMD_LINE_OPT_SINGLE_SA_NUM:\n \t\t\tret = parse_decimal(optarg);\n-\t\t\tif (ret == -1) {\n+\t\t\tif (ret == -1 || ret > UINT32_MAX) {\n \t\t\t\tprintf(\"Invalid argument[sa_idx]\\n\");\n \t\t\t\tprint_usage(prgname);\n \t\t\t\treturn -1;\n@@ -1546,7 +1556,7 @@ parse_args(int32_t argc, char **argv)\n \t\t\tbreak;\n \t\tcase CMD_LINE_OPT_REASSEMBLE_NUM:\n \t\t\tret = parse_decimal(optarg);\n-\t\t\tif (ret < 0) {\n+\t\t\tif (ret < 0 || ret > UINT32_MAX) {\n \t\t\t\tprintf(\"Invalid argument for \\'%s\\': %s\\n\",\n \t\t\t\t\tCMD_LINE_OPT_REASSEMBLE, optarg);\n \t\t\t\tprint_usage(prgname);\n@@ -1564,6 +1574,16 @@ parse_args(int32_t argc, char **argv)\n \t\t\t}\n \t\t\tmtu_size = ret;\n \t\t\tbreak;\n+\t\tcase CMD_LINE_OPT_FRAG_TTL_NUM:\n+\t\t\tret = parse_decimal(optarg);\n+\t\t\tif (ret < 0 || ret > MAX_FRAG_TTL_NS) {\n+\t\t\t\tprintf(\"Invalid argument for \\'%s\\': %s\\n\",\n+\t\t\t\t\tCMD_LINE_OPT_MTU, optarg);\n+\t\t\t\tprint_usage(prgname);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tfrag_ttl_ns = ret;\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\tprint_usage(prgname);\n \t\t\treturn -1;\n@@ -2324,8 +2344,8 @@ reassemble_lcore_init(struct lcore_conf *lc, uint32_t cid)\n \n \t/* create fragment table */\n \tsid = rte_lcore_to_socket_id(cid);\n-\tfrag_cycles = (rte_get_tsc_hz() + MS_PER_S - 1) /\n-\t\tMS_PER_S * FRAG_TTL_MS;\n+\tfrag_cycles = (rte_get_tsc_hz() + NS_PER_S - 1) /\n+\t\tNS_PER_S * frag_ttl_ns;\n \n \tlc->frag.tbl = rte_ip_frag_table_create(frag_tbl_sz,\n \t\tFRAG_TBL_BUCKET_ENTRIES, frag_tbl_sz, frag_cycles, sid);\n",
    "prefixes": [
        "v6",
        "3/4"
    ]
}