get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54233,
    "url": "http://patches.dpdk.org/api/patches/54233/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1559583160-13944-10-git-send-email-anoobj@marvell.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": "<1559583160-13944-10-git-send-email-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1559583160-13944-10-git-send-email-anoobj@marvell.com",
    "date": "2019-06-03T17:32:09",
    "name": "[09/39] examples/l2fwd-event: move periodic tasks to new func",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "f5620755114c7aa44e16775b1811dcc13902253a",
    "submitter": {
        "id": 1205,
        "url": "http://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1559583160-13944-10-git-send-email-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 4868,
            "url": "http://patches.dpdk.org/api/series/4868/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4868",
            "date": "2019-06-03T17:32:00",
            "name": "adding eventmode helper library",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4868/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54233/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54233/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 2FCFF1B9EC;\n\tMon,  3 Jun 2019 19:34:18 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 394B81B9EC\n\tfor <dev@dpdk.org>; Mon,  3 Jun 2019 19:34:17 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n\tby mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx53HKlmv000910; Mon, 3 Jun 2019 10:34:16 -0700",
            "from sc-exch03.marvell.com ([199.233.58.183])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2sw2wmhdch-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 03 Jun 2019 10:34:16 -0700",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 3 Jun 2019 10:34:15 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 3 Jun 2019 10:34:13 -0700",
            "from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56])\n\tby maili.marvell.com (Postfix) with ESMTP id 97E0F3F703F;\n\tMon,  3 Jun 2019 10:34:08 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-transfer-encoding : content-type; s=pfpt0818;\n\tbh=pLMv4sw5YaDUqJ83VNU1HniFLIVKVZxpUPFP8V2jVYU=;\n\tb=hycwYvJCmJZfajAzj7YXCrB2PSSm5iM8wa5V6o9DzaX86S/9XAn8F9K0D/AbnFAcJuz+\n\tmDmiz8QMzyKio2eXnMF5FU3zg2kXRH5X478nxrMaz5FQ7JBaoLxIGpe3UGqYdHooARmg\n\t98Du//W1oNdcEgULdHaxV4eDnRTTpmtLdou27B7LIb3taoFdJLszNShWE7D5jGweDuOr\n\tNBqpO+mpfulYdjY1UAf8R7vOun2xhXej6t946p5ETFuv8pmyK6E5UAlbeRNJNHgpymXp\n\tpqG8f9X3Ww50qjCP+qaxU/zJspT5vr0Y0reQz0wbpTdjZZpPZdsZ7W9w7wXinnHIbCuP\n\t8g== ",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Jerin Jacob <jerinj@marvell.com>, Nikhil Rao <nikhil.rao@intel.com>,\n\t\"Erik Gabriel Carrillo\" <erik.g.carrillo@intel.com>, Abhinandan Gujjar\n\t<abhinandan.gujjar@intel.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "CC": "Anoob Joseph <anoobj@marvell.com>, Narayana Prasad <pathreya@marvell.com>,\n\t<dev@dpdk.org>, Lukasz Bartosik <lbartosik@marvell.com>, Pavan Nikhilesh\n\t<pbhagavatula@marvell.com>, Hemant Agrawal <hemant.agrawal@nxp.com>,\n\t\"Nipun  Gupta\" <nipun.gupta@nxp.com>, Harry van Haaren\n\t<harry.van.haaren@intel.com>, =?utf-8?q?Mattias_R=C3=B6nnblom?=\n\t<mattias.ronnblom@ericsson.com>,  Liang Ma <liang.j.ma@intel.com>",
        "Date": "Mon, 3 Jun 2019 23:02:09 +0530",
        "Message-ID": "<1559583160-13944-10-git-send-email-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>",
        "References": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:, ,\n\tdefinitions=2019-06-03_13:, , signatures=0",
        "Subject": "[dpdk-dev] [PATCH 09/39] examples/l2fwd-event: move periodic tasks\n\tto new func",
        "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": "Move the periodic operations (stats flush and drain buffers) to a new\nfunction.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Lukasz Bartosik <lbartosik@marvell.com>\n---\n examples/l2fwd-event/l2fwd_worker.c | 83 ++++++++++++++++++++-----------------\n examples/l2fwd-event/l2fwd_worker.h |  6 +++\n 2 files changed, 52 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/examples/l2fwd-event/l2fwd_worker.c b/examples/l2fwd-event/l2fwd_worker.c\nindex 86bdd40..49bbdb6 100644\n--- a/examples/l2fwd-event/l2fwd_worker.c\n+++ b/examples/l2fwd-event/l2fwd_worker.c\n@@ -94,6 +94,45 @@ l2fwd_drain_buffers(struct lcore_queue_conf *qconf)\n \t}\n }\n \n+static inline void\n+l2fwd_periodic_drain_stats_monitor(struct lcore_queue_conf *qconf,\n+\t\tstruct tsc_tracker *t, int is_master_core)\n+{\n+\tuint64_t diff_tsc, cur_tsc;\n+\n+\tcur_tsc = rte_rdtsc();\n+\n+\t/*\n+\t * TX burst queue drain\n+\t */\n+\tdiff_tsc = cur_tsc - t->prev_tsc;\n+\tif (unlikely(diff_tsc > t->drain_tsc)) {\n+\n+\t\t/* Drain buffers */\n+\t\tl2fwd_drain_buffers(qconf);\n+\n+\t\t/* if timer is enabled */\n+\t\tif (timer_period > 0) {\n+\n+\t\t\t/* advance the timer */\n+\t\t\tt->timer_tsc += diff_tsc;\n+\n+\t\t\t/* if timer has reached its timeout */\n+\t\t\tif (unlikely(t->timer_tsc >= timer_period)) {\n+\n+\t\t\t\t/* do this only on master core */\n+\t\t\t\tif (is_master_core) {\n+\t\t\t\t\tprint_stats();\n+\t\t\t\t\t/* reset the timer */\n+\t\t\t\t\tt->timer_tsc = 0;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\n+\t\tt->prev_tsc = cur_tsc;\n+\t}\n+}\n+\n static void\n l2fwd_mac_updating(struct rte_mbuf *m, unsigned int dest_portid)\n {\n@@ -135,19 +174,18 @@ l2fwd_main_loop(void)\n \tstruct rte_mbuf *pkts_burst[MAX_PKT_BURST];\n \tstruct rte_mbuf *m;\n \tunsigned int lcore_id;\n-\tuint64_t prev_tsc, diff_tsc, cur_tsc, timer_tsc;\n \tunsigned int i, j, portid, nb_rx;\n \tstruct lcore_queue_conf *qconf;\n-\tconst uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)\n-\t\t\t/ US_PER_S * BURST_TX_DRAIN_US;\n \tint is_master_core;\n-\n-\tprev_tsc = 0;\n-\ttimer_tsc = 0;\n+\tstruct tsc_tracker tsc = {0};\n \n \tlcore_id = rte_lcore_id();\n \tqconf = &lcore_queue_conf[lcore_id];\n \n+\t/* Set drain tsc */\n+\ttsc.drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /\n+\t\t\tUS_PER_S * BURST_TX_DRAIN_US;\n+\n \tif (qconf->n_rx_port == 0) {\n \t\tRTE_LOG(INFO, L2FWD, \"lcore %u has nothing to do\\n\", lcore_id);\n \t\treturn;\n@@ -168,37 +206,8 @@ l2fwd_main_loop(void)\n \n \twhile (!force_quit) {\n \n-\t\tcur_tsc = rte_rdtsc();\n-\n-\t\t/*\n-\t\t * TX burst queue drain\n-\t\t */\n-\t\tdiff_tsc = cur_tsc - prev_tsc;\n-\t\tif (unlikely(diff_tsc > drain_tsc)) {\n-\n-\t\t\t/* Drain buffers */\n-\t\t\tl2fwd_drain_buffers(qconf);\n-\n-\t\t\t/* if timer is enabled */\n-\t\t\tif (timer_period > 0) {\n-\n-\t\t\t\t/* advance the timer */\n-\t\t\t\ttimer_tsc += diff_tsc;\n-\n-\t\t\t\t/* if timer has reached its timeout */\n-\t\t\t\tif (unlikely(timer_tsc >= timer_period)) {\n-\n-\t\t\t\t\t/* do this only on master core */\n-\t\t\t\t\tif (is_master_core) {\n-\t\t\t\t\t\tprint_stats();\n-\t\t\t\t\t\t/* reset the timer */\n-\t\t\t\t\t\ttimer_tsc = 0;\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tprev_tsc = cur_tsc;\n-\t\t}\n+\t\t/* Do periodic operations (buffer drain & stats monitor) */\n+\t\tl2fwd_periodic_drain_stats_monitor(qconf, &tsc, is_master_core);\n \n \t\t/*\n \t\t * Read packet from RX queues\ndiff --git a/examples/l2fwd-event/l2fwd_worker.h b/examples/l2fwd-event/l2fwd_worker.h\nindex dc4da5b..22d7c5c 100644\n--- a/examples/l2fwd-event/l2fwd_worker.h\n+++ b/examples/l2fwd-event/l2fwd_worker.h\n@@ -4,6 +4,12 @@\n #ifndef _L2FWD_WORKER_H_\n #define _L2FWD_WORKER_H_\n \n+struct tsc_tracker {\n+\tuint64_t prev_tsc;\n+\tuint64_t timer_tsc;\n+\tuint64_t drain_tsc;\n+};\n+\n int\n l2fwd_launch_one_lcore(__attribute__((unused)) void *dummy);\n \n",
    "prefixes": [
        "09/39"
    ]
}