Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/73968/?format=api
http://patches.dpdk.org/api/patches/73968/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200713155050.27743-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": "<20200713155050.27743-3-konstantin.ananyev@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200713155050.27743-3-konstantin.ananyev@intel.com", "date": "2020-07-13T15:50:50", "name": "[v4,2/2] mempool/ring: add support for new ring sync modes", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "cd92732a5db183ebdccb15f0bf4170c594f2f434", "submitter": { "id": 33, "url": "http://patches.dpdk.org/api/people/33/?format=api", "name": "Ananyev, Konstantin", "email": "konstantin.ananyev@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200713155050.27743-3-konstantin.ananyev@intel.com/mbox/", "series": [ { "id": 11005, "url": "http://patches.dpdk.org/api/series/11005/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11005", "date": "2020-07-13T15:50:48", "name": "mempool/ring: add support for new ring sync modes", "version": 4, "mbox": "http://patches.dpdk.org/series/11005/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/73968/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/73968/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 D4A3EA0540;\n\tMon, 13 Jul 2020 17:52:18 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B54E11D8E7;\n\tMon, 13 Jul 2020 17:52:18 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by dpdk.org (Postfix) with ESMTP id EAA371D8DB\n for <dev@dpdk.org>; Mon, 13 Jul 2020 17:52:16 +0200 (CEST)", "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Jul 2020 08:52:16 -0700", "from sivswdev08.ir.intel.com ([10.237.217.47])\n by orsmga005.jf.intel.com with ESMTP; 13 Jul 2020 08:52:14 -0700" ], "IronPort-SDR": [ "\n gov+vT4llvCcf7h1H8gs/vCsG2uOr6q+2X9dgO6ITTrwkHUbGVK1cWMjI7j1duqVoR+4u4kunU\n /RC2EikZjWHw==", "\n U+7wSWujXehS/9MeACY8it2qaKddZ4CgiFJHgn4LJ6p/n+8HFe8Sm8slqMmKEqJEDnVqtFOpPE\n J2Ks+CRb74Hg==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9681\"; a=\"148639384\"", "E=Sophos;i=\"5.75,347,1589266800\"; d=\"scan'208\";a=\"148639384\"", "E=Sophos;i=\"5.75,347,1589266800\"; d=\"scan'208\";a=\"459340634\"" ], "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": "Mon, 13 Jul 2020 16:50:50 +0100", "Message-Id": "<20200713155050.27743-3-konstantin.ananyev@intel.com>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20200713155050.27743-1-konstantin.ananyev@intel.com>", "References": "<20200710162119.27653-1-konstantin.ananyev@intel.com>\n <20200713155050.27743-1-konstantin.ananyev@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 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 | 10 +++\n doc/guides/rel_notes/release_20_08.rst | 6 ++\n drivers/mempool/ring/rte_mempool_ring.c | 88 ++++++++++++++++++++++---\n 3 files changed, 95 insertions(+), 9 deletions(-)", "diff": "diff --git a/doc/guides/mempool/ring.rst b/doc/guides/mempool/ring.rst\nindex b8659c03f..9e2824070 100644\n--- a/doc/guides/mempool/ring.rst\n+++ b/doc/guides/mempool/ring.rst\n@@ -29,6 +29,16 @@ 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.\n+\n+- ``ring_mt_hts``\n+\n+ For underlying **rte_ring** both producer and consumer operate in\n+ multi-thread Haad-Tail Sync (HTS) mode.\n+\n \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/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": [ "v4", "2/2" ] }{ "id": 73968, "url": "