get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64444,
    "url": "http://patches.dpdk.org/api/patches/64444/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200111133410.2077135-1-jerinj@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": "<20200111133410.2077135-1-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200111133410.2077135-1-jerinj@marvell.com",
    "date": "2020-01-11T13:34:10",
    "name": "[v2] mempool: fix mempool obj alignment for non x86",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d8d03741d1ff60a294d65001e8fe51aa5a4974c6",
    "submitter": {
        "id": 1188,
        "url": "http://patches.dpdk.org/api/people/1188/?format=api",
        "name": "Jerin Jacob Kollanukkaran",
        "email": "jerinj@marvell.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/20200111133410.2077135-1-jerinj@marvell.com/mbox/",
    "series": [
        {
            "id": 8057,
            "url": "http://patches.dpdk.org/api/series/8057/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8057",
            "date": "2020-01-11T13:34:10",
            "name": "[v2] mempool: fix mempool obj alignment for non x86",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/8057/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64444/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/64444/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 8AA1BA04FB;\n\tSat, 11 Jan 2020 14:33:51 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A3B141E4B5;\n\tSat, 11 Jan 2020 14:33:49 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 9E9841E4A8;\n Sat, 11 Jan 2020 14:33:47 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 00BDX4uj024659; Sat, 11 Jan 2020 05:33:43 -0800",
            "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 2xfert02rr-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Sat, 11 Jan 2020 05:33:43 -0800",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 11 Jan\n 2020 05:33:41 -0800",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Sat, 11 Jan 2020 05:33:40 -0800",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id 709BE3F703F;\n Sat, 11 Jan 2020 05:33:37 -0800 (PST)"
        ],
        "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=pfpt0818;\n bh=2dg0F6SdV8aJjMYEs64cDTnsHKeEcifvFx6AiWCc4v0=;\n b=x7ZShLDonAdQCPGofc8wciBmvCl4vX+JyGBEjWyWeIsL3ckZ5Ynt42RHIsVc0NlT+rrp\n cvVR0hN/Y8MprdK9xQy9HAmhSzhkjKGpZPhalsX0wpr/d17L7tJoKi2TCPsm8Y7Sb4sZ\n nCekjZCc3eNG8FpMEty9Evx8UoB+h0V6oB7n32w/4lF3gOJEFAwuMa31EKSi5sfKlguk\n Dz4+vYCFj2q3cbOAfmikrDksiJFyn4ANb0e12r4zeyqHcEaR12gCyBRXpXxfWf0CuJTo\n jBEyijH1UmsQ96UwZfvYUiBj0XylDZXY58wo94SmfFnI2qr2DJGXZeHJCUkd+UHAK5WF dg==",
        "From": "<jerinj@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <olivier.matz@6wind.com>,\n <arybchenko@solarflare.com>, <bruce.richardson@intel.com>,\n <konstantin.ananyev@intel.com>, <hemant.agrawal@nxp.com>,\n <shahafs@mellanox.com>, <honnappa.nagarahalli@arm.com>,\n <gavin.hu@arm.com>, <viktorin@rehivetech.com>,\n <drc@linux.vnet.ibm.com>, <anatoly.burakov@intel.com>,\n Jerin Jacob <jerinj@marvell.com>, <stable@dpdk.org>",
        "Date": "Sat, 11 Jan 2020 19:04:10 +0530",
        "Message-ID": "<20200111133410.2077135-1-jerinj@marvell.com>",
        "X-Mailer": "git-send-email 2.24.1",
        "In-Reply-To": "<20191219134227.3841799-1-jerinj@marvell.com>",
        "References": "<20191219134227.3841799-1-jerinj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572\n definitions=2020-01-11_03:2020-01-10,\n 2020-01-11 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v2] mempool: fix mempool obj alignment for non x86",
        "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": "From: Jerin Jacob <jerinj@marvell.com>\n\nThe existing optimize_object_size() function address the memory object\nalignment constraint on x86 for better performance.\n\nDifferent (micro) architecture may have different memory alignment\nconstraint for better performance and it not the same as the existing\noptimize_object_size().\n\nSome use, XOR(kind of CRC) scheme to enable DRAM channel distribution\nbased on the address and some may have a different formula.\n\nIntroducing arch_mem_object_align() function to abstract\nthe difference between different (micro) architectures to avoid\nwasting memory for mempool object alignment for the architecture\nthat it is not required to do so.\n\nDetails on the amount of memory saving:\n\nCurrently, arm64 based architectures use the default (nchan=4,\nnrank=1). The worst case is for an object whose size (including mempool\nheader) is 2 cache lines, where it is optimized to 3 cache lines (+50%).\n\nExamples for cache lines size = 64:\n  orig     optimized\n  64    -> 64           +0%\n  128   -> 192          +50%\n  192   -> 192          +0%\n  256   -> 320          +25%\n  320   -> 320          +0%\n  384   -> 448          +16%\n  ...\n  2304  -> 2368         +2.7%  (~mbuf size)\n\nAdditional details:\nhttps://www.mail-archive.com/dev@dpdk.org/msg149157.html\n\nFixes: af75078fece3 (\"first public release\")\nCc: stable@dpdk.org\n\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\nReviewed-by: Gavin Hu <gavin.hu@arm.com>\n---\nv2:\n- Changed the return type of arch_mem_object_align() to \"unsigned int\" from\n  \"unsigned\" to fix the checkpatch issues (Olivier Matz)\n- Updated the comments for MEMPOOL_F_NO_SPREAD (Olivier Matz)\n- Update the git comments to share the memory saving details.\n\n\n doc/guides/prog_guide/mempool_lib.rst |  6 +++---\n lib/librte_mempool/rte_mempool.c      | 17 +++++++++++++----\n lib/librte_mempool/rte_mempool.h      |  6 +++++-\n 3 files changed, 21 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/doc/guides/prog_guide/mempool_lib.rst b/doc/guides/prog_guide/mempool_lib.rst\nindex 3bb84b0a6..eea7a2906 100644\n--- a/doc/guides/prog_guide/mempool_lib.rst\n+++ b/doc/guides/prog_guide/mempool_lib.rst\n@@ -27,10 +27,10 @@ In debug mode (CONFIG_RTE_LIBRTE_MEMPOOL_DEBUG is enabled),\n statistics about get from/put in the pool are stored in the mempool structure.\n Statistics are per-lcore to avoid concurrent access to statistics counters.\n \n-Memory Alignment Constraints\n-----------------------------\n+Memory Alignment Constraints on X86 architecture\n+------------------------------------------------\n \n-Depending on hardware memory configuration, performance can be greatly improved by adding a specific padding between objects.\n+Depending on hardware memory configuration on X86 architecture, performance can be greatly improved by adding a specific padding between objects.\n The objective is to ensure that the beginning of each object starts on a different channel and rank in memory so that all channels are equally loaded.\n \n This is particularly true for packet buffers when doing L3 forwarding or flow classification.\ndiff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 78d8eb941..1909998e8 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -45,6 +45,7 @@ EAL_REGISTER_TAILQ(rte_mempool_tailq)\n #define CALC_CACHE_FLUSHTHRESH(c)\t\\\n \t((typeof(c))((c) * CACHE_FLUSHTHRESH_MULTIPLIER))\n \n+#if defined(RTE_ARCH_X86)\n /*\n  * return the greatest common divisor between a and b (fast algorithm)\n  *\n@@ -74,12 +75,13 @@ static unsigned get_gcd(unsigned a, unsigned b)\n }\n \n /*\n- * Depending on memory configuration, objects addresses are spread\n+ * Depending on memory configuration on x86 arch, objects addresses are spread\n  * between channels and ranks in RAM: the pool allocator will add\n  * padding between objects. This function return the new size of the\n  * object.\n  */\n-static unsigned optimize_object_size(unsigned obj_size)\n+static unsigned int\n+arch_mem_object_align(unsigned int obj_size)\n {\n \tunsigned nrank, nchan;\n \tunsigned new_obj_size;\n@@ -99,6 +101,13 @@ static unsigned optimize_object_size(unsigned obj_size)\n \t\tnew_obj_size++;\n \treturn new_obj_size * RTE_MEMPOOL_ALIGN;\n }\n+#else\n+static unsigned int\n+arch_mem_object_align(unsigned int obj_size)\n+{\n+\treturn obj_size;\n+}\n+#endif\n \n struct pagesz_walk_arg {\n \tint socket_id;\n@@ -234,8 +243,8 @@ rte_mempool_calc_obj_size(uint32_t elt_size, uint32_t flags,\n \t */\n \tif ((flags & MEMPOOL_F_NO_SPREAD) == 0) {\n \t\tunsigned new_size;\n-\t\tnew_size = optimize_object_size(sz->header_size + sz->elt_size +\n-\t\t\tsz->trailer_size);\n+\t\tnew_size = arch_mem_object_align\n+\t\t\t    (sz->header_size + sz->elt_size + sz->trailer_size);\n \t\tsz->trailer_size = new_size - sz->header_size - sz->elt_size;\n \t}\n \ndiff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex f81152af9..9a4411110 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -260,7 +260,11 @@ struct rte_mempool {\n #endif\n }  __rte_cache_aligned;\n \n-#define MEMPOOL_F_NO_SPREAD      0x0001 /**< Do not spread among memory channels. */\n+#define MEMPOOL_F_NO_SPREAD      0x0001\n+/**< Do not spread among memory channels. It is a hint to the library,\n+ * library honor this hint only when, if it is required by the\n+ * (micro) architecture.\n+ */\n #define MEMPOOL_F_NO_CACHE_ALIGN 0x0002 /**< Do not align objs on cache lines.*/\n #define MEMPOOL_F_SP_PUT         0x0004 /**< Default put is \"single-producer\".*/\n #define MEMPOOL_F_SC_GET         0x0008 /**< Default get is \"single-consumer\".*/\n",
    "prefixes": [
        "v2"
    ]
}