get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 59830,
    "url": "http://patches.dpdk.org/api/patches/59830/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190926085232.47667-10-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": "<20190926085232.47667-10-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190926085232.47667-10-jasvinder.singh@intel.com",
    "date": "2019-09-26T08:52:26",
    "name": "[v3,09/15] sched: update pkt dequeue for flexible config",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "675fba83c3a521eb61a343d01dc5cda867111b59",
    "submitter": {
        "id": 285,
        "url": "http://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190926085232.47667-10-jasvinder.singh@intel.com/mbox/",
    "series": [
        {
            "id": 6540,
            "url": "http://patches.dpdk.org/api/series/6540/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6540",
            "date": "2019-09-26T08:52:17",
            "name": "sched: subport level configuration of pipe nodes",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/6540/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/59830/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/59830/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 0FDC51BF8A;\n\tThu, 26 Sep 2019 10:53:18 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id D998A1BF2C\n\tfor <dev@dpdk.org>; Thu, 26 Sep 2019 10:52:53 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Sep 2019 01:52:53 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.223.4])\n\tby fmsmga007.fm.intel.com with ESMTP; 26 Sep 2019 01:52:52 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,551,1559545200\"; d=\"scan'208\";a=\"189945589\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com,\n\tLukasz Krakowiak <lukaszx.krakowiak@intel.com>",
        "Date": "Thu, 26 Sep 2019 09:52:26 +0100",
        "Message-Id": "<20190926085232.47667-10-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190926085232.47667-1-jasvinder.singh@intel.com>",
        "References": "<20190909100530.86020-1-jasvinder.singh@intel.com>\n\t<20190926085232.47667-1-jasvinder.singh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 09/15] sched: update pkt dequeue for flexible\n\tconfig",
        "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": "Modify scheduler packet dequeue operation to allow different\nsubports of the same port to have different configuration in terms\nof number of pipes, pipe queue sizes, etc.\n\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\nSigned-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>\n---\n lib/librte_sched/rte_sched.c | 51 ++++++++++++++++++++++++++++--------\n 1 file changed, 40 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c\nindex d7abe9661..e14506b2d 100644\n--- a/lib/librte_sched/rte_sched.c\n+++ b/lib/librte_sched/rte_sched.c\n@@ -243,6 +243,7 @@ struct rte_sched_port {\n \tuint32_t busy_grinders;\n \tstruct rte_mbuf **pkts_out;\n \tuint32_t n_pkts_out;\n+\tuint32_t subport_id;\n \n \t/* Queue base calculation */\n \tuint32_t qsize_add[RTE_SCHED_QUEUES_PER_PIPE];\n@@ -898,6 +899,7 @@ rte_sched_port_config(struct rte_sched_port_params *params)\n \t/* Grinders */\n \tport->pkts_out = NULL;\n \tport->n_pkts_out = 0;\n+\tport->subport_id = 0;\n \n \treturn port;\n }\n@@ -2603,9 +2605,9 @@ grinder_prefetch_mbuf(struct rte_sched_subport *subport, uint32_t pos)\n }\n \n static inline uint32_t\n-grinder_handle(struct rte_sched_port *port, uint32_t pos)\n+grinder_handle(struct rte_sched_port *port,\n+\tstruct rte_sched_subport *subport, uint32_t pos)\n {\n-\tstruct rte_sched_subport *subport = port->subport;\n \tstruct rte_sched_grinder *grinder = subport->grinder + pos;\n \n \tswitch (grinder->state) {\n@@ -2704,6 +2706,7 @@ rte_sched_port_time_resync(struct rte_sched_port *port)\n \tuint64_t cycles = rte_get_tsc_cycles();\n \tuint64_t cycles_diff = cycles - port->time_cpu_cycles;\n \tuint64_t bytes_diff;\n+\tuint32_t i;\n \n \t/* Compute elapsed time in bytes */\n \tbytes_diff = rte_reciprocal_divide(cycles_diff << RTE_SCHED_TIME_SHIFT,\n@@ -2716,20 +2719,21 @@ rte_sched_port_time_resync(struct rte_sched_port *port)\n \t\tport->time = port->time_cpu_bytes;\n \n \t/* Reset pipe loop detection */\n-\tport->pipe_loop = RTE_SCHED_PIPE_INVALID;\n+\tfor (i = 0; i < port->n_subports_per_port; i++)\n+\t\tport->subports[i]->pipe_loop = RTE_SCHED_PIPE_INVALID;\n }\n \n static inline int\n-rte_sched_port_exceptions(struct rte_sched_port *port, int second_pass)\n+rte_sched_port_exceptions(struct rte_sched_subport *subport, int second_pass)\n {\n \tint exceptions;\n \n \t/* Check if any exception flag is set */\n-\texceptions = (second_pass && port->busy_grinders == 0) ||\n-\t\t(port->pipe_exhaustion == 1);\n+\texceptions = (second_pass && subport->busy_grinders == 0) ||\n+\t\t(subport->pipe_exhaustion == 1);\n \n \t/* Clear exception flags */\n-\tport->pipe_exhaustion = 0;\n+\tsubport->pipe_exhaustion = 0;\n \n \treturn exceptions;\n }\n@@ -2737,7 +2741,9 @@ rte_sched_port_exceptions(struct rte_sched_port *port, int second_pass)\n int\n rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uint32_t n_pkts)\n {\n-\tuint32_t i, count;\n+\tstruct rte_sched_subport *subport;\n+\tuint32_t subport_id = port->subport_id;\n+\tuint32_t i, n_subports = 0, count;\n \n \tport->pkts_out = pkts;\n \tport->n_pkts_out = 0;\n@@ -2746,9 +2752,32 @@ rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uint\n \n \t/* Take each queue in the grinder one step further */\n \tfor (i = 0, count = 0; ; i++)  {\n-\t\tcount += grinder_handle(port, i & (RTE_SCHED_PORT_N_GRINDERS - 1));\n-\t\tif ((count == n_pkts) ||\n-\t\t    rte_sched_port_exceptions(port, i >= RTE_SCHED_PORT_N_GRINDERS)) {\n+\t\tsubport = port->subports[subport_id];\n+\n+\t\tcount += grinder_handle(port, subport,\n+\t\t\t\ti & (RTE_SCHED_PORT_N_GRINDERS - 1));\n+\n+\t\tif (count == n_pkts) {\n+\t\t\tsubport_id++;\n+\n+\t\t\tif (subport_id == port->n_subports_per_port)\n+\t\t\t\tsubport_id = 0;\n+\n+\t\t\tport->subport_id = subport_id;\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tif (rte_sched_port_exceptions(subport, i >= RTE_SCHED_PORT_N_GRINDERS)) {\n+\t\t\ti = 0;\n+\t\t\tsubport_id++;\n+\t\t\tn_subports++;\n+\t\t}\n+\n+\t\tif (subport_id == port->n_subports_per_port)\n+\t\t\tsubport_id = 0;\n+\n+\t\tif (n_subports == port->n_subports_per_port) {\n+\t\t\tport->subport_id = subport_id;\n \t\t\tbreak;\n \t\t}\n \t}\n",
    "prefixes": [
        "v3",
        "09/15"
    ]
}