get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53761,
    "url": "https://patches.dpdk.org/api/patches/53761/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190528120553.2992-23-lukaszx.krakowiak@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": "<20190528120553.2992-23-lukaszx.krakowiak@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190528120553.2992-23-lukaszx.krakowiak@intel.com",
    "date": "2019-05-28T12:05:48",
    "name": "[22/27] sched: update sched queue stats api",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "43438942aed91b2391ce274d34fb10e6c99281e6",
    "submitter": {
        "id": 1221,
        "url": "https://patches.dpdk.org/api/people/1221/?format=api",
        "name": "Lukasz Krakowiak",
        "email": "lukaszx.krakowiak@intel.com"
    },
    "delegate": {
        "id": 10018,
        "url": "https://patches.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190528120553.2992-23-lukaszx.krakowiak@intel.com/mbox/",
    "series": [
        {
            "id": 4794,
            "url": "https://patches.dpdk.org/api/series/4794/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=4794",
            "date": "2019-05-28T12:05:26",
            "name": "sched: feature enhancements",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/4794/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/53761/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/53761/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 6E2F41B9FB;\n\tTue, 28 May 2019 14:08:55 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 3DF341B9D3\n\tfor <dev@dpdk.org>; Tue, 28 May 2019 14:08:44 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 May 2019 05:08:43 -0700",
            "from lkrakowx-mobl.ger.corp.intel.com ([10.103.104.99])\n\tby fmsmga001.fm.intel.com with ESMTP; 28 May 2019 05:08:41 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Lukasz Krakowiak <lukaszx.krakowiak@intel.com>",
        "To": "cristian.dumitrescu@intel.com",
        "Cc": "dev@dpdk.org, Jasvinder Singh <jasvinder.singh@intel.com>,\n\tAbraham Tovar <abrahamx.tovar@intel.com>,\n\tLukasz Krakowiak <lukaszx.krakowiak@intel.com>",
        "Date": "Tue, 28 May 2019 14:05:48 +0200",
        "Message-Id": "<20190528120553.2992-23-lukaszx.krakowiak@intel.com>",
        "X-Mailer": "git-send-email 2.19.2.windows.1",
        "In-Reply-To": "<20190528120553.2992-1-lukaszx.krakowiak@intel.com>",
        "References": "<20190528120553.2992-1-lukaszx.krakowiak@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 22/27] sched: update sched queue stats api",
        "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: Jasvinder Singh <jasvinder.singh@intel.com>\n\nUpdate queue stats read api implementation of the scheduler to allow\nconfiguration flexiblity for pipe traffic classes and queues, and subport\nlevel configuration of the pipe parameters.\n\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\nSigned-off-by: Abraham Tovar <abrahamx.tovar@intel.com>\nSigned-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>\n---\n lib/librte_sched/rte_sched.c | 41 +++++++++++++++++++-----------------\n 1 file changed, 22 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c\nindex 116e6a627..563161713 100644\n--- a/lib/librte_sched/rte_sched.c\n+++ b/lib/librte_sched/rte_sched.c\n@@ -306,16 +306,6 @@ enum rte_sched_subport_array {\n \te_RTE_SCHED_SUBPORT_ARRAY_TOTAL,\n };\n \n-#ifdef RTE_SCHED_COLLECT_STATS\n-\n-static inline uint32_t\n-rte_sched_port_queues_per_subport(struct rte_sched_port *port)\n-{\n-\treturn RTE_SCHED_QUEUES_PER_PIPE * port->n_pipes_per_subport;\n-}\n-\n-#endif\n-\n static inline uint32_t\n rte_sched_subport_queues(struct rte_sched_subport *subport)\n {\n@@ -340,9 +330,14 @@ rte_sched_subport_qsize(struct rte_sched_subport *subport, uint32_t qindex)\n }\n \n static inline uint32_t\n-rte_sched_port_queues_per_port(struct rte_sched_port *port)\n+rte_sched_port_queues(struct rte_sched_port *port)\n {\n-\treturn RTE_SCHED_QUEUES_PER_PIPE * port->n_pipes_per_subport * port->n_subports_per_port;\n+\tuint32_t n_queues = 0, i;\n+\n+\tfor (i = 0; i < port->n_subports_per_port; i++)\n+\t\tn_queues += rte_sched_subport_queues(port->subports[i]);\n+\n+\treturn n_queues;\n }\n \n static int\n@@ -1366,18 +1361,25 @@ rte_sched_queue_read_stats(struct rte_sched_port *port,\n \tstruct rte_sched_queue_stats *stats,\n \tuint16_t *qlen)\n {\n+\tuint32_t subport_id, qindex;\n+\tstruct rte_sched_subport *s;\n \tstruct rte_sched_queue *q;\n \tstruct rte_sched_queue_extra *qe;\n \n \t/* Check user parameters */\n \tif ((port == NULL) ||\n-\t    (queue_id >= rte_sched_port_queues_per_port(port)) ||\n+\t    (queue_id >= rte_sched_port_queues(port)) ||\n \t\t(stats == NULL) ||\n \t\t(qlen == NULL)) {\n \t\treturn -1;\n \t}\n-\tq = port->queue + queue_id;\n-\tqe = port->queue_extra + queue_id;\n+\n+\tsubport_id = (queue_id >> (port->n_max_subport_pipes_log2 + 4)) &\n+\t\t\t\t\t(port->n_subports_per_port - 1);\n+\ts = port->subports[subport_id];\n+\tqindex = ((1 << (port->n_max_subport_pipes_log2 + 4)) - 1) & queue_id;\n+\tq = s->queue + qindex;\n+\tqe = s->queue_extra + qindex;\n \n \t/* Copy queue stats and clear */\n \tmemcpy(stats, &qe->stats, sizeof(struct rte_sched_queue_stats));\n@@ -1392,9 +1394,10 @@ rte_sched_queue_read_stats(struct rte_sched_port *port,\n #ifdef RTE_SCHED_DEBUG\n \n static inline int\n-rte_sched_port_queue_is_empty(struct rte_sched_port *port, uint32_t qindex)\n+rte_sched_port_queue_is_empty(struct rte_sched_subport *subport,\n+\tuint32_t qindex)\n {\n-\tstruct rte_sched_queue *queue = port->queue + qindex;\n+\tstruct rte_sched_queue *queue = subport->queue + qindex;\n \n \treturn queue->qr == queue->qw;\n }\n@@ -1535,7 +1538,7 @@ rte_sched_port_set_queue_empty_timestamp(struct rte_sched_port *port __rte_unuse\n #ifdef RTE_SCHED_DEBUG\n \n static inline void\n-debug_check_queue_slab(struct rte_sched_port *port, uint32_t bmp_pos,\n+debug_check_queue_slab(struct rte_sched_subport *subport, uint32_t bmp_pos,\n \t\t       uint64_t bmp_slab)\n {\n \tuint64_t mask;\n@@ -1547,7 +1550,7 @@ debug_check_queue_slab(struct rte_sched_port *port, uint32_t bmp_pos,\n \tpanic = 0;\n \tfor (i = 0, mask = 1; i < 64; i++, mask <<= 1) {\n \t\tif (mask & bmp_slab) {\n-\t\t\tif (rte_sched_port_queue_is_empty(port, bmp_pos + i)) {\n+\t\t\tif (rte_sched_port_queue_is_empty(subport, bmp_pos + i)) {\n \t\t\t\tprintf(\"Queue %u (slab offset %u) is empty\\n\", bmp_pos + i, i);\n \t\t\t\tpanic = 1;\n \t\t\t}\n",
    "prefixes": [
        "22/27"
    ]
}