get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74114,
    "url": "http://patches.dpdk.org/api/patches/74114/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200715145815.27132-3-konstantin.ananyev@intel.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": "<20200715145815.27132-3-konstantin.ananyev@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200715145815.27132-3-konstantin.ananyev@intel.com",
    "date": "2020-07-15T14:58:15",
    "name": "[v5,2/2] mempool/ring: add support for new ring sync modes",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "477338b4ca86a3009c42d163e967eb8f10ab9858",
    "submitter": {
        "id": 33,
        "url": "http://patches.dpdk.org/api/people/33/?format=api",
        "name": "Ananyev, Konstantin",
        "email": "konstantin.ananyev@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200715145815.27132-3-konstantin.ananyev@intel.com/mbox/",
    "series": [
        {
            "id": 11055,
            "url": "http://patches.dpdk.org/api/series/11055/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11055",
            "date": "2020-07-15T14:58:13",
            "name": "mempool/ring: add support for new ring sync modes",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/11055/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74114/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/74114/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BB211A0547;\n\tWed, 15 Jul 2020 16:58:45 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 568881BEB1;\n\tWed, 15 Jul 2020 16:58:42 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by dpdk.org (Postfix) with ESMTP id 675961BEAC\n for <dev@dpdk.org>; Wed, 15 Jul 2020 16:58:39 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Jul 2020 07:58:39 -0700",
            "from sivswdev08.ir.intel.com ([10.237.217.47])\n by fmsmga008.fm.intel.com with ESMTP; 15 Jul 2020 07:58:37 -0700"
        ],
        "IronPort-SDR": [
            "\n 8ki8vE66uDc4XXjVfBcWD7sqwfxXWxnktFW8NLn+g+3DWDkdyh8M+lETtNvOD0EXQhD5dWnZwY\n CuMlySbVz/QA==",
            "\n FHeUU0QyIggY5ZnzUOTYWyiYy1vdccz0ayVGTf1jm8GbfrARCSLaQgyEcIYTbxfLdwMssNpVq4\n oLsc43QxfqLg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9683\"; a=\"146669955\"",
            "E=Sophos;i=\"5.75,355,1589266800\"; d=\"scan'208\";a=\"146669955\"",
            "E=Sophos;i=\"5.75,355,1589266800\"; d=\"scan'208\";a=\"270291179\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "olivier.matz@6wind.com, arybchenko@solarflare.com, jielong.zjl@antfin.com,\n gage.eads@intel.com, thomas@monjalon.net,\n Konstantin Ananyev <konstantin.ananyev@intel.com>",
        "Date": "Wed, 15 Jul 2020 15:58:15 +0100",
        "Message-Id": "<20200715145815.27132-3-konstantin.ananyev@intel.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<20200715145815.27132-1-konstantin.ananyev@intel.com>",
        "References": "<20200713155050.27743-1-konstantin.ananyev@intel.com>\n <20200715145815.27132-1-konstantin.ananyev@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 2/2] mempool/ring: add support for new ring\n\tsync modes",
        "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 <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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Two new sync modes were introduced into rte_ring:\nrelaxed tail sync (RTS) and head/tail sync (HTS).\nThis change provides user with ability to select these\nmodes for ring based mempool via mempool ops API.\n\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\nAcked-by: Gage Eads <gage.eads@intel.com>\n---\n doc/guides/mempool/ring.rst             | 22 ++++++-\n doc/guides/prog_guide/ring_lib.rst      |  8 +++\n doc/guides/rel_notes/release_20_08.rst  |  6 ++\n drivers/mempool/ring/rte_mempool_ring.c | 88 ++++++++++++++++++++++---\n 4 files changed, 113 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/doc/guides/mempool/ring.rst b/doc/guides/mempool/ring.rst\nindex b8659c03f..ca03180ea 100644\n--- a/doc/guides/mempool/ring.rst\n+++ b/doc/guides/mempool/ring.rst\n@@ -12,12 +12,14 @@ and can be selected via mempool ops API:\n - ``ring_mp_mc``\n \n   Underlying **rte_ring** operates in multi-thread producer,\n-  multi-thread consumer sync mode.\n+  multi-thread consumer sync mode. For more information please refer to:\n+  :ref:`Ring_Library_MPMC_Mode`.\n \n - ``ring_sp_sc``\n \n   Underlying **rte_ring** operates in single-thread producer,\n-  single-thread consumer sync mode.\n+  single-thread consumer sync mode. For more information please refer to:\n+  :ref:`Ring_Library_SPSC_Mode`.\n \n - ``ring_sp_mc``\n \n@@ -29,6 +31,22 @@ and can be selected via mempool ops API:\n   Underlying **rte_ring** operates in multi-thread producer,\n   single-thread consumer sync mode.\n \n+- ``ring_mt_rts``\n+\n+  For underlying **rte_ring** both producer and consumer operate in\n+  multi-thread Relaxed Tail Sync (RTS) mode. For more information please\n+  refer to: :ref:`Ring_Library_MT_RTS_Mode`.\n+\n+- ``ring_mt_hts``\n+\n+  For underlying **rte_ring** both producer and consumer operate in\n+  multi-thread Head-Tail Sync (HTS) mode. For more information please\n+  refer to: :ref:`Ring_Library_MT_HTS_Mode`.\n+\n \n+For 'classic' DPDK deployments (with one thread per core) ``ring_mp_mc``\n+mode is usually the most suitable and the fastest one. For overcommitted\n+scenarios (multiple threads share same set of cores) ``ring_mt_rts`` or\n+``ring_mt_hts`` usually provide a better alternative.\n For more information about ``rte_ring`` structure, behaviour and available\n synchronisation modes please refer to: :doc:`../prog_guide/ring_lib`.\ndiff --git a/doc/guides/prog_guide/ring_lib.rst b/doc/guides/prog_guide/ring_lib.rst\nindex f0a5a78b0..895484d95 100644\n--- a/doc/guides/prog_guide/ring_lib.rst\n+++ b/doc/guides/prog_guide/ring_lib.rst\n@@ -359,6 +359,8 @@ That should help users to configure ring in the most suitable way for his\n specific usage scenarios.\n Currently supported modes:\n \n+.. _Ring_Library_MPMC_Mode:\n+\n MP/MC (default one)\n ~~~~~~~~~~~~~~~~~~~\n \n@@ -369,11 +371,15 @@ per core) this is usually the most suitable and fastest synchronization mode.\n As a well known limitation - it can perform quite pure on some overcommitted\n scenarios.\n \n+.. _Ring_Library_SPSC_Mode:\n+\n SP/SC\n ~~~~~\n Single-producer (/single-consumer) mode. In this mode only one thread at a time\n is allowed to enqueue (/dequeue) objects to (/from) the ring.\n \n+.. _Ring_Library_MT_RTS_Mode:\n+\n MP_RTS/MC_RTS\n ~~~~~~~~~~~~~\n \n@@ -390,6 +396,8 @@ one for head update, second for tail update.\n In comparison the original MP/MC algorithm requires one 32-bit CAS\n for head update and waiting/spinning on tail value.\n \n+.. _Ring_Library_MT_HTS_Mode:\n+\n MP_HTS/MC_HTS\n ~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst\nindex 17d70e7c1..db25c6f9c 100644\n--- a/doc/guides/rel_notes/release_20_08.rst\n+++ b/doc/guides/rel_notes/release_20_08.rst\n@@ -69,6 +69,12 @@ New Features\n   barriers. rte_*mb APIs, for ARMv8 platforms, are changed to use DMB\n   instruction to reflect this.\n \n+* **Added support for new sync modes into mempool ring driver.**\n+\n+  Added ability to select new ring synchronisation modes:\n+  ``relaxed tail sync (ring_mt_rts)`` and ``head/tail sync (ring_mt_hts)``\n+  via mempool ops API.\n+\n * **Added the support for vfio-pci new VF token interface.**\n \n   From Linux 5.7, vfio-pci supports to bind both SR-IOV PF and the created VFs,\ndiff --git a/drivers/mempool/ring/rte_mempool_ring.c b/drivers/mempool/ring/rte_mempool_ring.c\nindex bc123fc52..b1f09ff28 100644\n--- a/drivers/mempool/ring/rte_mempool_ring.c\n+++ b/drivers/mempool/ring/rte_mempool_ring.c\n@@ -25,6 +25,22 @@ common_ring_sp_enqueue(struct rte_mempool *mp, void * const *obj_table,\n \t\t\tobj_table, n, NULL) == 0 ? -ENOBUFS : 0;\n }\n \n+static int\n+rts_ring_mp_enqueue(struct rte_mempool *mp, void * const *obj_table,\n+\tunsigned int n)\n+{\n+\treturn rte_ring_mp_rts_enqueue_bulk(mp->pool_data,\n+\t\t\tobj_table, n, NULL) == 0 ? -ENOBUFS : 0;\n+}\n+\n+static int\n+hts_ring_mp_enqueue(struct rte_mempool *mp, void * const *obj_table,\n+\tunsigned int n)\n+{\n+\treturn rte_ring_mp_hts_enqueue_bulk(mp->pool_data,\n+\t\t\tobj_table, n, NULL) == 0 ? -ENOBUFS : 0;\n+}\n+\n static int\n common_ring_mc_dequeue(struct rte_mempool *mp, void **obj_table, unsigned n)\n {\n@@ -39,17 +55,30 @@ common_ring_sc_dequeue(struct rte_mempool *mp, void **obj_table, unsigned n)\n \t\t\tobj_table, n, NULL) == 0 ? -ENOBUFS : 0;\n }\n \n+static int\n+rts_ring_mc_dequeue(struct rte_mempool *mp, void **obj_table, unsigned int n)\n+{\n+\treturn rte_ring_mc_rts_dequeue_bulk(mp->pool_data,\n+\t\t\tobj_table, n, NULL) == 0 ? -ENOBUFS : 0;\n+}\n+\n+static int\n+hts_ring_mc_dequeue(struct rte_mempool *mp, void **obj_table, unsigned int n)\n+{\n+\treturn rte_ring_mc_hts_dequeue_bulk(mp->pool_data,\n+\t\t\tobj_table, n, NULL) == 0 ? -ENOBUFS : 0;\n+}\n+\n static unsigned\n common_ring_get_count(const struct rte_mempool *mp)\n {\n \treturn rte_ring_count(mp->pool_data);\n }\n \n-\n static int\n-common_ring_alloc(struct rte_mempool *mp)\n+ring_alloc(struct rte_mempool *mp, uint32_t rg_flags)\n {\n-\tint rg_flags = 0, ret;\n+\tint ret;\n \tchar rg_name[RTE_RING_NAMESIZE];\n \tstruct rte_ring *r;\n \n@@ -60,12 +89,6 @@ common_ring_alloc(struct rte_mempool *mp)\n \t\treturn -rte_errno;\n \t}\n \n-\t/* ring flags */\n-\tif (mp->flags & MEMPOOL_F_SP_PUT)\n-\t\trg_flags |= RING_F_SP_ENQ;\n-\tif (mp->flags & MEMPOOL_F_SC_GET)\n-\t\trg_flags |= RING_F_SC_DEQ;\n-\n \t/*\n \t * Allocate the ring that will be used to store objects.\n \t * Ring functions will return appropriate errors if we are\n@@ -82,6 +105,31 @@ common_ring_alloc(struct rte_mempool *mp)\n \treturn 0;\n }\n \n+static int\n+common_ring_alloc(struct rte_mempool *mp)\n+{\n+\tuint32_t rg_flags = 0;\n+\n+\tif (mp->flags & MEMPOOL_F_SP_PUT)\n+\t\trg_flags |= RING_F_SP_ENQ;\n+\tif (mp->flags & MEMPOOL_F_SC_GET)\n+\t\trg_flags |= RING_F_SC_DEQ;\n+\n+\treturn ring_alloc(mp, rg_flags);\n+}\n+\n+static int\n+rts_ring_alloc(struct rte_mempool *mp)\n+{\n+\treturn ring_alloc(mp, RING_F_MP_RTS_ENQ | RING_F_MC_RTS_DEQ);\n+}\n+\n+static int\n+hts_ring_alloc(struct rte_mempool *mp)\n+{\n+\treturn ring_alloc(mp, RING_F_MP_HTS_ENQ | RING_F_MC_HTS_DEQ);\n+}\n+\n static void\n common_ring_free(struct rte_mempool *mp)\n {\n@@ -130,7 +178,29 @@ static const struct rte_mempool_ops ops_sp_mc = {\n \t.get_count = common_ring_get_count,\n };\n \n+/* ops for mempool with ring in MT_RTS sync mode */\n+static const struct rte_mempool_ops ops_mt_rts = {\n+\t.name = \"ring_mt_rts\",\n+\t.alloc = rts_ring_alloc,\n+\t.free = common_ring_free,\n+\t.enqueue = rts_ring_mp_enqueue,\n+\t.dequeue = rts_ring_mc_dequeue,\n+\t.get_count = common_ring_get_count,\n+};\n+\n+/* ops for mempool with ring in MT_HTS sync mode */\n+static const struct rte_mempool_ops ops_mt_hts = {\n+\t.name = \"ring_mt_hts\",\n+\t.alloc = hts_ring_alloc,\n+\t.free = common_ring_free,\n+\t.enqueue = hts_ring_mp_enqueue,\n+\t.dequeue = hts_ring_mc_dequeue,\n+\t.get_count = common_ring_get_count,\n+};\n+\n MEMPOOL_REGISTER_OPS(ops_mp_mc);\n MEMPOOL_REGISTER_OPS(ops_sp_sc);\n MEMPOOL_REGISTER_OPS(ops_mp_sc);\n MEMPOOL_REGISTER_OPS(ops_sp_mc);\n+MEMPOOL_REGISTER_OPS(ops_mt_rts);\n+MEMPOOL_REGISTER_OPS(ops_mt_hts);\n",
    "prefixes": [
        "v5",
        "2/2"
    ]
}