get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 127718,
    "url": "http://patchwork.dpdk.org/api/patches/127718/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230530100158.1428-17-anoobj@marvell.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": "<20230530100158.1428-17-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230530100158.1428-17-anoobj@marvell.com",
    "date": "2023-05-30T10:01:53",
    "name": "[v6,16/21] pdcp: add timer expiry handle",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "18c40625e86e14ca4b957a9fd11c75dd71200b98",
    "submitter": {
        "id": 1205,
        "url": "http://patchwork.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patchwork.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230530100158.1428-17-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 28249,
            "url": "http://patchwork.dpdk.org/api/series/28249/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28249",
            "date": "2023-05-30T10:01:37",
            "name": "lib: add pdcp protocol",
            "version": 6,
            "mbox": "http://patchwork.dpdk.org/series/28249/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/127718/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/127718/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 E2A0C42BE2;\n\tTue, 30 May 2023 12:04:02 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A658342D70;\n\tTue, 30 May 2023 12:03:16 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 9761A42D39\n for <dev@dpdk.org>; Tue, 30 May 2023 12:03:14 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 34U5rbcA030170; Tue, 30 May 2023 03:03:13 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3quhcm7u07-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 30 May 2023 03:03:13 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Tue, 30 May 2023 03:03:11 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Tue, 30 May 2023 03:03:11 -0700",
            "from BG-LT92004.corp.innovium.com (unknown [10.193.69.246])\n by maili.marvell.com (Postfix) with ESMTP id 554313F7050;\n Tue, 30 May 2023 03:03:07 -0700 (PDT)"
        ],
        "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=/ZpaU3ZukA8tfTuVeAtojC9hYikYvQ7sX5Qu72JPBzI=;\n b=D2i+BI/xm6n5+kdI/DJ6juDOsLtFlZjJRnpOVkmFCKwzNdv3EMqbWsfoUhmRy0MozwBz\n CDInVwdTbhvpwnCeYb0HEqlQ+5QEFscvjiqsGkhre0Om33QGdYh6JdtTyL/eZiJW8bvS\n ETCNaI7evn5hfUBxuhioAzpVX4NRc1jaepWF0R9mYAHEfMBkUmeqWwUNeZtdklmKyZjG\n eKx/ja4npqjoHm/Ix8WA3CX1caJnNpp0a63KcDnO6/IDaGXYC/a28GDyXs23Ch9+IP5Y\n U+Z2LouxDjiS9vd77ZKUe1TfPjixOqk40lR0g45jDTELJohrn8zwWuFiuVdh0O2eZ74m 8w==",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Thomas Monjalon <thomas@monjalon.net>, Akhil Goyal <gakhil@marvell.com>,\n Jerin Jacob <jerinj@marvell.com>, Konstantin Ananyev\n <konstantin.v.ananyev@yandex.ru>",
        "CC": "Volodymyr Fialko <vfialko@marvell.com>,\n Hemant Agrawal <hemant.agrawal@nxp.com>,\n =?utf-8?q?Mattias_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>,\n Kiran Kumar K <kirankumark@marvell.com>, <dev@dpdk.org>,\n Olivier Matz <olivier.matz@6wind.com>,\n Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v6 16/21] pdcp: add timer expiry handle",
        "Date": "Tue, 30 May 2023 15:31:53 +0530",
        "Message-ID": "<20230530100158.1428-17-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230530100158.1428-1-anoobj@marvell.com>",
        "References": "<20230527085910.972-1-anoobj@marvell.com>\n <20230530100158.1428-1-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "m5Q1akX3NCQeIPy9N1-jB2X2gqZV6HXJ",
        "X-Proofpoint-ORIG-GUID": "m5Q1akX3NCQeIPy9N1-jB2X2gqZV6HXJ",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26\n definitions=2023-05-30_06,2023-05-29_02,2023-05-22_02",
        "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": "From: Volodymyr Fialko <vfialko@marvell.com>\n\nThe PDCP protocol requires usage of timers to keep track of how long\nan out-of-order packet should be buffered while waiting for missing\npackets. Applications can register a desired timer implementation with the\nPDCP library. Once the timer expires, the application will be notified, and\nfurther handling of the event will be performed in the PDCP library.\n\nWhen the timer expires, the PDCP library will return the cached packets,\nand PDCP internal state variables (like RX_REORD, RX_DELIV etc) will be\nupdated accordingly.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Volodymyr Fialko <vfialko@marvell.com>\n---\n doc/guides/prog_guide/pdcp_lib.rst | 31 +++++++++++++++++++\n lib/pdcp/rte_pdcp.c                | 49 ++++++++++++++++++++++++++++++\n lib/pdcp/rte_pdcp.h                | 34 +++++++++++++++++++--\n lib/pdcp/version.map               |  2 ++\n 4 files changed, 114 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/doc/guides/prog_guide/pdcp_lib.rst b/doc/guides/prog_guide/pdcp_lib.rst\nindex a925aa7f14..61242edf92 100644\n--- a/doc/guides/prog_guide/pdcp_lib.rst\n+++ b/doc/guides/prog_guide/pdcp_lib.rst\n@@ -130,6 +130,37 @@ Supported integrity protection algorithms\n - RTE_CRYPTO_AUTH_SNOW3G_UIA2\n - RTE_CRYPTO_AUTH_ZUC_EIA3\n \n+Timers\n+------\n+\n+PDCP utilizes a reception window mechanism to limit the bits of COUNT value\n+transmitted in the packet. It utilizes state variables such as RX_REORD,\n+RX_DELIV to define the window and uses RX_DELIV as the lower pivot point of the\n+window.\n+\n+RX_DELIV would be updated only when packets are received in-order.\n+Any missing packet would mean RX_DELIV won't be updated.\n+A timer, t-Reordering, helps PDCP to slide the window\n+if the missing packet is not received in a specified time duration.\n+\n+While starting and stopping the timer will be done by lib PDCP,\n+application could register its own timer implementation.\n+This is to make sure application can choose between timers\n+such as rte_timer and rte_event based timers.\n+Starting and stopping of timer would happen during pre & post process API.\n+\n+When the t-Reordering timer expires, application would receive the expiry event.\n+To perform the PDCP handling of the expiry event,\n+``rte_pdcp_t_reordering_expiry_handle`` can be used.\n+Expiry handling would involve sliding the window by updating state variables and\n+passing the expired packets to the application.\n+\n+.. literalinclude:: ../../../lib/pdcp/rte_pdcp.h\n+   :language: c\n+   :start-after: Structure rte_pdcp_t_reordering 8<\n+   :end-before: >8 End of structure rte_pdcp_t_reordering.\n+\n+\n Sample API usage\n ----------------\n \ndiff --git a/lib/pdcp/rte_pdcp.c b/lib/pdcp/rte_pdcp.c\nindex a0558b99ae..819c66bd08 100644\n--- a/lib/pdcp/rte_pdcp.c\n+++ b/lib/pdcp/rte_pdcp.c\n@@ -251,3 +251,52 @@ rte_pdcp_control_pdu_create(struct rte_pdcp_entity *pdcp_entity,\n \n \treturn m;\n }\n+\n+uint16_t\n+rte_pdcp_t_reordering_expiry_handle(const struct rte_pdcp_entity *entity, struct rte_mbuf *out_mb[])\n+{\n+\tstruct entity_priv_dl_part *dl = entity_dl_part_get(entity);\n+\tstruct entity_priv *en_priv = entity_priv_get(entity);\n+\tuint16_t capacity = entity->max_pkt_cache;\n+\tuint16_t nb_out, nb_seq;\n+\n+\t/* 5.2.2.2 Actions when a t-Reordering expires */\n+\n+\t/*\n+\t * - deliver to upper layers in ascending order of the associated COUNT value after\n+\t *   performing header decompression, if not decompressed before:\n+\t */\n+\n+\t/*   - all stored PDCP SDU(s) with associated COUNT value(s) < RX_REORD; */\n+\tnb_out = pdcp_reorder_up_to_get(&dl->reorder, out_mb, capacity, en_priv->state.rx_reord);\n+\tcapacity -= nb_out;\n+\tout_mb = &out_mb[nb_out];\n+\n+\t/*\n+\t *   - all stored PDCP SDU(s) with consecutively associated COUNT value(s) starting from\n+\t *     RX_REORD;\n+\t */\n+\tnb_seq = pdcp_reorder_get_sequential(&dl->reorder, out_mb, capacity);\n+\tnb_out += nb_seq;\n+\n+\t/*\n+\t * - update RX_DELIV to the COUNT value of the first PDCP SDU which has not been delivered\n+\t *   to upper layers, with COUNT value >= RX_REORD;\n+\t */\n+\ten_priv->state.rx_deliv = en_priv->state.rx_reord + nb_seq;\n+\n+\t/*\n+\t * - if RX_DELIV < RX_NEXT:\n+\t *   - update RX_REORD to RX_NEXT;\n+\t *   - start t-Reordering.\n+\t */\n+\tif (en_priv->state.rx_deliv < en_priv->state.rx_next) {\n+\t\ten_priv->state.rx_reord = en_priv->state.rx_next;\n+\t\tdl->t_reorder.state = TIMER_RUNNING;\n+\t\tdl->t_reorder.handle.start(dl->t_reorder.handle.timer, dl->t_reorder.handle.args);\n+\t} else {\n+\t\tdl->t_reorder.state = TIMER_EXPIRED;\n+\t}\n+\n+\treturn nb_out;\n+}\ndiff --git a/lib/pdcp/rte_pdcp.h b/lib/pdcp/rte_pdcp.h\nindex 9cdce7d3a4..c5b99dfa2b 100644\n--- a/lib/pdcp/rte_pdcp.h\n+++ b/lib/pdcp/rte_pdcp.h\n@@ -102,6 +102,7 @@ typedef void (*rte_pdcp_t_reordering_stop_cb_t)(void *timer, void *args);\n  *\n  * Configuration provided by user, that PDCP library will invoke according to timer behaviour.\n  */\n+/* Structure rte_pdcp_t_reordering 8< */\n struct rte_pdcp_t_reordering {\n \t/** Timer pointer, to be used in callback functions. */\n \tvoid *timer;\n@@ -112,6 +113,7 @@ struct rte_pdcp_t_reordering {\n \t/** Timer stop callback handle. */\n \trte_pdcp_t_reordering_stop_cb_t stop;\n };\n+/* >8 End of structure rte_pdcp_t_reordering. */\n \n /**\n  * PDCP entity configuration to be used for establishing an entity.\n@@ -338,8 +340,36 @@ rte_pdcp_pkt_post_process(const struct rte_pdcp_entity *entity,\n }\n \n /**\n- * The header 'rte_pdcp_group.h' depends on defines in 'rte_pdcp.h'. So include\n- * in the end.\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * 5.2.2.2 Actions when a t-Reordering expires\n+ *\n+ * When t-Reordering timer expires, PDCP is required to slide the reception\n+ * window by updating state variables such as RX_REORD & RX_DELIV.\n+ * PDCP would need to deliver some of the buffered packets\n+ * based on the state variables and conditions described.\n+ *\n+ * The expiry handle need to be invoked by the application when t-Reordering\n+ * timer expires. In addition to returning buffered packets, it may also restart\n+ * timer based on the state variables.\n+ *\n+ * @param entity\n+ *   Pointer to the *rte_pdcp_entity* for which the timer expired.\n+ * @param[out] out_mb\n+ *   The address of an array that can hold up to *rte_pdcp_entity.max_pkt_cache*\n+ *   pointers to *rte_mbuf* structures. Used to return buffered packets that are expired.\n+ * @return\n+ *   Number of packets returned in *out_mb* buffer.\n+ */\n+__rte_experimental\n+uint16_t\n+rte_pdcp_t_reordering_expiry_handle(const struct rte_pdcp_entity *entity,\n+\t\t\t\t    struct rte_mbuf *out_mb[]);\n+\n+/**\n+ * The header 'rte_pdcp_group.h' depends on defines in 'rte_pdcp.h'.\n+ * So include in the end.\n  */\n #include <rte_pdcp_group.h>\n \ndiff --git a/lib/pdcp/version.map b/lib/pdcp/version.map\nindex 97171f902e..4fd912fac0 100644\n--- a/lib/pdcp/version.map\n+++ b/lib/pdcp/version.map\n@@ -14,5 +14,7 @@ EXPERIMENTAL {\n \trte_pdcp_pkt_pre_process;\n \trte_pdcp_pkt_crypto_group;\n \n+\trte_pdcp_t_reordering_expiry_handle;\n+\n \tlocal: *;\n };\n",
    "prefixes": [
        "v6",
        "16/21"
    ]
}