get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 127347,
    "url": "http://patches.dpdk.org/api/patches/127347/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230524160116.304-17-anoobj@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20230524160116.304-17-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230524160116.304-17-anoobj@marvell.com",
    "date": "2023-05-24T16:01:10",
    "name": "[v3,16/22] pdcp: add timer expiry handle",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "72a413d27063bdab3176942d10f1f1cbc5f5a726",
    "submitter": {
        "id": 1205,
        "url": "http://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230524160116.304-17-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 28158,
            "url": "http://patches.dpdk.org/api/series/28158/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28158",
            "date": "2023-05-24T16:00:54",
            "name": "lib: add pdcp protocol",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/28158/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/127347/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/127347/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 83A9442B8F;\n\tWed, 24 May 2023 18:04:37 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A866842D5F;\n\tWed, 24 May 2023 18:02:42 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 19CDA42D42\n for <dev@dpdk.org>; Wed, 24 May 2023 18:02:39 +0200 (CEST)",
            "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 34OEgC72025096; Wed, 24 May 2023 09:02:38 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3qsbxetjyv-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 24 May 2023 09:02:38 -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 Wed, 24 May 2023 09:02:36 -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; Wed, 24 May 2023 09:02:36 -0700",
            "from BG-LT92004.corp.innovium.com (unknown [10.28.161.183])\n by maili.marvell.com (Postfix) with ESMTP id 893CF3F7044;\n Wed, 24 May 2023 09:02:32 -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=Q1zjzptaIEA//7QO6sBNDarGU5TuhsUDo/PIbwzcjFg=;\n b=QWIpa4k52AYOxMNqvQo2YjkFB3a2NzJ4teniKhbBnmFBJDhkxK1yQ2l/sQqwiwOsg9mQ\n wwf9rpKVxo0IwfsCCvGkq1OYY8CDAdh6UpXuDWHp5+8WZqCagFQT1zNLw2JBsApOqGpp\n lM3DSB05lpj7aQOCBETaHGOO1R6E+btg6X/wnpvh6JQQc3eQuXdDurHD3t0jBVOt8P0t\n QLwVKQ6CuPfDp0GxCRpV+NWTbqYgVpkj/vD/LAOWnXKS1Ay6p2yTs3tL4ZrOcXUX0FVp\n E9Xo3dZvdv8Lxuih7Rpp/Qf0ntVH1A+8c4IL7mCB8MA/6SY6l3Kw0oecFarq8ulYzoI8 rA==",
        "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>, Bernard Iremonger\n <bernard.iremonger@intel.com>",
        "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>",
        "Subject": "[PATCH v3 16/22] pdcp: add timer expiry handle",
        "Date": "Wed, 24 May 2023 21:31:10 +0530",
        "Message-ID": "<20230524160116.304-17-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230524160116.304-1-anoobj@marvell.com>",
        "References": "<20230414174512.642-1-anoobj@marvell.com>\n <20230524160116.304-1-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "YS3lewor_R5yGVtRu_284yQkyxo0TwoU",
        "X-Proofpoint-GUID": "YS3lewor_R5yGVtRu_284yQkyxo0TwoU",
        "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-24_11,2023-05-24_01,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 | 30 ++++++++++++++++++\n lib/pdcp/rte_pdcp.c                | 49 ++++++++++++++++++++++++++++++\n lib/pdcp/rte_pdcp.h                | 31 +++++++++++++++++++\n lib/pdcp/version.map               |  2 ++\n 4 files changed, 112 insertions(+)",
    "diff": "diff --git a/doc/guides/prog_guide/pdcp_lib.rst b/doc/guides/prog_guide/pdcp_lib.rst\nindex dcb424bb1d..16deaead15 100644\n--- a/doc/guides/prog_guide/pdcp_lib.rst\n+++ b/doc/guides/prog_guide/pdcp_lib.rst\n@@ -130,6 +130,36 @@ Supported integrity protection algorithms\n - SNOW3G-AUTH\n - ZUC-AUTH\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. Any missing\n+packet would mean RX_DELIV won't be updated. A timer, t-Reordering, helps PDCP\n+to slide the window if the missing packet is not received in a specified time\n+duration.\n+\n+While starting and stopping the timer need to be done by lib PDCP, application\n+could register its own timer implementation. This is to make sure application\n+can choose between timers such as rte_timer and rte_event based timers. Starting\n+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. Expiry handling would\n+involve sliding the window by updating state variables and passing the expired\n+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 1ee9511cd4..32ec8bc8f1 100644\n--- a/lib/pdcp/rte_pdcp.c\n+++ b/lib/pdcp/rte_pdcp.c\n@@ -228,3 +228,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 5d3e38a668..76ec569577 100644\n--- a/lib/pdcp/rte_pdcp.h\n+++ b/lib/pdcp/rte_pdcp.h\n@@ -101,6 +101,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, stored for later use in callback functions */\n \tvoid *timer;\n@@ -111,6 +112,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@@ -339,6 +341,35 @@ rte_pdcp_pkt_post_process(const struct rte_pdcp_entity *entity,\n \treturn entity->post_process(entity, in_mb, out_mb, num, nb_err);\n }\n \n+/**\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. PDCP would\n+ * need to deliver some of the buffered packets based on the state variables and\n+ * 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\n+ *   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 #include <rte_pdcp_group.h>\n \n #ifdef __cplusplus\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": [
        "v3",
        "16/22"
    ]
}