get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123306,
    "url": "https://patches.dpdk.org/api/patches/123306/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230207154943.18779-8-syalavarthi@marvell.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": "<20230207154943.18779-8-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230207154943.18779-8-syalavarthi@marvell.com",
    "date": "2023-02-07T15:49:38",
    "name": "[v4,07/12] app/mldev: enable support for burst inferences",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "63d358659596603a2b5fa59eaa41a61287a52157",
    "submitter": {
        "id": 2480,
        "url": "https://patches.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230207154943.18779-8-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 26858,
            "url": "https://patches.dpdk.org/api/series/26858/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26858",
            "date": "2023-02-07T15:49:31",
            "name": "Implementation of mldev test application",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/26858/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/123306/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/123306/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 4EDB241C30;\n\tTue,  7 Feb 2023 16:50:38 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5CD1842D0B;\n\tTue,  7 Feb 2023 16:49:58 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 38A0F40A84\n for <dev@dpdk.org>; Tue,  7 Feb 2023 16:49:51 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 317EbMc7006803 for <dev@dpdk.org>; Tue, 7 Feb 2023 07:49:50 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3nkdyrspmy-5\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 07 Feb 2023 07:49:50 -0800",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42;\n Tue, 7 Feb 2023 07:49:48 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend\n Transport; Tue, 7 Feb 2023 07:49:48 -0800",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id AEEBF3F7088;\n Tue,  7 Feb 2023 07:49:48 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=HYj79JDE1kFzcY9+PwSlWCQZWI/c6G02bMc37OsHCNU=;\n b=RsSGXgNRLAXlwX7Vfp+y//QzeTQ937TSG4gC/G5+Xxx21WP8W161Ra4Qw9Nv9O2odStv\n IvgIRgOl0y0tlnsA/Ovt08eSuZaYn8IGhhxC5Z9YfWuWZPjazq6rzjBK+DrK/W1c6raI\n H8LkXhJNO8Vsi+Yxzt3/Kcsaw1mV2fbbCEGzBJJ1RuzFz8UdFa1Fjo4vsFwxqgd00HSf\n DlQP7zHfOuXp2WvuBD4BqkY8cRQVz/+4tfUXIPOnYeVOTwGjjUzyWIwlT4XRe3arJQvv\n bpKi/6l9Wo0TDBHdMDQLnYU4AcBfDpI9nT6i7XAIo6HnIJxVNXFQjPHBIwYPF8MjQv7O OA==",
        "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "CC": "<dev@dpdk.org>, <sshankarnara@marvell.com>, <jerinj@marvell.com>,\n <aprabhu@marvell.com>, <ptakkar@marvell.com>, <pshukla@marvell.com>",
        "Subject": "[PATCH v4 07/12] app/mldev: enable support for burst inferences",
        "Date": "Tue, 7 Feb 2023 07:49:38 -0800",
        "Message-ID": "<20230207154943.18779-8-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20230207154943.18779-1-syalavarthi@marvell.com>",
        "References": "<20221129070746.20396-1-syalavarthi@marvell.com>\n <20230207154943.18779-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "CRJ5FMP3xBvlmI_wwMgEGwRJLZK30fkn",
        "X-Proofpoint-GUID": "CRJ5FMP3xBvlmI_wwMgEGwRJLZK30fkn",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1\n definitions=2023-02-07_07,2023-02-06_03,2022-06-22_01",
        "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"
    },
    "content": "Added 'burst_size' support for inference tests. Burst size\ncontrols the number of inference requests handled during\nthe burst enqueue and dequeue operations of the test case.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n app/test-mldev/ml_options.c            |  26 ++--\n app/test-mldev/ml_options.h            |   2 +\n app/test-mldev/test_inference_common.c | 159 ++++++++++++++++++++++++-\n app/test-mldev/test_inference_common.h |   4 +\n 4 files changed, 181 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/app/test-mldev/ml_options.c b/app/test-mldev/ml_options.c\nindex 01ea050ee7..1990939200 100644\n--- a/app/test-mldev/ml_options.c\n+++ b/app/test-mldev/ml_options.c\n@@ -30,6 +30,7 @@ ml_options_default(struct ml_options *opt)\n \topt->socket_id = SOCKET_ID_ANY;\n \topt->nb_filelist = 0;\n \topt->repetitions = 1;\n+\topt->burst_size = 1;\n \topt->debug = false;\n }\n \n@@ -151,6 +152,12 @@ ml_parse_repetitions(struct ml_options *opt, const char *arg)\n \treturn parser_read_uint64(&opt->repetitions, arg);\n }\n \n+static int\n+ml_parse_burst_size(struct ml_options *opt, const char *arg)\n+{\n+\treturn parser_read_uint16(&opt->burst_size, arg);\n+}\n+\n static void\n ml_dump_test_options(const char *testname)\n {\n@@ -165,7 +172,8 @@ ml_dump_test_options(const char *testname)\n \tif ((strcmp(testname, \"inference_ordered\") == 0) ||\n \t    (strcmp(testname, \"inference_interleave\") == 0)) {\n \t\tprintf(\"\\t\\t--filelist         : comma separated list of model, input and output\\n\"\n-\t\t       \"\\t\\t--repetitions      : number of inference repetitions\\n\");\n+\t\t       \"\\t\\t--repetitions      : number of inference repetitions\\n\"\n+\t\t       \"\\t\\t--burst_size       : inference burst size\\n\");\n \t\tprintf(\"\\n\");\n \t}\n }\n@@ -185,10 +193,11 @@ print_usage(char *program)\n \tml_test_dump_names(ml_dump_test_options);\n }\n \n-static struct option lgopts[] = {\n-\t{ML_TEST, 1, 0, 0},   {ML_DEVICE_ID, 1, 0, 0}, {ML_SOCKET_ID, 1, 0, 0},\n-\t{ML_MODELS, 1, 0, 0}, {ML_FILELIST, 1, 0, 0},  {ML_REPETITIONS, 1, 0, 0},\n-\t{ML_DEBUG, 0, 0, 0},  {ML_HELP, 0, 0, 0},      {NULL, 0, 0, 0}};\n+static struct option lgopts[] = {{ML_TEST, 1, 0, 0},\t   {ML_DEVICE_ID, 1, 0, 0},\n+\t\t\t\t {ML_SOCKET_ID, 1, 0, 0},  {ML_MODELS, 1, 0, 0},\n+\t\t\t\t {ML_FILELIST, 1, 0, 0},   {ML_REPETITIONS, 1, 0, 0},\n+\t\t\t\t {ML_BURST_SIZE, 1, 0, 0}, {ML_DEBUG, 0, 0, 0},\n+\t\t\t\t {ML_HELP, 0, 0, 0},\t   {NULL, 0, 0, 0}};\n \n static int\n ml_opts_parse_long(int opt_idx, struct ml_options *opt)\n@@ -196,9 +205,10 @@ ml_opts_parse_long(int opt_idx, struct ml_options *opt)\n \tunsigned int i;\n \n \tstruct long_opt_parser parsermap[] = {\n-\t\t{ML_TEST, ml_parse_test_name},\t    {ML_DEVICE_ID, ml_parse_dev_id},\n-\t\t{ML_SOCKET_ID, ml_parse_socket_id}, {ML_MODELS, ml_parse_models},\n-\t\t{ML_FILELIST, ml_parse_filelist},   {ML_REPETITIONS, ml_parse_repetitions},\n+\t\t{ML_TEST, ml_parse_test_name},\t      {ML_DEVICE_ID, ml_parse_dev_id},\n+\t\t{ML_SOCKET_ID, ml_parse_socket_id},   {ML_MODELS, ml_parse_models},\n+\t\t{ML_FILELIST, ml_parse_filelist},     {ML_REPETITIONS, ml_parse_repetitions},\n+\t\t{ML_BURST_SIZE, ml_parse_burst_size},\n \t};\n \n \tfor (i = 0; i < RTE_DIM(parsermap); i++) {\ndiff --git a/app/test-mldev/ml_options.h b/app/test-mldev/ml_options.h\nindex ad8aee5964..305b39629a 100644\n--- a/app/test-mldev/ml_options.h\n+++ b/app/test-mldev/ml_options.h\n@@ -19,6 +19,7 @@\n #define ML_MODELS      (\"models\")\n #define ML_FILELIST    (\"filelist\")\n #define ML_REPETITIONS (\"repetitions\")\n+#define ML_BURST_SIZE  (\"burst_size\")\n #define ML_DEBUG       (\"debug\")\n #define ML_HELP\t       (\"help\")\n \n@@ -35,6 +36,7 @@ struct ml_options {\n \tstruct ml_filelist filelist[ML_TEST_MAX_MODELS];\n \tuint8_t nb_filelist;\n \tuint64_t repetitions;\n+\tuint16_t burst_size;\n \tbool debug;\n };\n \ndiff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c\nindex ae0f4489f7..95d7f8d17d 100644\n--- a/app/test-mldev/test_inference_common.c\n+++ b/app/test-mldev/test_inference_common.c\n@@ -129,6 +129,131 @@ ml_dequeue_single(void *arg)\n \treturn 0;\n }\n \n+/* Enqueue inference requests with burst size greater than 1 */\n+static int\n+ml_enqueue_burst(void *arg)\n+{\n+\tstruct test_inference *t = ml_test_priv((struct ml_test *)arg);\n+\tstruct ml_core_args *args;\n+\tuint16_t ops_count;\n+\tuint64_t model_enq;\n+\tuint16_t burst_enq;\n+\tuint32_t lcore_id;\n+\tuint16_t pending;\n+\tuint16_t idx;\n+\tuint16_t fid;\n+\tuint16_t i;\n+\tint ret;\n+\n+\tlcore_id = rte_lcore_id();\n+\targs = &t->args[lcore_id];\n+\tmodel_enq = 0;\n+\n+\tif (args->nb_reqs == 0)\n+\t\treturn 0;\n+\n+next_rep:\n+\tfid = args->start_fid;\n+\n+next_model:\n+\tops_count = RTE_MIN(t->cmn.opt->burst_size, args->nb_reqs - model_enq);\n+\tret = rte_mempool_get_bulk(t->op_pool, (void **)args->enq_ops, ops_count);\n+\tif (ret != 0)\n+\t\tgoto next_model;\n+\n+retry:\n+\tret = rte_mempool_get_bulk(t->model[fid].io_pool, (void **)args->reqs, ops_count);\n+\tif (ret != 0)\n+\t\tgoto retry;\n+\n+\tfor (i = 0; i < ops_count; i++) {\n+\t\targs->enq_ops[i]->model_id = t->model[fid].id;\n+\t\targs->enq_ops[i]->nb_batches = t->model[fid].info.batch_size;\n+\t\targs->enq_ops[i]->mempool = t->op_pool;\n+\n+\t\targs->enq_ops[i]->input.addr = args->reqs[i]->input;\n+\t\targs->enq_ops[i]->input.length = t->model[fid].inp_qsize;\n+\t\targs->enq_ops[i]->input.next = NULL;\n+\n+\t\targs->enq_ops[i]->output.addr = args->reqs[i]->output;\n+\t\targs->enq_ops[i]->output.length = t->model[fid].out_qsize;\n+\t\targs->enq_ops[i]->output.next = NULL;\n+\n+\t\targs->enq_ops[i]->user_ptr = args->reqs[i];\n+\t\targs->reqs[i]->niters++;\n+\t\targs->reqs[i]->fid = fid;\n+\t}\n+\n+\tidx = 0;\n+\tpending = ops_count;\n+\n+enqueue_reqs:\n+\tburst_enq = rte_ml_enqueue_burst(t->cmn.opt->dev_id, 0, &args->enq_ops[idx], pending);\n+\tpending = pending - burst_enq;\n+\n+\tif (pending > 0) {\n+\t\tidx = idx + burst_enq;\n+\t\tgoto enqueue_reqs;\n+\t}\n+\n+\tfid++;\n+\tif (fid <= args->end_fid)\n+\t\tgoto next_model;\n+\n+\tmodel_enq = model_enq + ops_count;\n+\tif (model_enq < args->nb_reqs)\n+\t\tgoto next_rep;\n+\n+\treturn 0;\n+}\n+\n+/* Dequeue inference requests with burst size greater than 1 */\n+static int\n+ml_dequeue_burst(void *arg)\n+{\n+\tstruct test_inference *t = ml_test_priv((struct ml_test *)arg);\n+\tstruct rte_ml_op_error error;\n+\tstruct ml_core_args *args;\n+\tstruct ml_request *req;\n+\tuint64_t total_deq = 0;\n+\tuint16_t burst_deq = 0;\n+\tuint8_t nb_filelist;\n+\tuint32_t lcore_id;\n+\tuint32_t i;\n+\n+\tlcore_id = rte_lcore_id();\n+\targs = &t->args[lcore_id];\n+\tnb_filelist = args->end_fid - args->start_fid + 1;\n+\n+\tif (args->nb_reqs == 0)\n+\t\treturn 0;\n+\n+dequeue_burst:\n+\tburst_deq =\n+\t\trte_ml_dequeue_burst(t->cmn.opt->dev_id, 0, args->deq_ops, t->cmn.opt->burst_size);\n+\n+\tif (likely(burst_deq > 0)) {\n+\t\ttotal_deq += burst_deq;\n+\n+\t\tfor (i = 0; i < burst_deq; i++) {\n+\t\t\tif (unlikely(args->deq_ops[i]->status == RTE_ML_OP_STATUS_ERROR)) {\n+\t\t\t\trte_ml_op_error_get(t->cmn.opt->dev_id, args->deq_ops[i], &error);\n+\t\t\t\tml_err(\"error_code = 0x%\" PRIx64 \", error_message = %s\\n\",\n+\t\t\t\t       error.errcode, error.message);\n+\t\t\t}\n+\t\t\treq = (struct ml_request *)args->deq_ops[i]->user_ptr;\n+\t\t\tif (req != NULL)\n+\t\t\t\trte_mempool_put(t->model[req->fid].io_pool, req);\n+\t\t}\n+\t\trte_mempool_put_bulk(t->op_pool, (void *)args->deq_ops, burst_deq);\n+\t}\n+\n+\tif (total_deq < args->nb_reqs * nb_filelist)\n+\t\tgoto dequeue_burst;\n+\n+\treturn 0;\n+}\n+\n bool\n test_inference_cap_check(struct ml_options *opt)\n {\n@@ -178,6 +303,17 @@ test_inference_opt_check(struct ml_options *opt)\n \t\treturn -EINVAL;\n \t}\n \n+\tif (opt->burst_size == 0) {\n+\t\tml_err(\"Invalid option, burst_size = %u\\n\", opt->burst_size);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (opt->burst_size > ML_TEST_MAX_POOL_SIZE) {\n+\t\tml_err(\"Invalid option, burst_size = %u (> max supported = %d)\\n\", opt->burst_size,\n+\t\t       ML_TEST_MAX_POOL_SIZE);\n+\t\treturn -EINVAL;\n+\t}\n+\n \t/* check number of available lcores. */\n \tif (rte_lcore_count() < 3) {\n \t\tml_err(\"Insufficient lcores = %u\\n\", rte_lcore_count());\n@@ -198,6 +334,7 @@ test_inference_opt_dump(struct ml_options *opt)\n \n \t/* dump test opts */\n \tml_dump(\"repetitions\", \"%\" PRIu64, opt->repetitions);\n+\tml_dump(\"burst_size\", \"%u\", opt->burst_size);\n \n \tml_dump_begin(\"filelist\");\n \tfor (i = 0; i < opt->nb_filelist; i++) {\n@@ -213,6 +350,7 @@ test_inference_setup(struct ml_test *test, struct ml_options *opt)\n {\n \tstruct test_inference *t;\n \tvoid *test_inference;\n+\tuint32_t lcore_id;\n \tint ret = 0;\n \tuint32_t i;\n \n@@ -237,13 +375,30 @@ test_inference_setup(struct ml_test *test, struct ml_options *opt)\n \t\tgoto error;\n \t}\n \n-\tt->enqueue = ml_enqueue_single;\n-\tt->dequeue = ml_dequeue_single;\n+\tif (opt->burst_size == 1) {\n+\t\tt->enqueue = ml_enqueue_single;\n+\t\tt->dequeue = ml_dequeue_single;\n+\t} else {\n+\t\tt->enqueue = ml_enqueue_burst;\n+\t\tt->dequeue = ml_dequeue_burst;\n+\t}\n \n \t/* set model initial state */\n \tfor (i = 0; i < opt->nb_filelist; i++)\n \t\tt->model[i].state = MODEL_INITIAL;\n \n+\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n+\t\tt->args[lcore_id].enq_ops = rte_zmalloc_socket(\n+\t\t\t\"ml_test_enq_ops\", opt->burst_size * sizeof(struct rte_ml_op *),\n+\t\t\tRTE_CACHE_LINE_SIZE, opt->socket_id);\n+\t\tt->args[lcore_id].deq_ops = rte_zmalloc_socket(\n+\t\t\t\"ml_test_deq_ops\", opt->burst_size * sizeof(struct rte_ml_op *),\n+\t\t\tRTE_CACHE_LINE_SIZE, opt->socket_id);\n+\t\tt->args[lcore_id].reqs = rte_zmalloc_socket(\n+\t\t\t\"ml_test_requests\", opt->burst_size * sizeof(struct ml_request *),\n+\t\t\tRTE_CACHE_LINE_SIZE, opt->socket_id);\n+\t}\n+\n \treturn 0;\n \n error:\ndiff --git a/app/test-mldev/test_inference_common.h b/app/test-mldev/test_inference_common.h\nindex 99baad5bfd..7bbd68aefa 100644\n--- a/app/test-mldev/test_inference_common.h\n+++ b/app/test-mldev/test_inference_common.h\n@@ -27,6 +27,10 @@ struct ml_core_args {\n \tuint64_t nb_reqs;\n \tuint16_t start_fid;\n \tuint16_t end_fid;\n+\n+\tstruct rte_ml_op **enq_ops;\n+\tstruct rte_ml_op **deq_ops;\n+\tstruct ml_request **reqs;\n };\n \n struct test_inference {\n",
    "prefixes": [
        "v4",
        "07/12"
    ]
}