get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55331,
    "url": "http://patches.dpdk.org/api/patches/55331/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190625153217.24301-8-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-8-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190625153217.24301-8-jasvinder.singh@intel.com",
    "date": "2019-06-25T15:31:56",
    "name": "[v2,07/28] sched: update pipe profile add API",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "74bce9d37eb2635c9e73570d1782597e1d387a7f",
    "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-8-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/55331/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/55331/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 5DD941BAE4;\n\tTue, 25 Jun 2019 17:32:20 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 3DE581BA5D\n\tfor <dev@dpdk.org>; Tue, 25 Jun 2019 17:32:10 +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:09 -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:08 -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=\"166711461\"",
        "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:56 +0100",
        "Message-Id": "<20190625153217.24301-8-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 07/28] sched: update pipe profile add 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": "Update the pipe profile add api implementation 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 | 104 ++++++++++++++++++++++++++---------\n 1 file changed, 78 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c\nindex 46a98ad63..619b4763f 100644\n--- a/lib/librte_sched/rte_sched.c\n+++ b/lib/librte_sched/rte_sched.c\n@@ -348,44 +348,69 @@ pipe_profile_check(struct rte_sched_pipe_params *params,\n \tuint32_t i;\n \n \t/* Pipe parameters */\n-\tif (params == NULL)\n-\t\treturn -11;\n+\tif (params == NULL) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for parameter params \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n \n \t/* TB rate: non-zero, not greater than port rate */\n \tif (params->tb_rate == 0 ||\n-\t\tparams->tb_rate > rate)\n-\t\treturn -12;\n+\t\tparams->tb_rate > rate) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for tb rate \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n \n \t/* TB size: non-zero */\n-\tif (params->tb_size == 0)\n-\t\treturn -13;\n+\tif (params->tb_size == 0) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for tb size \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n \n \t/* TC rate: non-zero, less than pipe rate */\n \tfor (i = 0; i < RTE_SCHED_TRAFFIC_CLASS_BE; i++) {\n \t\tif ((qsize[i] == 0 && params->tc_rate[i] != 0) ||\n \t\t\t(qsize[i] != 0 && (params->tc_rate[i] == 0 ||\n-\t\t\tparams->tc_rate[i] > params->tb_rate)))\n-\t\t\treturn -14;\n+\t\t\tparams->tc_rate[i] > params->tb_rate))) {\n+\t\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\t\"%s: Incorrect value for qsize or tc_rate \\n\", __func__);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\tif (params->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE] == 0) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for be traffic class rate \\n\", __func__);\n+\t\treturn -EINVAL;\n \t}\n-\tif (params->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE] == 0)\n-\t\treturn -15;\n \n \t/* TC period: non-zero */\n-\tif (params->tc_period == 0)\n-\t\treturn -16;\n+\tif (params->tc_period == 0) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for tc period \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n \n #ifdef RTE_SCHED_SUBPORT_TC_OV\n \t/* TC3 oversubscription weight: non-zero */\n-\tif (params->tc_ov_weight == 0)\n-\t\treturn -17;\n+\tif (params->tc_ov_weight == 0) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for tc ov weight \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n #endif\n \n \t/* Queue WRR weights: non-zero */\n \tfor (i = 0; i < RTE_SCHED_BE_QUEUES_PER_PIPE; i++) {\n \t\tuint32_t qindex = RTE_SCHED_TRAFFIC_CLASS_BE + i;\n \t\tif ((qsize[qindex] != 0 && params->wrr_weights[i] == 0) ||\n-\t\t\t(qsize[qindex] == 0 && params->wrr_weights[i] != 0))\n-\t\t\treturn -18;\n+\t\t\t(qsize[qindex] == 0 && params->wrr_weights[i] != 0)) {\n+\t\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\t\"%s: Incorrect value for qsize or wrr weight \\n\", __func__);\n+\t\t\treturn -EINVAL;\n+\t\t}\n \t}\n \n \treturn 0;\n@@ -861,6 +886,18 @@ rte_sched_subport_check_params(struct rte_sched_subport_params *params,\n \t\treturn -EINVAL;\n \t}\n \n+\tfor (i = 0; i < params->n_pipe_profiles; i++) {\n+\t\tstruct rte_sched_pipe_params *p = params->pipe_profiles + i;\n+\t\tint status;\n+\n+\t\tstatus = pipe_profile_check(p, rate, &params->qsize[0]);\n+\t\tif (status != 0) {\n+\t\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\t\"%s: Pipe profile check failed(%d) \\n\", __func__, status);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \treturn 0;\n }\n \n@@ -1316,31 +1353,46 @@ rte_sched_port_pipe_profile_add(struct rte_sched_port *port,\n \tint status;\n \n \t/* Port */\n-\tif (port == 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 \t/* Subport id not exceeds the max limit */\n-\tif (subport_id > port->n_subports_per_port)\n-\t\treturn -2;\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 \ts = port->subports[subport_id];\n \n \t/* Pipe profiles not exceeds the max limit */\n-\tif (s->n_pipe_profiles >= s->n_max_pipe_profiles)\n-\t\treturn -3;\n+\tif (s->n_pipe_profiles >= s->n_max_pipe_profiles) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Number of pipe profiles exceeds the max limit \\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n \n \t/* Pipe params */\n \tstatus = pipe_profile_check(params, port->rate, &s->qsize[0]);\n-\tif (status != 0)\n-\t\treturn status;\n+\tif (status != 0) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Pipe profile check failed(%d) \\n\", __func__, status);\n+\t\treturn -EINVAL;\n+\t}\n \n \tpp = &s->pipe_profiles[s->n_pipe_profiles];\n \trte_sched_pipe_profile_convert(s, params, pp, port->rate);\n \n \t/* Pipe profile not exists */\n \tfor (i = 0; i < s->n_pipe_profiles; i++)\n-\t\tif (memcmp(s->pipe_profiles + i, pp, sizeof(*pp)) == 0)\n-\t\t\treturn -4;\n+\t\tif (memcmp(s->pipe_profiles + i, pp, sizeof(*pp)) == 0) {\n+\t\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\t\"%s: Pipe profile doesn't exist \\n\", __func__);\n+\t\t\treturn -EINVAL;\n+\t\t}\n \n \t/* Pipe profile commit */\n \t*pipe_profile_id = s->n_pipe_profiles;\n",
    "prefixes": [
        "v2",
        "07/28"
    ]
}