Show a patch.

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

{
    "id": 74557,
    "url": "https://patches.dpdk.org/api/patches/74557/",
    "web_url": "https://patches.dpdk.org/patch/74557/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200721095140.719297-19-bruce.richardson@intel.com>",
    "date": "2020-07-21T09:51:38",
    "name": "[20.11,18/20] raw/ioat: move xstats functions to common file",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b6144d31b605c735544844ea7400840bd1c6887e",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/patch/74557/mbox/",
    "series": [
        {
            "id": 11200,
            "url": "https://patches.dpdk.org/api/series/11200/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11200",
            "date": "2020-07-21T09:51:20",
            "name": "raw/ioat: enhancements and new hardware support",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/11200/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74557/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/74557/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9688\"; a=\"138191467\"",
            "E=Sophos;i=\"5.75,378,1589266800\"; d=\"scan'208\";a=\"138191467\"",
            "E=Sophos;i=\"5.75,378,1589266800\"; d=\"scan'208\";a=\"488024526\""
        ],
        "IronPort-SDR": [
            "\n 3AB9oc+wAkyNuDtECSzqc5hhUPhLZ5LjhHaBthhvLJ9tHbR3pP9LjJaOaarUpWGeNd2u5oCtiP\n 1oJgB0XXGXzQ==",
            "\n 3LCV12u1qzDUcSgbbEiYSnOrfVekq7L0pKTHJI3/1g98DKeUh5Kmp13ZEagRVDp9wQgCuwiglI\n Jyv9B94w5k7A=="
        ],
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "MIME-Version": "1.0",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200721095140.719297-1-bruce.richardson@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 20.11 18/20] raw/ioat: move xstats functions to\n\tcommon file",
        "Sender": "\"dev\" <dev-bounces@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 3B557A0526;\n\tTue, 21 Jul 2020 11:57:34 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 5FAD21C0D0;\n\tTue, 21 Jul 2020 11:56:27 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id E0EA81C0BE\n for <dev@dpdk.org>; Tue, 21 Jul 2020 11:56:22 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Jul 2020 02:56:22 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.222.36])\n by fmsmga005.fm.intel.com with ESMTP; 21 Jul 2020 02:56:20 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 2.25.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Tue, 21 Jul 2020 10:51:38 +0100",
        "Content-Transfer-Encoding": "8bit",
        "To": "dev@dpdk.org",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "In-Reply-To": "<20200721095140.719297-1-bruce.richardson@intel.com>",
        "Cc": "cheng1.jiang@intel.com, patrick.fu@intel.com, kevin.laatz@intel.com,\n Bruce Richardson <bruce.richardson@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200721095140.719297-19-bruce.richardson@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "The xstats functions can be used by all ioat devices so move them from the\nioat_rawdev.c file to ioat_common.c, and add the function prototypes to the\ninternal header file.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n drivers/raw/ioat/ioat_common.c  | 76 +++++++++++++++++++++++++++++++++\n drivers/raw/ioat/ioat_private.h | 10 +++++\n drivers/raw/ioat/ioat_rawdev.c  | 75 --------------------------------\n 3 files changed, 86 insertions(+), 75 deletions(-)",
    "diff": "diff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c\nindex fe293aebf..5f366f009 100644\n--- a/drivers/raw/ioat/ioat_common.c\n+++ b/drivers/raw/ioat/ioat_common.c\n@@ -4,9 +4,85 @@\n \n #include <rte_rawdev_pmd.h>\n #include <rte_memzone.h>\n+#include <rte_string_fns.h>\n \n #include \"ioat_private.h\"\n \n+static const char * const xstat_names[] = {\n+\t\t\"failed_enqueues\", \"successful_enqueues\",\n+\t\t\"copies_started\", \"copies_completed\"\n+};\n+\n+int\n+ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],\n+\t\tuint64_t values[], unsigned int n)\n+{\n+\tconst struct rte_ioat_rawdev *ioat = dev->dev_private;\n+\tunsigned int i;\n+\n+\tfor (i = 0; i < n; i++) {\n+\t\tswitch (ids[i]) {\n+\t\tcase 0: values[i] = ioat->xstats.enqueue_failed; break;\n+\t\tcase 1: values[i] = ioat->xstats.enqueued; break;\n+\t\tcase 2: values[i] = ioat->xstats.started; break;\n+\t\tcase 3: values[i] = ioat->xstats.completed; break;\n+\t\tdefault: values[i] = 0; break;\n+\t\t}\n+\t}\n+\treturn n;\n+}\n+\n+int\n+ioat_xstats_get_names(const struct rte_rawdev *dev,\n+\t\tstruct rte_rawdev_xstats_name *names,\n+\t\tunsigned int size)\n+{\n+\tunsigned int i;\n+\n+\tRTE_SET_USED(dev);\n+\tif (size < RTE_DIM(xstat_names))\n+\t\treturn RTE_DIM(xstat_names);\n+\n+\tfor (i = 0; i < RTE_DIM(xstat_names); i++)\n+\t\tstrlcpy(names[i].name, xstat_names[i], sizeof(names[i]));\n+\n+\treturn RTE_DIM(xstat_names);\n+}\n+\n+int\n+ioat_xstats_reset(struct rte_rawdev *dev, const uint32_t *ids, uint32_t nb_ids)\n+{\n+\tstruct rte_ioat_rawdev *ioat = dev->dev_private;\n+\tunsigned int i;\n+\n+\tif (!ids) {\n+\t\tmemset(&ioat->xstats, 0, sizeof(ioat->xstats));\n+\t\treturn 0;\n+\t}\n+\n+\tfor (i = 0; i < nb_ids; i++) {\n+\t\tswitch (ids[i]) {\n+\t\tcase 0:\n+\t\t\tioat->xstats.enqueue_failed = 0;\n+\t\t\tbreak;\n+\t\tcase 1:\n+\t\t\tioat->xstats.enqueued = 0;\n+\t\t\tbreak;\n+\t\tcase 2:\n+\t\t\tioat->xstats.started = 0;\n+\t\t\tbreak;\n+\t\tcase 3:\n+\t\t\tioat->xstats.completed = 0;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tIOAT_PMD_WARN(\"Invalid xstat id - cannot reset value\");\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n int\n idxd_dev_dump(struct rte_rawdev *dev, FILE *f)\n {\ndiff --git a/drivers/raw/ioat/ioat_private.h b/drivers/raw/ioat/ioat_private.h\nindex 35189b15f..46465e675 100644\n--- a/drivers/raw/ioat/ioat_private.h\n+++ b/drivers/raw/ioat/ioat_private.h\n@@ -55,6 +55,16 @@ struct idxd_rawdev {\n \t} u;\n };\n \n+int ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],\n+\t\tuint64_t values[], unsigned int n);\n+\n+int ioat_xstats_get_names(const struct rte_rawdev *dev,\n+\t\tstruct rte_rawdev_xstats_name *names,\n+\t\tunsigned int size);\n+\n+int ioat_xstats_reset(struct rte_rawdev *dev, const uint32_t *ids,\n+\t\tuint32_t nb_ids);\n+\n extern int idxd_rawdev_create(const char *name, struct rte_device *dev,\n \t\t       const struct idxd_rawdev *idxd,\n \t\t       const struct rte_rawdev_ops *ops);\ndiff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c\nindex e4d39a2ee..e3c98a825 100644\n--- a/drivers/raw/ioat/ioat_rawdev.c\n+++ b/drivers/raw/ioat/ioat_rawdev.c\n@@ -121,81 +121,6 @@ ioat_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info,\n \treturn 0;\n }\n \n-static const char * const xstat_names[] = {\n-\t\t\"failed_enqueues\", \"successful_enqueues\",\n-\t\t\"copies_started\", \"copies_completed\"\n-};\n-\n-static int\n-ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],\n-\t\tuint64_t values[], unsigned int n)\n-{\n-\tconst struct rte_ioat_rawdev *ioat = dev->dev_private;\n-\tunsigned int i;\n-\n-\tfor (i = 0; i < n; i++) {\n-\t\tswitch (ids[i]) {\n-\t\tcase 0: values[i] = ioat->xstats.enqueue_failed; break;\n-\t\tcase 1: values[i] = ioat->xstats.enqueued; break;\n-\t\tcase 2: values[i] = ioat->xstats.started; break;\n-\t\tcase 3: values[i] = ioat->xstats.completed; break;\n-\t\tdefault: values[i] = 0; break;\n-\t\t}\n-\t}\n-\treturn n;\n-}\n-\n-static int\n-ioat_xstats_get_names(const struct rte_rawdev *dev,\n-\t\tstruct rte_rawdev_xstats_name *names,\n-\t\tunsigned int size)\n-{\n-\tunsigned int i;\n-\n-\tRTE_SET_USED(dev);\n-\tif (size < RTE_DIM(xstat_names))\n-\t\treturn RTE_DIM(xstat_names);\n-\n-\tfor (i = 0; i < RTE_DIM(xstat_names); i++)\n-\t\tstrlcpy(names[i].name, xstat_names[i], sizeof(names[i]));\n-\n-\treturn RTE_DIM(xstat_names);\n-}\n-\n-static int\n-ioat_xstats_reset(struct rte_rawdev *dev, const uint32_t *ids, uint32_t nb_ids)\n-{\n-\tstruct rte_ioat_rawdev *ioat = dev->dev_private;\n-\tunsigned int i;\n-\n-\tif (!ids) {\n-\t\tmemset(&ioat->xstats, 0, sizeof(ioat->xstats));\n-\t\treturn 0;\n-\t}\n-\n-\tfor (i = 0; i < nb_ids; i++) {\n-\t\tswitch (ids[i]) {\n-\t\tcase 0:\n-\t\t\tioat->xstats.enqueue_failed = 0;\n-\t\t\tbreak;\n-\t\tcase 1:\n-\t\t\tioat->xstats.enqueued = 0;\n-\t\t\tbreak;\n-\t\tcase 2:\n-\t\t\tioat->xstats.started = 0;\n-\t\t\tbreak;\n-\t\tcase 3:\n-\t\t\tioat->xstats.completed = 0;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tIOAT_PMD_WARN(\"Invalid xstat id - cannot reset value\");\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\n-\treturn 0;\n-}\n-\n extern int ioat_rawdev_test(uint16_t dev_id);\n \n static int\n",
    "prefixes": [
        "20.11",
        "18/20"
    ]
}