get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53973,
    "url": "http://patches.dpdk.org/api/patches/53973/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190601014905.45531-3-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": "<20190601014905.45531-3-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190601014905.45531-3-jerinj@marvell.com",
    "date": "2019-06-01T01:48:40",
    "name": "[v2,02/27] common/octeontx2: add IO handling APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "30841cb5a18910d287b690c04dd122dc81f82b23",
    "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/20190601014905.45531-3-jerinj@marvell.com/mbox/",
    "series": [
        {
            "id": 4844,
            "url": "http://patches.dpdk.org/api/series/4844/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4844",
            "date": "2019-06-01T01:48:38",
            "name": "OCTEON TX2 common and mempool driver",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/4844/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53973/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/53973/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6EDB81B954;\n\tSat,  1 Jun 2019 03:49:24 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 8592B1B94A\n\tfor <dev@dpdk.org>; Sat,  1 Jun 2019 03:49:21 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n\tby mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx511k5Qp001009 for <dev@dpdk.org>; Fri, 31 May 2019 18:49:20 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2sufgn82vb-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n\tfor <dev@dpdk.org>; Fri, 31 May 2019 18:49:20 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tFri, 31 May 2019 18:49:19 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Fri, 31 May 2019 18:49:19 -0700",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n\tby maili.marvell.com (Postfix) with ESMTP id 5F3963F703F;\n\tFri, 31 May 2019 18:49:18 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-transfer-encoding : content-type; s=pfpt0818;\n\tbh=JYDhz2UKFEH8oF6chFr7y9Sa0uejul/AhTH8sKDDYG4=;\n\tb=ZimFB81a0KtjLBc3OOtfzuQc/Lv2Q2EMKBWRgSe66j4QImmuDQNDOXq0jjCOwOF+jt3k\n\tniKf9G00mSR39anpJ1/FgIZ3oWW26Qg/2qlLm3+tgadwmAaP8lkH4QDdVgXBrbfOu2lf\n\toyUEborGhoz2SdNEpYkupc6Km1qV8b4Ssj6s/ZsLUDDff7t1GqNnmLESwiOcJOChVTsv\n\tPfX8E4obm+5VZIAWleuKCfuc5N8egF8jNxEc1RUYWsKmYJdjJdlwNWHtJqgGpLlFf6so\n\tGnh/WcxQVQk1kMyqxhuP5ik0OEmtMluXOxtJQf7gVX7FaLxEFUbtxWPNNimOBuawf7SV\n\tCw== ",
        "From": "<jerinj@marvell.com>",
        "To": "<dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>, Nithin Dabilpuram\n\t<ndabilpuram@marvell.com>, Vamsi Attunuru <vattunuru@marvell.com>",
        "CC": "Pavan Nikhilesh <pbhagavatula@marvell.com>",
        "Date": "Sat, 1 Jun 2019 07:18:40 +0530",
        "Message-ID": "<20190601014905.45531-3-jerinj@marvell.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190601014905.45531-1-jerinj@marvell.com>",
        "References": "<20190523081339.56348-1-jerinj@marvell.com>\n\t<20190601014905.45531-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:, ,\n\tdefinitions=2019-06-01_02:, , signatures=0",
        "Subject": "[dpdk-dev] [PATCH v2 02/27] common/octeontx2: add IO handling APIs",
        "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\t<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\t<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\nVarious octeontx2 drivers use IO handling API, added octeontx2\nspecific IO handling routines in the common code.\n\nSince some of those implementations are based on arm64 instructions\nadded the stub to compile the code on non arm64 ISA.\nThe non arm64 ISA stub is possible due to the fact that\nit is an integrated controller i.e runs only on Marvell HW.\n\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n drivers/common/octeontx2/otx2_common.h     | 12 +++\n drivers/common/octeontx2/otx2_io_arm64.h   | 95 ++++++++++++++++++++++\n drivers/common/octeontx2/otx2_io_generic.h | 63 ++++++++++++++\n 3 files changed, 170 insertions(+)\n create mode 100644 drivers/common/octeontx2/otx2_io_arm64.h\n create mode 100644 drivers/common/octeontx2/otx2_io_generic.h",
    "diff": "diff --git a/drivers/common/octeontx2/otx2_common.h b/drivers/common/octeontx2/otx2_common.h\nindex b4e008b14..b0c19266b 100644\n--- a/drivers/common/octeontx2/otx2_common.h\n+++ b/drivers/common/octeontx2/otx2_common.h\n@@ -6,6 +6,8 @@\n #define _OTX2_COMMON_H_\n \n #include <rte_common.h>\n+#include <rte_io.h>\n+#include <rte_memory.h>\n \n #include \"hw/otx2_rvu.h\"\n #include \"hw/otx2_nix.h\"\n@@ -31,4 +33,14 @@\n #define __hot   __attribute__((hot))\n #endif\n \n+/* IO Access */\n+#define otx2_read64(addr) rte_read64_relaxed((void *)(addr))\n+#define otx2_write64(val, addr) rte_write64_relaxed((val), (void *)(addr))\n+\n+#if defined(RTE_ARCH_ARM64)\n+#include \"otx2_io_arm64.h\"\n+#else\n+#include \"otx2_io_generic.h\"\n+#endif\n+\n #endif /* _OTX2_COMMON_H_ */\ndiff --git a/drivers/common/octeontx2/otx2_io_arm64.h b/drivers/common/octeontx2/otx2_io_arm64.h\nnew file mode 100644\nindex 000000000..468243c04\n--- /dev/null\n+++ b/drivers/common/octeontx2/otx2_io_arm64.h\n@@ -0,0 +1,95 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2019 Marvell International Ltd.\n+ */\n+\n+#ifndef _OTX2_IO_ARM64_H_\n+#define _OTX2_IO_ARM64_H_\n+\n+#define otx2_load_pair(val0, val1, addr) ({\t\t\\\n+\tasm volatile(\t\t\t\t\t\\\n+\t\"ldp %x[x0], %x[x1], [%x[p1]]\"\t\t\t\\\n+\t:[x0]\"=r\"(val0), [x1]\"=r\"(val1)\t\t\t\\\n+\t:[p1]\"r\"(addr)\t\t\t\t\t\\\n+\t); })\n+\n+#define otx2_store_pair(val0, val1, addr) ({\t\t\\\n+\tasm volatile(\t\t\t\t\t\\\n+\t\"stp %x[x0], %x[x1], [%x[p1]]\"\t\t\t\\\n+\t::[x0]\"r\"(val0), [x1]\"r\"(val1), [p1]\"r\"(addr)\t\\\n+\t); })\n+\n+#define otx2_prefetch_store_keep(ptr) ({\\\n+\tasm volatile(\"prfm pstl1keep, [%x0]\\n\" : : \"r\" (ptr)); })\n+\n+static __rte_always_inline uint64_t\n+otx2_atomic64_add_nosync(int64_t incr, int64_t *ptr)\n+{\n+\tuint64_t result;\n+\n+\t/* Atomic add with no ordering */\n+\tasm volatile (\n+\t\t\".cpu  generic+lse\\n\"\n+\t\t\"ldadd %x[i], %x[r], [%[b]]\"\n+\t\t: [r] \"=r\" (result), \"+m\" (*ptr)\n+\t\t: [i] \"r\" (incr), [b] \"r\" (ptr)\n+\t\t: \"memory\");\n+\treturn result;\n+}\n+\n+static __rte_always_inline uint64_t\n+otx2_atomic64_add_sync(int64_t incr, int64_t *ptr)\n+{\n+\tuint64_t result;\n+\n+\t/* Atomic add with ordering */\n+\tasm volatile (\n+\t\t\".cpu  generic+lse\\n\"\n+\t\t\"ldadda %x[i], %x[r], [%[b]]\"\n+\t\t: [r] \"=r\" (result), \"+m\" (*ptr)\n+\t\t: [i] \"r\" (incr), [b] \"r\" (ptr)\n+\t\t: \"memory\");\n+\treturn result;\n+}\n+\n+static __rte_always_inline uint64_t\n+otx2_lmt_submit(rte_iova_t io_address)\n+{\n+\tuint64_t result;\n+\n+\tasm volatile (\n+\t\t\".cpu  generic+lse\\n\"\n+\t\t\"ldeor xzr,%x[rf],[%[rs]]\" :\n+\t\t [rf] \"=r\"(result): [rs] \"r\"(io_address));\n+\treturn result;\n+}\n+\n+static __rte_always_inline void\n+otx2_lmt_mov(void *out, const void *in, const uint32_t lmtext)\n+{\n+\tvolatile const __uint128_t *src128 = (const __uint128_t *)in;\n+\tvolatile __uint128_t *dst128 = (__uint128_t *)out;\n+\tdst128[0] = src128[0];\n+\tdst128[1] = src128[1];\n+\t/* lmtext receives following value:\n+\t * 1: NIX_SUBDC_EXT needed i.e. tx vlan case\n+\t * 2: NIX_SUBDC_EXT + NIX_SUBDC_MEM i.e. tstamp case\n+\t */\n+\tif (lmtext) {\n+\t\tdst128[2] = src128[2];\n+\t\tif (lmtext > 1)\n+\t\t\tdst128[3] = src128[3];\n+\t}\n+}\n+\n+static __rte_always_inline void\n+otx2_lmt_mov_seg(void *out, const void *in, const uint16_t segdw)\n+{\n+\tvolatile const __uint128_t *src128 = (const __uint128_t *)in;\n+\tvolatile __uint128_t *dst128 = (__uint128_t *)out;\n+\tuint8_t i;\n+\n+\tfor (i = 0; i < segdw; i++)\n+\t\tdst128[i] = src128[i];\n+}\n+\n+#endif /* _OTX2_IO_ARM64_H_ */\ndiff --git a/drivers/common/octeontx2/otx2_io_generic.h b/drivers/common/octeontx2/otx2_io_generic.h\nnew file mode 100644\nindex 000000000..b1d754008\n--- /dev/null\n+++ b/drivers/common/octeontx2/otx2_io_generic.h\n@@ -0,0 +1,63 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2019 Marvell International Ltd.\n+ */\n+\n+#ifndef _OTX2_IO_GENERIC_H_\n+#define _OTX2_IO_GENERIC_H_\n+\n+#define otx2_load_pair(val0, val1, addr)\t\t\t\\\n+do {\t\t\t\t\t\t\t\t\\\n+\tval0 = rte_read64_relaxed((void *)(addr));\t\t\\\n+\tval1 = rte_read64_relaxed((uint8_t *)(addr) + 8);\t\\\n+} while (0)\n+\n+#define otx2_store_pair(val0, val1, addr)\t\t\t\\\n+do {\t\t\t\t\t\t\t\t\\\n+\trte_write64_relaxed(val0, (void *)(addr));\t\t\\\n+\trte_write64_relaxed(val1, (((uint8_t *)(addr)) + 8));\t\\\n+} while (0)\n+\n+#define otx2_prefetch_store_keep(ptr) do {} while (0)\n+\n+static inline uint64_t\n+otx2_atomic64_add_nosync(int64_t incr, int64_t *ptr)\n+{\n+\tRTE_SET_USED(ptr);\n+\tRTE_SET_USED(incr);\n+\n+\treturn 0;\n+}\n+\n+static inline uint64_t\n+otx2_atomic64_add_sync(int64_t incr, int64_t *ptr)\n+{\n+\tRTE_SET_USED(ptr);\n+\tRTE_SET_USED(incr);\n+\n+\treturn 0;\n+}\n+\n+static inline int64_t\n+otx2_lmt_submit(uint64_t io_address)\n+{\n+\tRTE_SET_USED(io_address);\n+\n+\treturn 0;\n+}\n+\n+static __rte_always_inline void\n+otx2_lmt_mov(void *out, const void *in, const uint32_t lmtext)\n+{\n+\tRTE_SET_USED(out);\n+\tRTE_SET_USED(in);\n+\tRTE_SET_USED(lmtext);\n+}\n+\n+static __rte_always_inline void\n+otx2_lmt_mov_seg(void *out, const void *in, const uint16_t segdw)\n+{\n+\tRTE_SET_USED(out);\n+\tRTE_SET_USED(in);\n+\tRTE_SET_USED(segdw);\n+}\n+#endif /* _OTX2_IO_GENERIC_H_ */\n",
    "prefixes": [
        "v2",
        "02/27"
    ]
}