get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28748,
    "url": "https://patches.dpdk.org/api/patches/28748/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1505405343-18234-4-git-send-email-harry.van.haaren@intel.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": "<1505405343-18234-4-git-send-email-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1505405343-18234-4-git-send-email-harry.van.haaren@intel.com",
    "date": "2017-09-14T16:09:02",
    "name": "[dpdk-dev,v4,3/4] eventdev: add queue attribute function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8e1755dfd4c5850f211a79f70d6dcb3d25163081",
    "submitter": {
        "id": 317,
        "url": "https://patches.dpdk.org/api/people/317/?format=api",
        "name": "Van Haaren, Harry",
        "email": "harry.van.haaren@intel.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1505405343-18234-4-git-send-email-harry.van.haaren@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/28748/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/28748/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 6011D1B18C;\n\tThu, 14 Sep 2017 18:08:56 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 312FA199B5\n\tfor <dev@dpdk.org>; Thu, 14 Sep 2017 18:08:51 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga105.jf.intel.com with ESMTP; 14 Sep 2017 09:08:50 -0700",
            "from silpixa00398672.ir.intel.com ([10.237.223.128])\n\tby fmsmga004.fm.intel.com with ESMTP; 14 Sep 2017 09:08:49 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.42,393,1500966000\"; d=\"scan'208\";a=\"311710640\"",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jerin.jacob@caviumnetworks.com,\n\tHarry van Haaren <harry.van.haaren@intel.com>",
        "Date": "Thu, 14 Sep 2017 17:09:02 +0100",
        "Message-Id": "<1505405343-18234-4-git-send-email-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1505405343-18234-1-git-send-email-harry.van.haaren@intel.com>",
        "References": "<1504885015-44642-1-git-send-email-harry.van.haaren@intel.com>\n\t<1505405343-18234-1-git-send-email-harry.van.haaren@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 3/4] eventdev: add queue attribute function",
        "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": "This commit adds a generic queue attribute function. It also removes\nthe previous rte_event_queue_priority() and priority() functions, and\nupdates the map files and unit tests to use the new attr functions.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n\n---\n\nv4: [feedback http://dpdk.org/dev/patchwork/patch/28522/ ]\n- Add default case with -EINVAL (Jerin)\n- Remove explicity /* out */ comments on parameters (Jerin)\n- Move queue_attr function in header to queue area (Jerin)\n- Remove queue_count() fixes, should be in 2/4 patch (Harry)\n---\n lib/librte_eventdev/rte_eventdev.c           | 40 +++++++++++++++++++---------\n lib/librte_eventdev/rte_eventdev.h           | 35 +++++++++++-------------\n lib/librte_eventdev/rte_eventdev_version.map |  2 +-\n test/test/test_eventdev.c                    |  6 ++++-\n 4 files changed, 49 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c\nindex ea76444..73e1df0 100644\n--- a/lib/librte_eventdev/rte_eventdev.c\n+++ b/lib/librte_eventdev/rte_eventdev.c\n@@ -609,18 +609,6 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,\n \treturn (*dev->dev_ops->queue_setup)(dev, queue_id, queue_conf);\n }\n \n-uint8_t\n-rte_event_queue_priority(uint8_t dev_id, uint8_t queue_id)\n-{\n-\tstruct rte_eventdev *dev;\n-\n-\tdev = &rte_eventdevs[dev_id];\n-\tif (dev->data->event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_QOS)\n-\t\treturn dev->data->queues_prio[queue_id];\n-\telse\n-\t\treturn RTE_EVENT_DEV_PRIORITY_NORMAL;\n-}\n-\n static inline int\n is_valid_port(struct rte_eventdev *dev, uint8_t port_id)\n {\n@@ -789,6 +777,34 @@ rte_event_port_attr_get(uint8_t dev_id, uint8_t port_id, uint32_t attr_id,\n }\n \n int\n+rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,\n+\t\t\tuint32_t *attr_value)\n+{\n+\tstruct rte_eventdev *dev;\n+\n+\tif (!attr_value)\n+\t\treturn -EINVAL;\n+\n+\tRTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);\n+\tdev = &rte_eventdevs[dev_id];\n+\tif (!is_valid_queue(dev, queue_id)) {\n+\t\tRTE_EDEV_LOG_ERR(\"Invalid queue_id=%\" PRIu8, queue_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tswitch (attr_id) {\n+\tcase RTE_EVENT_QUEUE_ATTR_PRIORITY:\n+\t\t*attr_value = RTE_EVENT_DEV_PRIORITY_NORMAL;\n+\t\tif (dev->data->event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_QOS)\n+\t\t\t*attr_value = dev->data->queues_prio[queue_id];\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -EINVAL;\n+\t};\n+\treturn 0;\n+}\n+\n+int\n rte_event_port_link(uint8_t dev_id, uint8_t port_id,\n \t\t    const uint8_t queues[], const uint8_t priorities[],\n \t\t    uint16_t nb_links)\ndiff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h\nindex 0f7f10a..3fd447a 100644\n--- a/lib/librte_eventdev/rte_eventdev.h\n+++ b/lib/librte_eventdev/rte_eventdev.h\n@@ -633,31 +633,26 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,\n \t\t      const struct rte_event_queue_conf *queue_conf);\n \n /**\n- * Get the number of event queues on a specific event device\n- *\n- * @param dev_id\n- *   Event device identifier.\n- * @return\n- *   - The number of configured event queues\n+ * The priority of the queue.\n  */\n-uint8_t\n-rte_event_queue_count(uint8_t dev_id);\n+#define RTE_EVENT_QUEUE_ATTR_PRIORITY 0\n \n /**\n- * Get the priority of the event queue on a specific event device\n+ * Get an attribute from a queue.\n  *\n- * @param dev_id\n- *   Event device identifier.\n- * @param queue_id\n- *   Event queue identifier.\n- * @return\n- *   - If the device has RTE_EVENT_DEV_CAP_QUEUE_QOS capability then the\n- *    configured priority of the event queue in\n- *    [RTE_EVENT_DEV_PRIORITY_HIGHEST, RTE_EVENT_DEV_PRIORITY_LOWEST] range\n- *    else the value RTE_EVENT_DEV_PRIORITY_NORMAL\n+ * @param dev_id Eventdev id\n+ * @param queue_id Eventdev queue id\n+ * @param attr_id The attribute ID to retrieve\n+ * @param[out] attr_value A pointer that will be filled in with the attribute\n+ *             value if successful\n+ *\n+ * @retval 0 Successfully returned value\n+ *         -EINVAL invalid device, queue or attr_id provided, or attr_value\n+ *         was NULL\n  */\n-uint8_t\n-rte_event_queue_priority(uint8_t dev_id, uint8_t queue_id);\n+int\n+rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,\n+\t\t\tuint32_t *attr_value);\n \n /* Event port specific APIs */\n \ndiff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map\nindex 1353a6d..90266a8 100644\n--- a/lib/librte_eventdev/rte_eventdev_version.map\n+++ b/lib/librte_eventdev/rte_eventdev_version.map\n@@ -25,7 +25,6 @@ DPDK_17.05 {\n \n \trte_event_queue_default_conf_get;\n \trte_event_queue_setup;\n-\trte_event_queue_priority;\n \n \trte_event_dequeue_timeout_ticks;\n \n@@ -53,5 +52,6 @@ DPDK_17.11 {\n \n \trte_event_dev_attr_get;\n \trte_event_port_attr_get;\n+\trte_event_queue_attr_get;\n \n } DPDK_17.08;\ndiff --git a/test/test/test_eventdev.c b/test/test/test_eventdev.c\nindex 0c612be..2d34435 100644\n--- a/test/test/test_eventdev.c\n+++ b/test/test/test_eventdev.c\n@@ -381,7 +381,11 @@ test_eventdev_queue_priority(void)\n \t}\n \n \tfor (i = 0; i < (int)queue_count; i++) {\n-\t\tpriority =  rte_event_queue_priority(TEST_DEV_ID, i);\n+\t\tuint32_t tmp;\n+\t\tTEST_ASSERT_SUCCESS(rte_event_queue_attr_get(TEST_DEV_ID, i,\n+\t\t\t\t    RTE_EVENT_QUEUE_ATTR_PRIORITY, &tmp),\n+\t\t\t\t    \"Queue priority get failed\");\n+\t\tpriority = tmp;\n \n \t\tif (info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_QOS)\n \t\t\tTEST_ASSERT_EQUAL(priority,\n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "3/4"
    ]
}