get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21013,
    "url": "https://patches.dpdk.org/api/patches/21013/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1488354455-142764-17-git-send-email-david.hunt@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": "<1488354455-142764-17-git-send-email-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1488354455-142764-17-git-send-email-david.hunt@intel.com",
    "date": "2017-03-01T07:47:33",
    "name": "[dpdk-dev,v8,16/18] examples/distributor: give Rx thread a core",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "38630b58bb80f22398a49477f70367ac2b500c29",
    "submitter": {
        "id": 342,
        "url": "https://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1488354455-142764-17-git-send-email-david.hunt@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/21013/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/21013/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id D0701FA36;\n\tWed,  1 Mar 2017 15:48:04 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id E8DE65A68\n\tfor <dev@dpdk.org>; Wed,  1 Mar 2017 15:47:29 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t01 Mar 2017 06:47:29 -0800",
            "from silpixa00397515.ir.intel.com (HELO\n\tsilpixa00397515.ger.corp.intel.com) ([10.237.223.14])\n\tby fmsmga001.fm.intel.com with ESMTP; 01 Mar 2017 06:47:28 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.35,226,1484035200\"; d=\"scan'208\";\n\ta=\"1117076605\"",
        "From": "David Hunt <david.hunt@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com,\n\tDavid Hunt <david.hunt@intel.com>",
        "Date": "Wed,  1 Mar 2017 07:47:33 +0000",
        "Message-Id": "<1488354455-142764-17-git-send-email-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1488354455-142764-1-git-send-email-david.hunt@intel.com>",
        "References": "<1487647073-129064-2-git-send-email-david.hunt@intel.com>\n\t<1488354455-142764-1-git-send-email-david.hunt@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 16/18] examples/distributor: give Rx thread a\n\tcore",
        "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 so that with the increased amount of stats we are counting,\nwe don't interfere with the rx core.\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n examples/distributor/main.c | 50 ++++++++++++++++++++++++++++++---------------\n 1 file changed, 34 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/examples/distributor/main.c b/examples/distributor/main.c\nindex cf2e826..8daf43d 100644\n--- a/examples/distributor/main.c\n+++ b/examples/distributor/main.c\n@@ -278,6 +278,7 @@ lcore_rx(struct lcore_params *p)\n \n \t\tapp_stats.rx.enqueued_pkts += sent;\n \t\tif (unlikely(sent < nb_ret)) {\n+\t\t\tapp_stats.rx.enqdrop_pkts +=  nb_ret - sent;\n \t\t\tRTE_LOG_DP(DEBUG, DISTRAPP,\n \t\t\t\t\"%s:Packet loss due to full ring\\n\", __func__);\n \t\t\twhile (sent < nb_ret)\n@@ -295,13 +296,12 @@ lcore_rx(struct lcore_params *p)\n static inline void\n flush_one_port(struct output_buffer *outbuf, uint8_t outp)\n {\n-\tunsigned nb_tx = rte_eth_tx_burst(outp, 0, outbuf->mbufs,\n-\t\t\toutbuf->count);\n-\tapp_stats.tx.tx_pkts += nb_tx;\n+\tunsigned int nb_tx = rte_eth_tx_burst(outp, 0,\n+\t\t\toutbuf->mbufs, outbuf->count);\n+\tapp_stats.tx.tx_pkts += outbuf->count;\n \n \tif (unlikely(nb_tx < outbuf->count)) {\n-\t\tRTE_LOG_DP(DEBUG, DISTRAPP,\n-\t\t\t\"%s:Packet loss with tx_burst\\n\", __func__);\n+\t\tapp_stats.tx.enqdrop_pkts +=  outbuf->count - nb_tx;\n \t\tdo {\n \t\t\trte_pktmbuf_free(outbuf->mbufs[nb_tx]);\n \t\t} while (++nb_tx < outbuf->count);\n@@ -313,6 +313,7 @@ static inline void\n flush_all_ports(struct output_buffer *tx_buffers, uint8_t nb_ports)\n {\n \tuint8_t outp;\n+\n \tfor (outp = 0; outp < nb_ports; outp++) {\n \t\t/* skip ports that are not enabled */\n \t\tif ((enabled_port_mask & (1 << outp)) == 0)\n@@ -405,9 +406,9 @@ lcore_tx(struct rte_ring *in_r)\n \t\t\tif ((enabled_port_mask & (1 << port)) == 0)\n \t\t\t\tcontinue;\n \n-\t\t\tstruct rte_mbuf *bufs[BURST_SIZE];\n+\t\t\tstruct rte_mbuf *bufs[BURST_SIZE_TX];\n \t\t\tconst uint16_t nb_rx = rte_ring_dequeue_burst(in_r,\n-\t\t\t\t\t(void *)bufs, BURST_SIZE);\n+\t\t\t\t\t(void *)bufs, BURST_SIZE_TX);\n \t\t\tapp_stats.tx.dequeue_pkts += nb_rx;\n \n \t\t\t/* if we get no traffic, flush anything we have */\n@@ -436,11 +437,12 @@ lcore_tx(struct rte_ring *in_r)\n \n \t\t\t\toutbuf = &tx_buffers[outp];\n \t\t\t\toutbuf->mbufs[outbuf->count++] = bufs[i];\n-\t\t\t\tif (outbuf->count == BURST_SIZE)\n+\t\t\t\tif (outbuf->count == BURST_SIZE_TX)\n \t\t\t\t\tflush_one_port(outbuf, outp);\n \t\t\t}\n \t\t}\n \t}\n+\tprintf(\"\\nCore %u exiting tx task.\\n\", rte_lcore_id());\n \treturn 0;\n }\n \n@@ -562,6 +564,8 @@ lcore_worker(struct lcore_params *p)\n \tfor (i = 0; i < 8; i++)\n \t\tbuf[i] = NULL;\n \n+\tapp_stats.worker_pkts[p->worker_id] = 1;\n+\n \tprintf(\"\\nCore %u acting as worker core.\\n\", rte_lcore_id());\n \twhile (!quit_signal_work) {\n \t\tnum = rte_distributor_get_pkt(d, id, buf, buf, num);\n@@ -573,6 +577,10 @@ lcore_worker(struct lcore_params *p)\n \t\t\t\trte_pause();\n \t\t\tbuf[i]->port ^= xor_val;\n \t\t}\n+\n+\t\tapp_stats.worker_pkts[p->worker_id] += num;\n+\t\tif (num > 0)\n+\t\t\tapp_stats.worker_bursts[p->worker_id][num-1]++;\n \t}\n \treturn 0;\n }\n@@ -677,9 +685,10 @@ main(int argc, char *argv[])\n \tif (ret < 0)\n \t\trte_exit(EXIT_FAILURE, \"Invalid distributor parameters\\n\");\n \n-\tif (rte_lcore_count() < 4)\n+\tif (rte_lcore_count() < 5)\n \t\trte_exit(EXIT_FAILURE, \"Error, This application needs at \"\n-\t\t\t\t\"least 4 logical cores to run:\\n\"\n+\t\t\t\t\"least 5 logical cores to run:\\n\"\n+\t\t\t\t\"1 lcore for stats (can be core 0)\\n\"\n \t\t\t\t\"1 lcore for packet RX\\n\"\n \t\t\t\t\"1 lcore for distribution\\n\"\n \t\t\t\t\"1 lcore for packet TX\\n\"\n@@ -721,7 +730,7 @@ main(int argc, char *argv[])\n \t}\n \n \td = rte_distributor_create(\"PKT_DIST\", rte_socket_id(),\n-\t\t\trte_lcore_count() - 3,\n+\t\t\trte_lcore_count() - 4,\n \t\t\tRTE_DIST_ALG_BURST);\n \tif (d == NULL)\n \t\trte_exit(EXIT_FAILURE, \"Cannot create distributor\\n\");\n@@ -760,7 +769,21 @@ main(int argc, char *argv[])\n \t\t\t/* tx core */\n \t\t\trte_eal_remote_launch((lcore_function_t *)lcore_tx,\n \t\t\t\t\tdist_tx_ring, lcore_id);\n+\t\t} else if (worker_id == rte_lcore_count() - 2) {\n+\t\t\tprintf(\"Starting rx on worker_id %d, lcore_id %d\\n\",\n+\t\t\t\t\tworker_id, lcore_id);\n+\t\t\t/* rx core */\n+\t\t\tstruct lcore_params *p =\n+\t\t\t\t\trte_malloc(NULL, sizeof(*p), 0);\n+\t\t\tif (!p)\n+\t\t\t\trte_panic(\"malloc failure\\n\");\n+\t\t\t*p = (struct lcore_params){worker_id, d, rx_dist_ring,\n+\t\t\t\t\tdist_tx_ring, mbuf_pool};\n+\t\t\trte_eal_remote_launch((lcore_function_t *)lcore_rx,\n+\t\t\t\t\tp, lcore_id);\n \t\t} else {\n+\t\t\tprintf(\"Starting worker on worker_id %d, lcore_id %d\\n\",\n+\t\t\t\t\tworker_id, lcore_id);\n \t\t\tstruct lcore_params *p =\n \t\t\t\t\trte_malloc(NULL, sizeof(*p), 0);\n \t\t\tif (!p)\n@@ -773,11 +796,6 @@ main(int argc, char *argv[])\n \t\t}\n \t\tworker_id++;\n \t}\n-\t/* call lcore_main on master core only */\n-\tstruct lcore_params p = { 0, d, rx_dist_ring, dist_tx_ring, mbuf_pool};\n-\n-\tif (lcore_rx(&p) != 0)\n-\t\treturn -1;\n \n \tfreq = rte_get_timer_hz();\n \tt = rte_rdtsc() + freq;\n",
    "prefixes": [
        "dpdk-dev",
        "v8",
        "16/18"
    ]
}