get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 99259,
    "url": "https://patches.dpdk.org/api/patches/99259/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210918030659.12448-1-alvinx.zhang@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": "<20210918030659.12448-1-alvinx.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210918030659.12448-1-alvinx.zhang@intel.com",
    "date": "2021-09-18T03:06:58",
    "name": "[v3,1/2] app/testpmd: update forward engine beginning",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cea213553eb607c2708ed098a934b103e74de4a0",
    "submitter": {
        "id": 1398,
        "url": "https://patches.dpdk.org/api/people/1398/?format=api",
        "name": "Alvin Zhang",
        "email": "alvinx.zhang@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210918030659.12448-1-alvinx.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 19031,
            "url": "https://patches.dpdk.org/api/series/19031/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19031",
            "date": "2021-09-18T03:06:58",
            "name": "[v3,1/2] app/testpmd: update forward engine beginning",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/19031/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/99259/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/99259/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3550AA0C47;\n\tSat, 18 Sep 2021 05:07:09 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AD9D04014E;\n\tSat, 18 Sep 2021 05:07:08 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 5A2D44003D\n for <dev@dpdk.org>; Sat, 18 Sep 2021 05:07:07 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Sep 2021 20:07:06 -0700",
            "from shwdenpg235.ccr.corp.intel.com ([10.253.106.22])\n by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Sep 2021 20:07:04 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10110\"; a=\"219720528\"",
            "E=Sophos;i=\"5.85,303,1624345200\"; d=\"scan'208\";a=\"219720528\"",
            "E=Sophos;i=\"5.85,303,1624345200\"; d=\"scan'208\";a=\"483267669\""
        ],
        "From": "Alvin Zhang <alvinx.zhang@intel.com>",
        "To": "xiaoyun.li@intel.com,\n\tkonstantin.ananyev@intel.com",
        "Cc": "dev@dpdk.org,\n\tAlvin Zhang <alvinx.zhang@intel.com>",
        "Date": "Sat, 18 Sep 2021 11:06:58 +0800",
        "Message-Id": "<20210918030659.12448-1-alvinx.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.21.0.windows.1",
        "In-Reply-To": "<20210917013923.4004-1-alvinx.zhang@intel.com>",
        "References": "<20210917013923.4004-1-alvinx.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 1/2] app/testpmd: update forward engine\n beginning",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "For each forward engine, there may be some special conditions\nmust be meet before the forwarding run.\n\nAdding checks for these conditions in configuring is not suitable,\nbecause one condition may rely on multiple configurations, and the\nconditions required by each forward engine is not general.\n\nThe best solution is each forward engine has a callback to check\nwhether these conditions are meet, and then testpmd can call the\ncallback to determine whether the forwarding can be started.\n\nThere was a void callback 'port_fwd_begin' in forward engine,\nit did some initialization for forwarding, this patch updates it's\nreturn type, then we can add some checks in it to confirm whether\nthe forwarding can be started. In addition, this patch puts the\ncalling part of the callback up to before some forwarding related\nstatus being set.\n\nSigned-off-by: Alvin Zhang <alvinx.zhang@intel.com>\n---\n app/test-pmd/flowgen.c     |  3 ++-\n app/test-pmd/ieee1588fwd.c |  3 ++-\n app/test-pmd/noisy_vnf.c   |  4 +++-\n app/test-pmd/testpmd.c     | 38 ++++++++++++++++++++++++++------------\n app/test-pmd/testpmd.h     |  2 +-\n app/test-pmd/txonly.c      |  3 ++-\n 6 files changed, 36 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c\nindex 0d3664a..83234fc 100644\n--- a/app/test-pmd/flowgen.c\n+++ b/app/test-pmd/flowgen.c\n@@ -201,10 +201,11 @@\n \tget_end_cycles(fs, start_tsc);\n }\n \n-static void\n+static int\n flowgen_begin(portid_t pi)\n {\n \tprintf(\"  number of flows for port %u: %d\\n\", pi, nb_flows_flowgen);\n+\treturn 0;\n }\n \n struct fwd_engine flow_gen_engine = {\ndiff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c\nindex 034f238..81624a7 100644\n--- a/app/test-pmd/ieee1588fwd.c\n+++ b/app/test-pmd/ieee1588fwd.c\n@@ -198,10 +198,11 @@ struct ptpv2_msg {\n \tport_ieee1588_tx_timestamp_check(fs->rx_port);\n }\n \n-static void\n+static int\n port_ieee1588_fwd_begin(portid_t pi)\n {\n \trte_eth_timesync_enable(pi);\n+\treturn 0;\n }\n \n static void\ndiff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c\nindex 382a4c2..e4434be 100644\n--- a/app/test-pmd/noisy_vnf.c\n+++ b/app/test-pmd/noisy_vnf.c\n@@ -231,7 +231,7 @@ struct noisy_config {\n \trte_free(noisy_cfg[pi]);\n }\n \n-static void\n+static int\n noisy_fwd_begin(portid_t pi)\n {\n \tstruct noisy_config *n;\n@@ -273,6 +273,8 @@ struct noisy_config {\n \t\trte_exit(EXIT_FAILURE,\n \t\t\t \"--noisy-lkup-memory-size must be > 0\\n\");\n \t}\n+\n+\treturn 0;\n }\n \n struct fwd_engine noisy_vnf_engine = {\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 97ae52e..0345b2e 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -2172,16 +2172,10 @@ struct extmem_param {\n static void\n launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore)\n {\n-\tport_fwd_begin_t port_fwd_begin;\n \tunsigned int i;\n \tunsigned int lc_id;\n \tint diag;\n \n-\tport_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin;\n-\tif (port_fwd_begin != NULL) {\n-\t\tfor (i = 0; i < cur_fwd_config.nb_fwd_ports; i++)\n-\t\t\t(*port_fwd_begin)(fwd_ports_ids[i]);\n-\t}\n \tfor (i = 0; i < cur_fwd_config.nb_fwd_lcores; i++) {\n \t\tlc_id = fwd_lcores_cpuids[i];\n \t\tif ((interactive == 0) || (lc_id != rte_lcore_id())) {\n@@ -2227,10 +2221,35 @@ struct extmem_param {\n \t\tfprintf(stderr, \"Packet forwarding already started\\n\");\n \t\treturn;\n \t}\n-\ttest_done = 0;\n \n \tfwd_config_setup();\n \n+\tport_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin;\n+\tif (port_fwd_begin != NULL) {\n+\t\tfor (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {\n+\t\t\tif (port_fwd_begin(fwd_ports_ids[i])) {\n+\t\t\t\tfprintf(stderr,\n+\t\t\t\t\t\"Packet forwarding not ready\\n\");\n+\t\t\t\treturn;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tif (with_tx_first) {\n+\t\tport_fwd_begin = tx_only_engine.port_fwd_begin;\n+\t\tif (port_fwd_begin != NULL) {\n+\t\t\tfor (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {\n+\t\t\t\tif (port_fwd_begin(fwd_ports_ids[i])) {\n+\t\t\t\t\tfprintf(stderr,\n+\t\t\t\t\t\t\"Packet forwarding not ready\\n\");\n+\t\t\t\t\treturn;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\ttest_done = 0;\n+\n \tif(!no_flush_rx)\n \t\tflush_fwd_rx_queues();\n \n@@ -2239,11 +2258,6 @@ struct extmem_param {\n \n \tfwd_stats_reset();\n \tif (with_tx_first) {\n-\t\tport_fwd_begin = tx_only_engine.port_fwd_begin;\n-\t\tif (port_fwd_begin != NULL) {\n-\t\t\tfor (i = 0; i < cur_fwd_config.nb_fwd_ports; i++)\n-\t\t\t\t(*port_fwd_begin)(fwd_ports_ids[i]);\n-\t\t}\n \t\twhile (with_tx_first--) {\n \t\t\tlaunch_packet_forwarding(\n \t\t\t\t\trun_one_txonly_burst_on_core);\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 5863b2f..e9d9db0 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -268,7 +268,7 @@ struct fwd_lcore {\n  *     Forwards packets unchanged on the same port.\n  *     Check that sent IEEE1588 PTP packets are timestamped by the hardware.\n  */\n-typedef void (*port_fwd_begin_t)(portid_t pi);\n+typedef int (*port_fwd_begin_t)(portid_t pi);\n typedef void (*port_fwd_end_t)(portid_t pi);\n typedef void (*packet_fwd_t)(struct fwd_stream *fs);\n \ndiff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c\nindex aed820f..386a4ff 100644\n--- a/app/test-pmd/txonly.c\n+++ b/app/test-pmd/txonly.c\n@@ -435,7 +435,7 @@\n \tget_end_cycles(fs, start_tsc);\n }\n \n-static void\n+static int\n tx_only_begin(portid_t pi)\n {\n \tuint16_t pkt_data_len;\n@@ -467,6 +467,7 @@\n \t\ttimestamp_init_req++;\n \t/* Make sure all settings are visible on forwarding cores.*/\n \trte_wmb();\n+\treturn 0;\n }\n \n struct fwd_engine tx_only_engine = {\n",
    "prefixes": [
        "v3",
        "1/2"
    ]
}