get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 140038,
    "url": "http://patchwork.dpdk.org/api/patches/140038/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240513155911.31872-10-nandinipersad361@gmail.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": "<20240513155911.31872-10-nandinipersad361@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240513155911.31872-10-nandinipersad361@gmail.com",
    "date": "2024-05-13T15:59:11",
    "name": "[9/9] doc: reword rcu library section in prog guide",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "019525db8dde6653a707b1279aba094abf998536",
    "submitter": {
        "id": 3325,
        "url": "http://patchwork.dpdk.org/api/people/3325/?format=api",
        "name": "Nandini Persad",
        "email": "nandinipersad361@gmail.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240513155911.31872-10-nandinipersad361@gmail.com/mbox/",
    "series": [
        {
            "id": 31913,
            "url": "http://patchwork.dpdk.org/api/series/31913/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31913",
            "date": "2024-05-13T15:59:02",
            "name": "reowrd in prog guide",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/31913/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/140038/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/140038/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 355D043C49;\n\tMon, 13 May 2024 18:02:47 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AB62940E09;\n\tMon, 13 May 2024 18:01:47 +0200 (CEST)",
            "from mail-pg1-f169.google.com (mail-pg1-f169.google.com\n [209.85.215.169])\n by mails.dpdk.org (Postfix) with ESMTP id E0AF7402CD\n for <dev@dpdk.org>; Mon, 13 May 2024 17:59:57 +0200 (CEST)",
            "by mail-pg1-f169.google.com with SMTP id\n 41be03b00d2f7-517ab9a4a13so3440523a12.1\n for <dev@dpdk.org>; Mon, 13 May 2024 08:59:57 -0700 (PDT)",
            "from localhost.localdomain (syn-076-032-089-124.res.spectrum.com.\n [76.32.89.124]) by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-6f4d2aa16dfsm7715078b3a.93.2024.05.13.08.59.55\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 13 May 2024 08:59:56 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1715615997; x=1716220797; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=T2339Pngb3r3wo/CbMvWf8rKDOelCDWZBIBkcmNg/WM=;\n b=Llefj26Pn+/AkQwZwcmWkrvAlzwQdMp1MUBgPDtJnSEziX5oLp+RKbkmD/icvB22Tt\n X2DYFlteboQ5e2HqdyjZ79spBAxY3SoX+60eq0jt+86orWR8TC5Q/R3mfEzob95uiXoZ\n ZxaNbL/mfHrdAIjv+NHztN7ujLvmeF9E4MShM/4jQhCiCYCjHqxscXQCWNLJzHHYZcsZ\n /wdqeDFCSxVKhIzY/WJZe2GhLWnI5KXm/on0B6tu7iz1APlVdZKdA9NMzAKd/Y9ejO4O\n W4nirPCSo6VJeUp/5n1pcK4tMfWZt1k7Adj3toWpqjLWQ3dgorYN2UWJ5tnaQenNumLh\n F5Qg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1715615997; x=1716220797;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=T2339Pngb3r3wo/CbMvWf8rKDOelCDWZBIBkcmNg/WM=;\n b=f5J3irO7zoTZY/LDjJIK1JwYw7HqZRePYQui8F8G0VYUyqd6DC7LZVyB/cPadACUVR\n I1aJQvUvQcUYj1Ohp2eX2Fq2eGKZqaLWj50m/rZSkckpBDdssP0MHdtmaZGWJqXQWAz0\n SnQmttOsQVNp60utgURIK8DOCwEf7shAPhcNy0Tfh1dO9ohzUuEID+bdDq9Y/ODSD6wL\n am7WE1WJPj+5DfZJME2WWF/DbphIhw0NSnwS8hjqyxqUOa1yfKx/OmMTFbuMJJ2EjQ8f\n OPqNauOwk9hyMhC8gmRRIdx/6pODDP9sR8IYHiIwtfaqfTq+IXzTeVMTMXMTknIjmqII\n ShbQ==",
        "X-Gm-Message-State": "AOJu0YwAFsXdS2JcF3z8ei7sogNnkNI8Iu//Neqd0a6OAjMOO9ST09fM\n yyq30eEeuXsbe7dkJ7IzvyH8+T1IHiAlvMPOO8mSODPitkQCNmLyyCQyTQ==",
        "X-Google-Smtp-Source": "\n AGHT+IFtQOpXAPTYXYUHWGHTyjJHivw6VspSEvPZNPOysEhKKPJXfOwFA2j79LQJC+mwgBRFb0+SDQ==",
        "X-Received": "by 2002:a05:6a20:a125:b0:1af:667e:fe3f with SMTP id\n adf61e73a8af0-1afde09f770mr14028259637.3.1715615996652;\n Mon, 13 May 2024 08:59:56 -0700 (PDT)",
        "From": "Nandini Persad <nandinipersad361@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>",
        "Subject": "[PATCH 9/9] doc: reword rcu library section in prog guide",
        "Date": "Mon, 13 May 2024 08:59:11 -0700",
        "Message-Id": "<20240513155911.31872-10-nandinipersad361@gmail.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240513155911.31872-1-nandinipersad361@gmail.com>",
        "References": "<20240513155911.31872-1-nandinipersad361@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Mon, 13 May 2024 18:01:34 +0200",
        "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": "simple syntax changes made to rcu library sectionin programmer's guide\n\nSigned-off-by: Nandini Persad <nandinipersad361@gmail.com>\n---\n doc/guides/prog_guide/rcu_lib.rst | 77 ++++++++++++++++---------------\n 1 file changed, 40 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/doc/guides/prog_guide/rcu_lib.rst b/doc/guides/prog_guide/rcu_lib.rst\nindex d0aef3bc16..c7ae349184 100644\n--- a/doc/guides/prog_guide/rcu_lib.rst\n+++ b/doc/guides/prog_guide/rcu_lib.rst\n@@ -8,17 +8,17 @@ RCU Library\n \n Lockless data structures provide scalability and determinism.\n They enable use cases where locking may not be allowed\n-(for example real-time applications).\n+(for example, real-time applications).\n \n In the following sections, the term \"memory\" refers to memory allocated\n by typical APIs like malloc() or anything that is representative of\n-memory, for example an index of a free element array.\n+memory. An example of this is an index of a free element array.\n \n Since these data structures are lockless, the writers and readers\n are accessing the data structures concurrently. Hence, while removing\n an element from a data structure, the writers cannot return the memory\n-to the allocator, without knowing that the readers are not\n-referencing that element/memory anymore. Hence, it is required to\n+to the allocator without knowing that the readers are not\n+referencing that element/memory anymore. Therefore, it is required to\n separate the operation of removing an element into two steps:\n \n #. Delete: in this step, the writer removes the reference to the element from\n@@ -64,19 +64,19 @@ quiescent state. Reader thread 3 was not accessing D1 when the delete\n operation happened. So, reader thread 3 will not have a reference to the\n deleted entry.\n \n-It can be noted that, the critical sections for D2 is a quiescent state\n-for D1. i.e. for a given data structure Dx, any point in the thread execution\n-that does not reference Dx is a quiescent state.\n+Note that the critical sections for D2 is a quiescent state\n+for D1 (i.e. for a given data structure Dx, any point in the thread execution\n+that does not reference Dx is a quiescent state).\n \n Since memory is not freed immediately, there might be a need for\n-provisioning of additional memory, depending on the application requirements.\n+provisioning additional memory depending on the application requirements.\n \n Factors affecting the RCU mechanism\n -----------------------------------\n \n It is important to make sure that this library keeps the overhead of\n-identifying the end of grace period and subsequent freeing of memory,\n-to a minimum. The following paras explain how grace period and critical\n+identifying the end of grace period and subsequent freeing of memory\n+to a minimum. The following paragraphs explain how grace period and critical\n section affect this overhead.\n \n The writer has to poll the readers to identify the end of grace period.\n@@ -119,14 +119,14 @@ How to use this library\n The application must allocate memory and initialize a QS variable.\n \n Applications can call ``rte_rcu_qsbr_get_memsize()`` to calculate the size\n-of memory to allocate. This API takes a maximum number of reader threads,\n-using this variable, as a parameter.\n+of memory to allocate. This API takes a maximum number of reader threads\n+using this variable as a parameter.\n \n Further, the application can initialize a QS variable using the API\n ``rte_rcu_qsbr_init()``.\n \n Each reader thread is assumed to have a unique thread ID. Currently, the\n-management of the thread ID (for example allocation/free) is left to the\n+management of the thread ID (for example, allocation/free) is left to the\n application. The thread ID should be in the range of 0 to\n maximum number of threads provided while creating the QS variable.\n The application could also use ``lcore_id`` as the thread ID where applicable.\n@@ -134,13 +134,13 @@ The application could also use ``lcore_id`` as the thread ID where applicable.\n The ``rte_rcu_qsbr_thread_register()`` API will register a reader thread\n to report its quiescent state. This can be called from a reader thread.\n A control plane thread can also call this on behalf of a reader thread.\n-The reader thread must call ``rte_rcu_qsbr_thread_online()`` API to start\n+The reader thread must call the ``rte_rcu_qsbr_thread_online()`` API to start\n reporting its quiescent state.\n \n Some of the use cases might require the reader threads to make blocking API\n-calls (for example while using eventdev APIs). The writer thread should not\n+calls (for example, while using eventdev APIs). The writer thread should not\n wait for such reader threads to enter quiescent state.  The reader thread must\n-call ``rte_rcu_qsbr_thread_offline()`` API, before calling blocking APIs. It\n+call ``rte_rcu_qsbr_thread_offline()`` API before calling blocking APIs. It\n can call ``rte_rcu_qsbr_thread_online()`` API once the blocking API call\n returns.\n \n@@ -149,13 +149,13 @@ state by calling the API ``rte_rcu_qsbr_start()``. It is possible for multiple\n writer threads to query the quiescent state status simultaneously. Hence,\n ``rte_rcu_qsbr_start()`` returns a token to each caller.\n \n-The writer thread must call ``rte_rcu_qsbr_check()`` API with the token to\n-get the current quiescent state status. Option to block till all the reader\n+The writer thread must call the ``rte_rcu_qsbr_check()`` API with the token to\n+get the current quiescent state status. The option to block till all the reader\n threads enter the quiescent state is provided. If this API indicates that\n all the reader threads have entered the quiescent state, the application\n can free the deleted entry.\n \n-The APIs ``rte_rcu_qsbr_start()`` and ``rte_rcu_qsbr_check()`` are lock free.\n+The APIs ``rte_rcu_qsbr_start()`` and ``rte_rcu_qsbr_check()`` are lock-free.\n Hence, they can be called concurrently from multiple writers even while\n running as worker threads.\n \n@@ -173,7 +173,7 @@ polls till all the readers enter the quiescent state or go offline. This API\n does not allow the writer to do useful work while waiting and introduces\n additional memory accesses due to continuous polling. However, the application\n does not have to store the token or the reference to the deleted resource. The\n-resource can be freed immediately after ``rte_rcu_qsbr_synchronize()`` API\n+resource can be freed immediately after the ``rte_rcu_qsbr_synchronize()`` API\n returns.\n \n The reader thread must call ``rte_rcu_qsbr_thread_offline()`` and\n@@ -181,9 +181,9 @@ The reader thread must call ``rte_rcu_qsbr_thread_offline()`` and\n quiescent state. The ``rte_rcu_qsbr_check()`` API will not wait for this reader\n thread to report the quiescent state status anymore.\n \n-The reader threads should call ``rte_rcu_qsbr_quiescent()`` API to indicate that\n+The reader threads should call the ``rte_rcu_qsbr_quiescent()`` API to indicate that\n they entered a quiescent state. This API checks if a writer has triggered a\n-quiescent state query and update the state accordingly.\n+quiescent state query and updates the state accordingly.\n \n The ``rte_rcu_qsbr_lock()`` and ``rte_rcu_qsbr_unlock()`` are empty functions.\n However, these APIs can aid in debugging issues. One can mark the access to\n@@ -203,40 +203,43 @@ the application. When a writer deletes an entry from a data structure, the write\n There are several APIs provided to help with this process. The writer\n can create a FIFO to store the references to deleted resources using ``rte_rcu_qsbr_dq_create()``.\n The resources can be enqueued to this FIFO using ``rte_rcu_qsbr_dq_enqueue()``.\n-If the FIFO is full, ``rte_rcu_qsbr_dq_enqueue`` will reclaim the resources before enqueuing. It will also reclaim resources on regular basis to keep the FIFO from growing too large. If the writer runs out of resources, the writer can call ``rte_rcu_qsbr_dq_reclaim`` API to reclaim resources. ``rte_rcu_qsbr_dq_delete`` is provided to reclaim any remaining resources and free the FIFO while shutting down.\n+If the FIFO is full, ``rte_rcu_qsbr_dq_enqueue`` will reclaim the resources before enqueuing.\n+It will also reclaim resources on regular basis to keep the FIFO from growing too large. If the writer runs out of resources, the writer can call ``rte_rcu_qsbr_dq_reclaim`` API to reclaim resources. ``rte_rcu_qsbr_dq_delete`` is provided to reclaim any remaining resources and free the FIFO while shutting down.\n \n However, if this resource reclamation process were to be integrated in lock-free data structure libraries, it\n-hides this complexity from the application and makes it easier for the application to adopt lock-free algorithms. The following paragraphs discuss how the reclamation process can be integrated in DPDK libraries.\n+hides this complexity from the application and makes it easier for the application to adopt lock-free algorithms.\n+\n+The following paragraphs discuss how the reclamation process can be integrated in DPDK libraries.\n \n In any DPDK application, the resource reclamation process using QSBR can be split into 4 parts:\n \n #. Initialization\n #. Quiescent State Reporting\n-#. Reclaiming Resources\n+#. Reclaiming Resources*\n #. Shutdown\n \n The design proposed here assigns different parts of this process to client libraries and applications. The term 'client library' refers to lock-free data structure libraries such at rte_hash, rte_lpm etc. in DPDK or similar libraries outside of DPDK. The term 'application' refers to the packet processing application that makes use of DPDK such as L3 Forwarding example application, OVS, VPP etc..\n \n-The application has to handle 'Initialization' and 'Quiescent State Reporting'. So,\n+The application must handle 'Initialization' and 'Quiescent State Reporting'. Therefore, the application:\n \n-* the application has to create the RCU variable and register the reader threads to report their quiescent state.\n-* the application has to register the same RCU variable with the client library.\n-* reader threads in the application have to report the quiescent state. This allows for the application to control the length of the critical section/how frequently the application wants to report the quiescent state.\n+* Must create the RCU variable and register the reader threads to report their quiescent state.\n+* Must register the same RCU variable with the client library.\n+* Note that reader threads in the application have to report the quiescent state. This allows for the application to control the length of the critical section/how frequently the application wants to report the quiescent state.\n \n-The client library will handle 'Reclaiming Resources' part of the process. The\n+The client library will handle the 'Reclaiming Resources' part of the process. The\n client libraries will make use of the writer thread context to execute the memory\n-reclamation algorithm. So,\n+reclamation algorithm. So, the client library should:\n \n-* client library should provide an API to register a RCU variable that it will use. It should call ``rte_rcu_qsbr_dq_create()`` to create the FIFO to store the references to deleted entries.\n-* client library should use ``rte_rcu_qsbr_dq_enqueue`` to enqueue the deleted resources on the FIFO and start the grace period.\n-* if the library runs out of resources while adding entries, it should call ``rte_rcu_qsbr_dq_reclaim`` to reclaim the resources and try the resource allocation again.\n+* Provide an API to register a RCU variable that it will use. It should call ``rte_rcu_qsbr_dq_create()`` to create the FIFO to store the references to deleted entries.\n+* Use ``rte_rcu_qsbr_dq_enqueue`` to enqueue the deleted resources on the FIFO and start the grace period.\n+* Note that if the library runs out of resources while adding entries, it should call ``rte_rcu_qsbr_dq_reclaim`` to reclaim the resources and try the resource allocation again.\n \n The 'Shutdown' process needs to be shared between the application and the\n-client library.\n+client library. Note that:\n \n-* the application should make sure that the reader threads are not using the shared data structure, unregister the reader threads from the QSBR variable before calling the client library's shutdown function.\n+* The application should make sure that the reader threads are not using the shared data structure, unregister the reader threads from the QSBR variable before calling the client library's shutdown function.\n \n-* client library should call ``rte_rcu_qsbr_dq_delete`` to reclaim any remaining resources and free the FIFO.\n+* The client library should call ``rte_rcu_qsbr_dq_delete`` to reclaim any remaining resources and free the FIFO.\n \n Integrating the resource reclamation with client libraries removes the burden from\n the application and makes it easy to use lock-free algorithms.\n",
    "prefixes": [
        "9/9"
    ]
}