get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55334,
    "url": "http://patches.dpdk.org/api/patches/55334/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190625153217.24301-11-jasvinder.singh@intel.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": "<20190625153217.24301-11-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190625153217.24301-11-jasvinder.singh@intel.com",
    "date": "2019-06-25T15:31:59",
    "name": "[v2,10/28] sched: update subport and tc queue stats",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "e907da12447fae59bbabca539c07fa708e292f69",
    "submitter": {
        "id": 285,
        "url": "http://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": {
        "id": 10018,
        "url": "http://patches.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190625153217.24301-11-jasvinder.singh@intel.com/mbox/",
    "series": [
        {
            "id": 5160,
            "url": "http://patches.dpdk.org/api/series/5160/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5160",
            "date": "2019-06-25T15:31:49",
            "name": "sched: feature enhancements",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/5160/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55334/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/55334/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 4BB861BB20;\n\tTue, 25 Jun 2019 17:32:27 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 727391BA90\n\tfor <dev@dpdk.org>; Tue, 25 Jun 2019 17:32:14 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jun 2019 08:32:14 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.223.4])\n\tby orsmga006.jf.intel.com with ESMTP; 25 Jun 2019 08:32:12 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.63,416,1557212400\"; d=\"scan'208\";a=\"166711493\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com, Abraham Tovar <abrahamx.tovar@intel.com>, \n\tLukasz Krakowiak <lukaszx.krakowiak@intel.com>",
        "Date": "Tue, 25 Jun 2019 16:31:59 +0100",
        "Message-Id": "<20190625153217.24301-11-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190625153217.24301-1-jasvinder.singh@intel.com>",
        "References": "<20190528120553.2992-2-lukaszx.krakowiak@intel.com>\n\t<20190625153217.24301-1-jasvinder.singh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 10/28] sched: update subport and tc queue stats",
        "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": "Update subport and tc queue stats api mplementation to allow\nconfiguration flexiblity for pipe traffic classes and queues,\nand subport level 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 | 74 +++++++++++++++++++++++-------------\n lib/librte_sched/rte_sched.h | 34 ++++++++++-------\n 2 files changed, 68 insertions(+), 40 deletions(-)",
    "diff": "diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c\nindex cd82fd918..7a4c7cf12 100644\n--- a/lib/librte_sched/rte_sched.c\n+++ b/lib/librte_sched/rte_sched.c\n@@ -1490,11 +1490,31 @@ rte_sched_subport_read_stats(struct rte_sched_port *port,\n \tstruct rte_sched_subport *s;\n \n \t/* Check user parameters */\n-\tif (port == NULL || subport_id >= port->n_subports_per_port ||\n-\t    stats == NULL || tc_ov == NULL)\n-\t\treturn -1;\n+\tif (port == NULL) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for parameter port \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n \n-\ts = port->subport + subport_id;\n+\tif (subport_id >= port->n_subports_per_port) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for subport id \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (stats == NULL) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for parameter stats \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (tc_ov == NULL) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for tc_ov \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\ts = port->subports[subport_id];\n \n \t/* Copy subport stats and clear */\n \tmemcpy(stats, &s->stats, sizeof(struct rte_sched_subport_stats));\n@@ -1550,10 +1570,10 @@ rte_sched_port_queue_is_empty(struct rte_sched_port *port, uint32_t qindex)\n #ifdef RTE_SCHED_COLLECT_STATS\n \n static inline void\n-rte_sched_port_update_subport_stats(struct rte_sched_port *port, uint32_t qindex, struct rte_mbuf *pkt)\n+rte_sched_port_update_subport_stats(struct rte_sched_subport *s,\n+\tstruct rte_mbuf *pkt)\n {\n-\tstruct rte_sched_subport *s = port->subport + (qindex / rte_sched_port_queues_per_subport(port));\n-\tuint32_t tc_index = (qindex >> 2) & 0x3;\n+\tuint32_t tc_index = rte_mbuf_sched_traffic_class_get(pkt);\n \tuint32_t pkt_len = pkt->pkt_len;\n \n \ts->stats.n_pkts_tc[tc_index] += 1;\n@@ -1562,31 +1582,31 @@ rte_sched_port_update_subport_stats(struct rte_sched_port *port, uint32_t qindex\n \n #ifdef RTE_SCHED_RED\n static inline void\n-rte_sched_port_update_subport_stats_on_drop(struct rte_sched_port *port,\n-\t\t\t\t\t\tuint32_t qindex,\n-\t\t\t\t\t\tstruct rte_mbuf *pkt, uint32_t red)\n+rte_sched_port_update_subport_stats_on_drop(struct rte_sched_subport *subport,\n+\t\t\t\t\t\tstruct rte_mbuf *pkt,\n+\t\t\t\t\t\tuint32_t red)\n #else\n static inline void\n-rte_sched_port_update_subport_stats_on_drop(struct rte_sched_port *port,\n-\t\t\t\t\t\tuint32_t qindex,\n-\t\t\t\t\t\tstruct rte_mbuf *pkt, __rte_unused uint32_t red)\n+rte_sched_port_update_subport_stats_on_drop(struct rte_sched_subport *subport,\n+\t\t\t\t\t\tstruct rte_mbuf *pkt,\n+\t\t\t\t\t\t__rte_unused uint32_t red)\n #endif\n {\n-\tstruct rte_sched_subport *s = port->subport + (qindex / rte_sched_port_queues_per_subport(port));\n-\tuint32_t tc_index = (qindex >> 2) & 0x3;\n+\tuint32_t tc_index = rte_mbuf_sched_traffic_class_get(pkt);\n \tuint32_t pkt_len = pkt->pkt_len;\n \n-\ts->stats.n_pkts_tc_dropped[tc_index] += 1;\n-\ts->stats.n_bytes_tc_dropped[tc_index] += pkt_len;\n+\tsubport->stats.n_pkts_tc_dropped[tc_index] += 1;\n+\tsubport->stats.n_bytes_tc_dropped[tc_index] += pkt_len;\n #ifdef RTE_SCHED_RED\n-\ts->stats.n_pkts_red_dropped[tc_index] += red;\n+\tsubport->stats.n_pkts_red_dropped[tc_index] += red;\n #endif\n }\n \n static inline void\n-rte_sched_port_update_queue_stats(struct rte_sched_port *port, uint32_t qindex, struct rte_mbuf *pkt)\n+rte_sched_port_update_queue_stats(struct rte_sched_subport *subport,\n+\tuint32_t qindex, struct rte_mbuf *pkt)\n {\n-\tstruct rte_sched_queue_extra *qe = port->queue_extra + qindex;\n+\tstruct rte_sched_queue_extra *qe = subport->queue_extra + qindex;\n \tuint32_t pkt_len = pkt->pkt_len;\n \n \tqe->stats.n_pkts += 1;\n@@ -1595,17 +1615,19 @@ rte_sched_port_update_queue_stats(struct rte_sched_port *port, uint32_t qindex,\n \n #ifdef RTE_SCHED_RED\n static inline void\n-rte_sched_port_update_queue_stats_on_drop(struct rte_sched_port *port,\n+rte_sched_port_update_queue_stats_on_drop(struct rte_sched_subport *subport,\n \t\t\t\t\t\tuint32_t qindex,\n-\t\t\t\t\t\tstruct rte_mbuf *pkt, uint32_t red)\n+\t\t\t\t\t\tstruct rte_mbuf *pkt,\n+\t\t\t\t\t\tint32_t red)\n #else\n static inline void\n-rte_sched_port_update_queue_stats_on_drop(struct rte_sched_port *port,\n+rte_sched_port_update_queue_stats_on_drop(struct rte_sched_subport *subport,\n \t\t\t\t\t\tuint32_t qindex,\n-\t\t\t\t\t\tstruct rte_mbuf *pkt, __rte_unused uint32_t red)\n+\t\t\t\t\t\tstruct rte_mbuf *pkt,\n+\t\t\t\t\t\t__rte_unused uint32_t red)\n #endif\n {\n-\tstruct rte_sched_queue_extra *qe = port->queue_extra + qindex;\n+\tstruct rte_sched_queue_extra *qe = subport->queue_extra + qindex;\n \tuint32_t pkt_len = pkt->pkt_len;\n \n \tqe->stats.n_pkts_dropped += 1;\n@@ -1626,7 +1648,7 @@ rte_sched_port_red_drop(struct rte_sched_port *port, struct rte_mbuf *pkt, uint3\n \tstruct rte_red_config *red_cfg;\n \tstruct rte_red *red;\n \tuint32_t tc_index;\n-\tenum rte_color color;\n+\tenum rte_meter_color color;\n \n \ttc_index = (qindex >> 2) & 0x3;\n \tcolor = rte_sched_port_pkt_read_color(pkt);\ndiff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h\nindex 6a6ea84aa..05f518457 100644\n--- a/lib/librte_sched/rte_sched.h\n+++ b/lib/librte_sched/rte_sched.h\n@@ -195,36 +195,42 @@ struct rte_sched_subport_params {\n \n /** Subport statistics */\n struct rte_sched_subport_stats {\n-\t/* Packets */\n+\t/** Number of packets successfully written */\n \tuint32_t n_pkts_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n-\t/**< Number of packets successfully written */\n+\n+\t/** Number of packets dropped */\n \tuint32_t n_pkts_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n-\t/**< Number of packets dropped */\n \n-\t/* Bytes */\n+\t/** Number of bytes successfully written for each traffic class */\n \tuint32_t n_bytes_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n-\t/**< Number of bytes successfully written for each traffic class */\n+\n+\t/** Number of bytes dropped for each traffic class */\n \tuint32_t n_bytes_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n-\t/**< Number of bytes dropped for each traffic class */\n \n #ifdef RTE_SCHED_RED\n+\t/** Number of packets dropped by red */\n \tuint32_t n_pkts_red_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n-\t/**< Number of packets dropped by red */\n #endif\n };\n \n /** Queue statistics */\n struct rte_sched_queue_stats {\n-\t/* Packets */\n-\tuint32_t n_pkts;                 /**< Packets successfully written */\n-\tuint32_t n_pkts_dropped;         /**< Packets dropped */\n+\t/** Packets successfully written */\n+\tuint32_t n_pkts;\n+\n+\t/** Packets dropped */\n+\tuint32_t n_pkts_dropped;\n+\n #ifdef RTE_SCHED_RED\n-\tuint32_t n_pkts_red_dropped;\t /**< Packets dropped by RED */\n+\t/** Packets dropped by RED */\n+\tuint32_t n_pkts_red_dropped;\n #endif\n \n-\t/* Bytes */\n-\tuint32_t n_bytes;                /**< Bytes successfully written */\n-\tuint32_t n_bytes_dropped;        /**< Bytes dropped */\n+\t/** Bytes successfully written */\n+\tuint32_t n_bytes;\n+\n+\t/** Bytes dropped */\n+\tuint32_t n_bytes_dropped;\n };\n \n /** Port configuration parameters. */\n",
    "prefixes": [
        "v2",
        "10/28"
    ]
}