get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 22658,
    "url": "https://patches.dpdk.org/api/patches/22658/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1490749521-1478-1-git-send-email-ed.czeck@atomicrules.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1490749521-1478-1-git-send-email-ed.czeck@atomicrules.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1490749521-1478-1-git-send-email-ed.czeck@atomicrules.com",
    "date": "2017-03-29T01:05:21",
    "name": "[dpdk-dev,v6,2/7] net/ark: Provide API for hardware modules mpu, rqp, and pktdir",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a5e29a9ae64aa7a685c3b29a5d5b608c4476b380",
    "submitter": {
        "id": 699,
        "url": "https://patches.dpdk.org/api/people/699/?format=api",
        "name": "Ed Czeck",
        "email": "ed.czeck@atomicrules.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1490749521-1478-1-git-send-email-ed.czeck@atomicrules.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/22658/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/22658/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id ED06D4A63;\n\tWed, 29 Mar 2017 03:05:28 +0200 (CEST)",
            "from mail-qt0-f196.google.com (mail-qt0-f196.google.com\n\t[209.85.216.196]) by dpdk.org (Postfix) with ESMTP id 31AC24A63\n\tfor <dev@dpdk.org>; Wed, 29 Mar 2017 03:05:28 +0200 (CEST)",
            "by mail-qt0-f196.google.com with SMTP id x35so203347qtc.1\n\tfor <dev@dpdk.org>; Tue, 28 Mar 2017 18:05:28 -0700 (PDT)",
            "from z170.home (pool-173-48-118-253.bstnma.fios.verizon.net.\n\t[173.48.118.253]) by smtp.gmail.com with ESMTPSA id\n\tq31sm3881535qta.22.2017.03.28.18.05.26\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 28 Mar 2017 18:05:26 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=atomicrules-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=mHFq6U9YtDfC6CqU0gJqPlHhe6xwIIMpyl+663Krv4A=;\n\tb=T8CY7R7QdbJOuYEtLu/wvI6t8X5a4wrCokHoDfnxoMXXTMNoYXMUTVRvgruSPVfqKg\n\tZ/3epXZBw53mrbL6YB5REEwTIHxnHfXEke3NR5O2JTN4jZOgOP7LilFIMWPjXx0SCQWW\n\t/BF8fCKbqrQZUETtoE/2zQqlW1mnxKAvmnNf+kEfII9PW3JwQELF92ytgQSWguZMGPNh\n\tmIQpHmKQcmNMlEMKI05g9qrtT4p9mtahPekuIJtAw7tb86Ig8xl90RZfY7Pt6GNvFM5y\n\trgbLhbvlVfe3cFMmETFJEOAzgNol++xAhlgNX55Ehr0cwckjaJFaRKWTcBFsSG7QnmW0\n\tJTTQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=mHFq6U9YtDfC6CqU0gJqPlHhe6xwIIMpyl+663Krv4A=;\n\tb=MyXpN261g42Silou8cx3ulqHpL3Zg5oB8MIZSrtk7AVNVSEKzFGvbftZuKNbfMFw0b\n\tUVAphq/IakAnHovNQBRxizgdNubGMdE+9P8+uGAIXbftS42O1V56+amfYRsjZKgcC2U9\n\t2a0JbEXyBfDQzfosyutD9EM9vUKWACe0nzdZ2IaVJDYW/OnWsy0dm2pKZCLUt23YL3Y1\n\tURQ8LWNYeEC8HNjTL6IMto1xwhWRmCaKhcxAjZGpGt289iQZ5S0/aZ+Hd1aCZTEXMn/J\n\tSmXQ4rwH/A+KGBwb21GoOZ1kkCo0g1MViW+aq7JGDl1Fjs+2Vuduf5Oj0Jw10DXrVp03\n\tb0aw==",
        "X-Gm-Message-State": "AFeK/H0lb4KXE0OVJu5/2Q4SUk1qxRGuZ22sMS+ulD05P3L+lF0uPll2SxpchgSc2kYJGg==",
        "X-Received": "by 10.200.54.117 with SMTP id n50mr31273338qtb.145.1490749527226;\n\tTue, 28 Mar 2017 18:05:27 -0700 (PDT)",
        "From": "Ed Czeck <ed.czeck@atomicrules.com>",
        "To": "dev@dpdk.org",
        "Cc": "john.miller@atomicrules.com, shepard.siegel@atomicrules.com,\n\tferruh.yigit@intel.com, stephen@networkplumber.org,\n\tEd Czeck <ed.czeck@atomicrules.com>",
        "Date": "Tue, 28 Mar 2017 21:05:21 -0400",
        "Message-Id": "<1490749521-1478-1-git-send-email-ed.czeck@atomicrules.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1490231015-31748-2-git-send-email-ed.czeck@atomicrules.com>",
        "References": "<1490231015-31748-2-git-send-email-ed.czeck@atomicrules.com>",
        "Subject": "[dpdk-dev] [PATCH v6 2/7] net/ark: Provide API for hardware modules\n\tmpu, rqp, and pktdir",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Provide C-level interface for Arkville's internal HW resources\nmpu, (Memory Prefetch Unit) pktdir (Packet director), and rqp\n(Request Pacer) modules\n\nv6:\n* Unify messaging and logging\n* Expand comments\n\nSigned-off-by: Ed Czeck <ed.czeck@atomicrules.com>\n---\n drivers/net/ark/Makefile     |   4 +-\n drivers/net/ark/ark_mpu.c    | 181 +++++++++++++++++++++++++++++++++++++++++++\n drivers/net/ark/ark_mpu.h    | 154 ++++++++++++++++++++++++++++++++++++\n drivers/net/ark/ark_pktdir.c |  80 +++++++++++++++++++\n drivers/net/ark/ark_pktdir.h |  70 +++++++++++++++++\n drivers/net/ark/ark_rqp.c    |  91 ++++++++++++++++++++++\n drivers/net/ark/ark_rqp.h    |  84 ++++++++++++++++++++\n 7 files changed, 663 insertions(+), 1 deletion(-)\n create mode 100644 drivers/net/ark/ark_mpu.c\n create mode 100644 drivers/net/ark/ark_mpu.h\n create mode 100644 drivers/net/ark/ark_pktdir.c\n create mode 100644 drivers/net/ark/ark_pktdir.h\n create mode 100644 drivers/net/ark/ark_rqp.c\n create mode 100644 drivers/net/ark/ark_rqp.h",
    "diff": "diff --git a/drivers/net/ark/Makefile b/drivers/net/ark/Makefile\nindex afe69c4..1276b87 100644\n--- a/drivers/net/ark/Makefile\n+++ b/drivers/net/ark/Makefile\n@@ -47,7 +47,9 @@ LIBABIVER := 1\n # all source are stored in SRCS-y\n #\n SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c\n-\n+SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c\n+SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c\n+SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c\n \n # this lib depends upon:\n DEPDIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += lib/librte_mbuf\ndiff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c\nnew file mode 100644\nindex 0000000..a191941\n--- /dev/null\n+++ b/drivers/net/ark/ark_mpu.c\n@@ -0,0 +1,181 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright (c) 2015-2017 Atomic Rules LLC\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of copyright holder nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <unistd.h>\n+\n+#include \"ark_logs.h\"\n+#include \"ark_mpu.h\"\n+\n+uint16_t\n+ark_api_num_queues(struct ark_mpu_t *mpu)\n+{\n+\treturn mpu->hw.num_queues;\n+}\n+\n+uint16_t\n+ark_api_num_queues_per_port(struct ark_mpu_t *mpu, uint16_t ark_ports)\n+{\n+\treturn mpu->hw.num_queues / ark_ports;\n+}\n+\n+int\n+ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)\n+{\n+\tuint32_t version;\n+\n+\tversion = mpu->id.vernum & 0x0000fF00;\n+\tif ((mpu->id.idnum != 0x2055504d) ||\n+\t    (mpu->hw.obj_size != obj_size) ||\n+\t    (version != 0x00003100)) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"   MPU module not found as expected %08x\"\n+\t\t\t    \" \\\"%c%c%c%c %c%c%c%c\\\"\\n\",\n+\t\t\t    mpu->id.idnum,\n+\t\t\t    mpu->id.id[0], mpu->id.id[1],\n+\t\t\t    mpu->id.id[2], mpu->id.id[3],\n+\t\t\t    mpu->id.ver[0], mpu->id.ver[1],\n+\t\t\t    mpu->id.ver[2], mpu->id.ver[3]);\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"   MPU HW num_queues: %u hw_depth %u,\"\n+\t\t\t    \" obj_size: %u, obj_per_mrr: %u\"\n+\t\t\t    \" Expected size %u\\n\",\n+\t\t\t    mpu->hw.num_queues,\n+\t\t\t    mpu->hw.hw_depth,\n+\t\t\t    mpu->hw.obj_size,\n+\t\t\t    mpu->hw.obj_per_mrr,\n+\t\t\t    obj_size);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n+void\n+ark_mpu_stop(struct ark_mpu_t *mpu)\n+{\n+\tmpu->cfg.command = MPU_CMD_STOP;\n+}\n+\n+void\n+ark_mpu_start(struct ark_mpu_t *mpu)\n+{\n+\tmpu->cfg.command = MPU_CMD_RUN;\n+}\n+\n+int\n+ark_mpu_reset(struct ark_mpu_t *mpu)\n+{\n+\tint cnt = 0;\n+\n+\tmpu->cfg.command = MPU_CMD_RESET;\n+\n+\twhile (mpu->cfg.command != MPU_CMD_IDLE) {\n+\t\tif (cnt++ > 1000)\n+\t\t\tbreak;\n+\t\tusleep(10);\n+\t}\n+\tif (mpu->cfg.command != MPU_CMD_IDLE) {\n+\t\tmpu->cfg.command = MPU_CMD_FORCE_RESET;\n+\t\tusleep(10);\n+\t}\n+\tark_mpu_reset_stats(mpu);\n+\treturn mpu->cfg.command != MPU_CMD_IDLE;\n+}\n+\n+void\n+ark_mpu_reset_stats(struct ark_mpu_t *mpu)\n+{\n+\tmpu->stats.pci_request = 1;\t/* reset stats */\n+}\n+\n+int\n+ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring, uint32_t ring_size,\n+\t\t  int is_tx)\n+{\n+\tark_mpu_reset(mpu);\n+\n+\tif (!rte_is_power_of_2(ring_size)) {\n+\t\tPMD_DRV_LOG(ERR, \"ARK: Invalid ring size for MPU %d\\n\",\n+\t\t\t    ring_size);\n+\t\treturn -1;\n+\t}\n+\n+\tmpu->cfg.ring_base = ring;\n+\tmpu->cfg.ring_size = ring_size;\n+\tmpu->cfg.ring_mask = ring_size - 1;\n+\tmpu->cfg.min_host_move = is_tx ? 1 : mpu->hw.obj_per_mrr;\n+\tmpu->cfg.min_hw_move = mpu->hw.obj_per_mrr;\n+\tmpu->cfg.sw_prod_index = 0;\n+\tmpu->cfg.hw_cons_index = 0;\n+\treturn 0;\n+}\n+\n+void\n+ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)\n+{\n+\t/* DUMP to see that we have started */\n+\tPMD_DEBUG_LOG(DEBUG, \"ARKP MPU: %s Q: %3u sw_prod %u, hw_cons: %u\\n\",\n+\t\t      code, qid,\n+\t\t      mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);\n+\tPMD_DEBUG_LOG(DEBUG, \"ARKP MPU: %s state: %d count %d, reserved %d\"\n+\t\t      \" data 0x%08x_%08x 0x%08x_%08x\\n\",\n+\t\t      code,\n+\t\t      mpu->debug.state, mpu->debug.count,\n+\t\t      mpu->debug.reserved,\n+\t\t      mpu->debug.peek[1],\n+\t\t      mpu->debug.peek[0],\n+\t\t      mpu->debug.peek[3],\n+\t\t      mpu->debug.peek[2]\n+\t\t      );\n+\tPMD_STATS_LOG(INFO, \"ARKP MPU: %s Q: %3u\"\n+\t\t      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64\n+\t\t      ARK_SU64 ARK_SU64 ARK_SU64 \"\\n\",\n+\t\t      code, qid,\n+\t\t      \"PCI Request:\", mpu->stats.pci_request,\n+\t\t      \"Queue_empty\", mpu->stats.q_empty,\n+\t\t      \"Queue_q1\", mpu->stats.q_q1,\n+\t\t      \"Queue_q2\", mpu->stats.q_q2,\n+\t\t      \"Queue_q3\", mpu->stats.q_q3,\n+\t\t      \"Queue_q4\", mpu->stats.q_q4,\n+\t\t      \"Queue_full\", mpu->stats.q_full\n+\t\t      );\n+}\n+\n+void\n+ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t q_id)\n+{\n+\tPMD_DEBUG_LOG(DEBUG, \"MPU Setup Q: %u\"\n+\t\t      ARK_SU64X \"\\n\",\n+\t\t      q_id,\n+\t\t      \"ring_base\", mpu->cfg.ring_base\n+\t\t      );\n+}\ndiff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h\nnew file mode 100644\nindex 0000000..a0171db\n--- /dev/null\n+++ b/drivers/net/ark/ark_mpu.h\n@@ -0,0 +1,154 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright (c) 2015-2017 Atomic Rules LLC\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of copyright holder nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _ARK_MPU_H_\n+#define _ARK_MPU_H_\n+\n+#include <stdint.h>\n+\n+#include <rte_memory.h>\n+\n+/* The MPU or Memory Prefetch Unit is an internal Arkville hardware\n+ * module for moving data between host memory and the hardware FPGA.\n+ * This module is *not* intended for end-user manipulation, hence\n+ * there is minimal documentation.\n+ */\n+\n+/*\n+ * MPU hardware structures\n+ * These are overlay structures to a memory mapped FPGA device.  These\n+ * structs will never be instantiated in ram memory\n+ */\n+\n+#define ARK_MPU_ID 0x00\n+struct ark_mpu_id_t {\n+\tunion {\n+\t\tchar id[4];\n+\t\tuint32_t idnum;\n+\t};\n+\tunion {\n+\t\tchar ver[4];\n+\t\tuint32_t vernum;\n+\t};\n+\tuint32_t phys_id;\n+\tuint32_t mrr_code;\n+};\n+\n+#define ARK_MPU_HW 0x010\n+struct ark_mpu_hw_t {\n+\tuint16_t num_queues;\n+\tuint16_t reserved;\n+\tuint32_t hw_depth;\n+\tuint32_t obj_size;\n+\tuint32_t obj_per_mrr;\n+};\n+\n+#define ARK_MPU_CFG 0x040\n+struct ark_mpu_cfg_t {\n+\tphys_addr_t ring_base;\t/* phys_addr_t is a uint64_t */\n+\tuint32_t ring_size;\n+\tuint32_t ring_mask;\n+\tuint32_t min_host_move;\n+\tuint32_t min_hw_move;\n+\tvolatile uint32_t sw_prod_index;\n+\tvolatile uint32_t hw_cons_index;\n+\tvolatile uint32_t command;\n+};\n+enum ARK_MPU_COMMAND {\n+\tMPU_CMD_IDLE = 1,\n+\tMPU_CMD_RUN = 2,\n+\tMPU_CMD_STOP = 4,\n+\tMPU_CMD_RESET =\t8,\n+\tMPU_CMD_FORCE_RESET = 16,\n+\tMPU_COMMAND_LIMIT = 0xfFFFFFFF\n+};\n+\n+#define ARK_MPU_STATS 0x080\n+struct ark_mpu_stats_t {\n+\tvolatile uint64_t pci_request;\n+\tvolatile uint64_t q_empty;\n+\tvolatile uint64_t q_q1;\n+\tvolatile uint64_t q_q2;\n+\tvolatile uint64_t q_q3;\n+\tvolatile uint64_t q_q4;\n+\tvolatile uint64_t q_full;\n+};\n+\n+#define ARK_MPU_DEBUG 0x0C0\n+struct ark_mpu_debug_t {\n+\tvolatile uint32_t state;\n+\tuint32_t reserved;\n+\tvolatile uint32_t count;\n+\tvolatile uint32_t take;\n+\tvolatile uint32_t peek[4];\n+};\n+\n+/*  Consolidated structure */\n+struct ark_mpu_t {\n+\tstruct ark_mpu_id_t id;\n+\tuint8_t reserved0[(ARK_MPU_HW - ARK_MPU_ID)\n+\t\t\t  - sizeof(struct ark_mpu_id_t)];\n+\tstruct ark_mpu_hw_t hw;\n+\tuint8_t reserved1[(ARK_MPU_CFG - ARK_MPU_HW) -\n+\t\t\t  sizeof(struct ark_mpu_hw_t)];\n+\tstruct ark_mpu_cfg_t cfg;\n+\tuint8_t reserved2[(ARK_MPU_STATS - ARK_MPU_CFG) -\n+\t\t\t  sizeof(struct ark_mpu_cfg_t)];\n+\tstruct ark_mpu_stats_t stats;\n+\tuint8_t reserved3[(ARK_MPU_DEBUG - ARK_MPU_STATS) -\n+\t\t\t  sizeof(struct ark_mpu_stats_t)];\n+\tstruct ark_mpu_debug_t debug;\n+};\n+\n+uint16_t ark_api_num_queues(struct ark_mpu_t *mpu);\n+uint16_t ark_api_num_queues_per_port(struct ark_mpu_t *mpu,\n+\t\t\t\t     uint16_t ark_ports);\n+int ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size);\n+void ark_mpu_stop(struct ark_mpu_t *mpu);\n+void ark_mpu_start(struct ark_mpu_t *mpu);\n+int ark_mpu_reset(struct ark_mpu_t *mpu);\n+int ark_mpu_configure(struct ark_mpu_t *mpu, phys_addr_t ring,\n+\t\t      uint32_t ring_size, int is_tx);\n+\n+void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);\n+void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);\n+void ark_mpu_reset_stats(struct ark_mpu_t *mpu);\n+\n+/*  this action is in a performance critical path */\n+static inline void\n+ark_mpu_set_producer(struct ark_mpu_t *mpu, uint32_t idx)\n+{\n+\tmpu->cfg.sw_prod_index = idx;\n+}\n+\n+#endif\ndiff --git a/drivers/net/ark/ark_pktdir.c b/drivers/net/ark/ark_pktdir.c\nnew file mode 100644\nindex 0000000..66e5ce2\n--- /dev/null\n+++ b/drivers/net/ark/ark_pktdir.c\n@@ -0,0 +1,80 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright (c) 2015-2017 Atomic Rules LLC\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of copyright holder nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <stdint.h>\n+#include <inttypes.h>\n+\n+#include \"ark_pktdir.h\"\n+#include \"ark_global.h\"\n+\n+\n+ark_pkt_dir_t\n+ark_pktdir_init(void *base)\n+{\n+\tstruct ark_pkt_dir_inst *inst =\n+\t\trte_malloc(\"ark_pkt_dir_inst\",\n+\t\t\t   sizeof(struct ark_pkt_dir_inst),\n+\t\t\t   0);\n+\tinst->regs = (struct ark_pkt_dir_regs *)base;\n+\tinst->regs->ctrl = 0x00110110;\t/* POR state */\n+\treturn inst;\n+}\n+\n+void\n+ark_pktdir_uninit(ark_pkt_dir_t handle)\n+{\n+\tstruct ark_pkt_dir_inst *inst = (struct ark_pkt_dir_inst *)handle;\n+\n+\trte_free(inst);\n+}\n+\n+void\n+ark_pktdir_setup(ark_pkt_dir_t handle, uint32_t v)\n+{\n+\tstruct ark_pkt_dir_inst *inst = (struct ark_pkt_dir_inst *)handle;\n+\tinst->regs->ctrl = v;\n+}\n+\n+uint32_t\n+ark_pktdir_status(ark_pkt_dir_t handle)\n+{\n+\tstruct ark_pkt_dir_inst *inst = (struct ark_pkt_dir_inst *)handle;\n+\treturn inst->regs->ctrl;\n+}\n+\n+uint32_t\n+ark_pktdir_stall_cnt(ark_pkt_dir_t handle)\n+{\n+\tstruct ark_pkt_dir_inst *inst = (struct ark_pkt_dir_inst *)handle;\n+\treturn inst->regs->stall_cnt;\n+}\ndiff --git a/drivers/net/ark/ark_pktdir.h b/drivers/net/ark/ark_pktdir.h\nnew file mode 100644\nindex 0000000..e13fe82\n--- /dev/null\n+++ b/drivers/net/ark/ark_pktdir.h\n@@ -0,0 +1,70 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright (c) 2015-2017 Atomic Rules LLC\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of copyright holder nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _ARK_PKTDIR_H_\n+#define _ARK_PKTDIR_H_\n+\n+#include <stdint.h>\n+\n+#define ARK_PKTDIR_BASE_ADR  0xa0000\n+\n+typedef void *ark_pkt_dir_t;\n+\n+\n+/* The packet director is an internal Arkville hardware module for\n+ * directing packet data in non-typical flows, such as testing.\n+ * This module is *not* intended for end-user manipulation, hence\n+ * there is minimal documentation.\n+ */\n+\n+/*\n+ * This is an overlay structures to a memory mapped FPGA device.  These\n+ * structs will never be instantiated in ram memory\n+ */\n+struct ark_pkt_dir_regs {\n+\tuint32_t ctrl;\n+\tuint32_t status;\n+\tuint32_t stall_cnt;\n+} __attribute__ ((packed));\n+\n+struct ark_pkt_dir_inst {\n+\tvolatile struct ark_pkt_dir_regs *regs;\n+};\n+\n+ark_pkt_dir_t ark_pktdir_init(void *base);\n+void ark_pktdir_uninit(ark_pkt_dir_t handle);\n+void ark_pktdir_setup(ark_pkt_dir_t handle, uint32_t v);\n+uint32_t ark_pktdir_stall_cnt(ark_pkt_dir_t handle);\n+uint32_t ark_pktdir_status(ark_pkt_dir_t handle);\n+\n+#endif\ndiff --git a/drivers/net/ark/ark_rqp.c b/drivers/net/ark/ark_rqp.c\nnew file mode 100644\nindex 0000000..ddbe13e\n--- /dev/null\n+++ b/drivers/net/ark/ark_rqp.c\n@@ -0,0 +1,91 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright (c) 2015-2017 Atomic Rules LLC\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of copyright holder nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <unistd.h>\n+\n+#include \"ark_rqp.h\"\n+#include \"ark_logs.h\"\n+\n+/* ************************************************************************* */\n+void\n+ark_rqp_stats_reset(struct ark_rqpace_t *rqp)\n+{\n+\trqp->stats_clear = 1;\n+\t/* POR 992 */\n+\t/* rqp->cpld_max = 992; */\n+\t/* POR 64 */\n+\t/* rqp->cplh_max = 64; */\n+}\n+\n+/* ************************************************************************* */\n+void\n+ark_rqp_dump(struct ark_rqpace_t *rqp)\n+{\n+\tif (rqp->err_count_other != 0)\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"ARKP RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d\"\n+\t\t\t    ARK_SU32\n+\t\t\t    ARK_SU32 \"\\n\",\n+\t\t\t    rqp->ctrl, rqp->cplh_max, rqp->cpld_max,\n+\t\t\t    \"Error Count\", rqp->err_cnt,\n+\t\t\t    \"Error General\", rqp->err_count_other);\n+\n+\tPMD_STATS_LOG(INFO, \"ARKP RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d\"\n+\t\t      ARK_SU32\n+\t\t      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32\n+\t\t      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32\n+\t\t      ARK_SU32 ARK_SU32 ARK_SU32\n+\t\t      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 \"\\n\",\n+\t\t      rqp->ctrl, rqp->cplh_max, rqp->cpld_max,\n+\t\t      \"Error Count\", rqp->err_cnt,\n+\t\t      \"Error General\", rqp->err_count_other,\n+\t\t      \"stall_pS\", rqp->stall_ps,\n+\t\t      \"stall_pS Min\", rqp->stall_ps_min,\n+\t\t      \"stall_pS Max\", rqp->stall_ps_max,\n+\t\t      \"req_pS\", rqp->req_ps,\n+\t\t      \"req_pS Min\", rqp->req_ps_min,\n+\t\t      \"req_pS Max\", rqp->req_ps_max,\n+\t\t      \"req_dWPS\", rqp->req_dw_ps,\n+\t\t      \"req_dWPS Min\", rqp->req_dw_ps_min,\n+\t\t      \"req_dWPS Max\", rqp->req_dw_ps_max,\n+\t\t      \"cpl_pS\", rqp->cpl_ps,\n+\t\t      \"cpl_pS Min\", rqp->cpl_ps_min,\n+\t\t      \"cpl_pS Max\", rqp->cpl_ps_max,\n+\t\t      \"cpl_dWPS\", rqp->cpl_dw_ps,\n+\t\t      \"cpl_dWPS Min\", rqp->cpl_dw_ps_min,\n+\t\t      \"cpl_dWPS Max\", rqp->cpl_dw_ps_max,\n+\t\t      \"cplh pending\", rqp->cplh_pending,\n+\t\t      \"cpld pending\", rqp->cpld_pending,\n+\t\t      \"cplh pending max\", rqp->cplh_pending_max,\n+\t\t      \"cpld pending max\", rqp->cpld_pending_max);\n+}\ndiff --git a/drivers/net/ark/ark_rqp.h b/drivers/net/ark/ark_rqp.h\nnew file mode 100644\nindex 0000000..995fc20\n--- /dev/null\n+++ b/drivers/net/ark/ark_rqp.h\n@@ -0,0 +1,84 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright (c) 2015-2017 Atomic Rules LLC\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of copyright holder nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _ARK_RQP_H_\n+#define _ARK_RQP_H_\n+\n+#include <stdint.h>\n+\n+#include <rte_memory.h>\n+\n+/* The RQP or ReQuest Pacer is an internal Arkville hardware module\n+ * which limits the PCIE data flow to insure correct operation for the\n+ * particular hardware PCIE endpoint.\n+ * This module is *not* intended for end-user manipulation, hence\n+ * there is minimal documentation.\n+ */\n+\n+/*\n+ * RQ Pacing core hardware structure\n+ * This is an overlay structures to a memory mapped FPGA device.  These\n+ * structs will never be instantiated in ram memory\n+ */\n+struct ark_rqpace_t {\n+\tvolatile uint32_t ctrl;\n+\tvolatile uint32_t stats_clear;\n+\tvolatile uint32_t cplh_max;\n+\tvolatile uint32_t cpld_max;\n+\tvolatile uint32_t err_cnt;\n+\tvolatile uint32_t stall_ps;\n+\tvolatile uint32_t stall_ps_min;\n+\tvolatile uint32_t stall_ps_max;\n+\tvolatile uint32_t req_ps;\n+\tvolatile uint32_t req_ps_min;\n+\tvolatile uint32_t req_ps_max;\n+\tvolatile uint32_t req_dw_ps;\n+\tvolatile uint32_t req_dw_ps_min;\n+\tvolatile uint32_t req_dw_ps_max;\n+\tvolatile uint32_t cpl_ps;\n+\tvolatile uint32_t cpl_ps_min;\n+\tvolatile uint32_t cpl_ps_max;\n+\tvolatile uint32_t cpl_dw_ps;\n+\tvolatile uint32_t cpl_dw_ps_min;\n+\tvolatile uint32_t cpl_dw_ps_max;\n+\tvolatile uint32_t cplh_pending;\n+\tvolatile uint32_t cpld_pending;\n+\tvolatile uint32_t cplh_pending_max;\n+\tvolatile uint32_t cpld_pending_max;\n+\tvolatile uint32_t err_count_other;\n+};\n+\n+void ark_rqp_dump(struct ark_rqpace_t *rqp);\n+void ark_rqp_stats_reset(struct ark_rqpace_t *rqp);\n+\n+#endif\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "2/7"
    ]
}