get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131223,
    "url": "http://patchwork.dpdk.org/api/patches/131223/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230907081040.1002478-3-amitprakashs@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230907081040.1002478-3-amitprakashs@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230907081040.1002478-3-amitprakashs@marvell.com",
    "date": "2023-09-07T08:10:40",
    "name": "[v1,2/2] test/dma: add source buffer offload free test",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3796a9b122e79e23d62311e4ea095fde2ee9c014",
    "submitter": {
        "id": 2699,
        "url": "http://patchwork.dpdk.org/api/people/2699/?format=api",
        "name": "Amit Prakash Shukla",
        "email": "amitprakashs@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230907081040.1002478-3-amitprakashs@marvell.com/mbox/",
    "series": [
        {
            "id": 29442,
            "url": "http://patchwork.dpdk.org/api/series/29442/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29442",
            "date": "2023-09-07T08:10:38",
            "name": "offload support to free dma source buffer",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/29442/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/131223/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/131223/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 7FA6442534;\n\tThu,  7 Sep 2023 10:11:24 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 79072402E0;\n\tThu,  7 Sep 2023 10:11:24 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 163E14026C\n for <dev@dpdk.org>; Thu,  7 Sep 2023 10:11:22 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 3876eau0002036; Thu, 7 Sep 2023 01:11:22 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sv4jkjctc-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 07 Sep 2023 01:11:22 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Thu, 7 Sep 2023 01:11:20 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Thu, 7 Sep 2023 01:11:20 -0700",
            "from localhost.localdomain (unknown [10.28.36.157])\n by maili.marvell.com (Postfix) with ESMTP id 8300D5B6967;\n Thu,  7 Sep 2023 01:11:15 -0700 (PDT)"
        ],
        "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-transfer-encoding : content-type; s=pfpt0220;\n bh=IgxIG5OEt97RoycqmUyME5r0ETxcf3UcZt3QFNt8oVw=;\n b=GaK5jbIM4ilfLGk11Bw1txwheHHTEXEMfYpU8wePYr73RwDyZWK8e30pdEZSUgbLkJvN\n QMiFIO65PvAanGQnTX+jlKD6dtmnet2ovGheaLklBM/gE5O24i4Hp6xHkXhBSu1XOo8J\n MStlRZXQhUPoxqMbITWsdB1TZnV48lKLfPMmm3oEXmYQlqGiu6beT+sXcFT3687yR8zr\n wFX7hqPN9wreugcbhY7jNi36xnrdrhflFMiRDdNkBp5DVL5vVVszOhFCUZKrarffuPA8\n LnICOKX66B/jgMm9bJAYDUtTksjreSoCPyEi0LD8f5RWz1joTvQvbCbfuq+nVjH7tXPo Lg==",
        "From": "Amit Prakash Shukla <amitprakashs@marvell.com>",
        "To": "Chengwen Feng <fengchengwen@huawei.com>, Kevin Laatz\n <kevin.laatz@intel.com>, Bruce Richardson <bruce.richardson@intel.com>",
        "CC": "<dev@dpdk.org>, <jerinj@marvell.com>, <conor.walsh@intel.com>,\n <vattunuru@marvell.com>, <g.singh@nxp.com>,\n <sachin.saxena@oss.nxp.com>, <hemant.agrawal@nxp.com>,\n <cheng1.jiang@intel.com>, <ndabilpuram@marvell.com>,\n <anoobj@marvell.com>, Amit Prakash Shukla <amitprakashs@marvell.com>",
        "Subject": "[PATCH v1 2/2] test/dma: add source buffer offload free test",
        "Date": "Thu, 7 Sep 2023 13:40:40 +0530",
        "Message-ID": "<20230907081040.1002478-3-amitprakashs@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230907081040.1002478-1-amitprakashs@marvell.com>",
        "References": "<20230907081040.1002478-1-amitprakashs@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "vpy1NAZXG5r8DQyF6wnrJGCw6ui6IKC6",
        "X-Proofpoint-ORIG-GUID": "vpy1NAZXG5r8DQyF6wnrJGCw6ui6IKC6",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26\n definitions=2023-09-06_12,2023-09-05_01,2023-05-22_02",
        "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": "Add a test case to validate the functionality of drivers' dma\nsource buffer offload free. As part of dmadev_autotest, test case\nwill be executed only if the driver supports source buffer offload\nfree and if the test is exported by env variable DPDK_ADD_DMA_TEST.\n\nSigned-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>\n---\n app/test/test_dmadev.c | 132 ++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 131 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c\nindex 6ef875e545..48da4664ae 100644\n--- a/app/test/test_dmadev.c\n+++ b/app/test/test_dmadev.c\n@@ -18,11 +18,26 @@\n \n #define ERR_RETURN(...) do { print_err(__func__, __LINE__, __VA_ARGS__); return -1; } while (0)\n \n+#define TEST_RINGSIZE 512\n #define COPY_LEN 1024\n \n static struct rte_mempool *pool;\n static uint16_t id_count;\n \n+enum {\n+\tTEST_SRC_BUF_FREE = 0,\n+\tTEST_MAX,\n+};\n+\n+struct dma_add_test {\n+\tconst char *name;\n+\tbool enabled;\n+};\n+\n+struct dma_add_test dma_add_test[] = {\n+\t[TEST_SRC_BUF_FREE] = {.name = \"sbuf_free\", .enabled = false},\n+};\n+\n static void\n __rte_format_printf(3, 4)\n print_err(const char *func, int lineno, const char *format, ...)\n@@ -797,10 +812,93 @@ test_burst_capacity(int16_t dev_id, uint16_t vchan)\n \treturn 0;\n }\n \n+static int\n+test_sbuf_free(int16_t dev_id, uint16_t vchan)\n+{\n+#define NR_MBUF 256\n+\tint i, ret = 0;\n+\tint retry = 100;\n+\tuint16_t nb_done = 0;\n+\tbool dma_err = false;\n+\tuint32_t buf_cnt1, buf_cnt2;\n+\tstruct rte_mempool_ops *ops;\n+\tuint64_t remote_addr = 0x40000000ull;\n+\tstruct rte_mbuf *src[NR_MBUF], *dst[NR_MBUF];\n+\tconst struct rte_dma_vchan_conf qconf = {\n+\t\t.direction = RTE_DMA_DIR_MEM_TO_DEV,\n+\t\t.nb_desc = TEST_RINGSIZE,\n+\t\t.mem_to_dev_src_buf_pool = pool,\n+\t\t.dst_port.port_type = RTE_DMA_PORT_PCIE,\n+\t\t/* Assuming pemid as 0. */\n+\t\t.dst_port.pcie.coreid = 0,\n+\t};\n+\tstatic int dev_init;\n+\n+\tif (!dev_init) {\n+\t\t/* Stop the device to reconfigure vchan. */\n+\t\tif (rte_dma_stop(dev_id) < 0)\n+\t\t\tERR_RETURN(\"Error stopping device %u\\n\", dev_id);\n+\n+\t\tif (rte_dma_vchan_setup(dev_id, vchan, &qconf) < 0)\n+\t\t\tERR_RETURN(\"Error with queue configuration\\n\");\n+\n+\t\tif (rte_dma_start(dev_id) != 0)\n+\t\t\tERR_RETURN(\"Error with rte_dma_start()\\n\");\n+\n+\t\tdev_init++;\n+\t}\n+\n+\tif (rte_pktmbuf_alloc_bulk(pool, dst, NR_MBUF) != 0)\n+\t\tERR_RETURN(\"alloc dst mbufs failed.\\n\");\n+\n+\tfor (i = 0; i < NR_MBUF; i++) {\n+\t\t/* Using mbuf structure to hold remote iova address. */\n+\t\trte_mbuf_iova_set(dst[i], (rte_iova_t)remote_addr);\n+\t\tdst[i]->data_off = 0;\n+\t}\n+\n+\t/* Capture buffer count before allocating source buffer. */\n+\tops = rte_mempool_get_ops(pool->ops_index);\n+\tbuf_cnt1 = ops->get_count(pool);\n+\n+\tif (rte_pktmbuf_alloc_bulk(pool, src, NR_MBUF) != 0)\n+\t\tERR_RETURN(\"alloc src mbufs failed.\\n\");\n+\n+\tif ((buf_cnt1 - NR_MBUF) != ops->get_count(pool))\n+\t\tERR_RETURN(\"Buffer count check failed.\\n\");\n+\n+\tfor (i = 0; i < NR_MBUF; i++) {\n+\t\tret = rte_dma_copy(dev_id, vchan, rte_mbuf_data_iova(src[i]),\n+\t\t\t\trte_mbuf_data_iova(dst[i]), COPY_LEN,\n+\t\t\t\tRTE_DMA_OP_FLAG_FREE_SBUF);\n+\n+\t\tif (ret < 0)\n+\t\t\tERR_RETURN(\"rte_dma_copy returned error.\\n\");\n+\t}\n+\n+\trte_dma_submit(dev_id, vchan);\n+\tnb_done = 0;\n+\tdo {\n+\t\tnb_done += rte_dma_completed(dev_id, vchan, (NR_MBUF - nb_done), NULL, &dma_err);\n+\t\tif (dma_err)\n+\t\t\tbreak;\n+\t\t/* Sleep for 1 millisecond */\n+\t\trte_delay_us_sleep(1000);\n+\t} while (retry-- && (nb_done < NR_MBUF));\n+\n+\tbuf_cnt2 = ops->get_count(pool);\n+\tif ((buf_cnt1 != buf_cnt2) || dma_err)\n+\t\tERR_RETURN(\"Free source buffer test failed.\\n\");\n+\n+\t/* If the test passes source buffer will be freed in hardware. */\n+\trte_pktmbuf_free_bulk(dst, NR_MBUF);\n+\n+\treturn 0;\n+}\n+\n static int\n test_dmadev_instance(int16_t dev_id)\n {\n-#define TEST_RINGSIZE 512\n #define CHECK_ERRS    true\n \tstruct rte_dma_stats stats;\n \tstruct rte_dma_info info;\n@@ -890,6 +988,12 @@ test_dmadev_instance(int16_t dev_id)\n \telse if (runtest(\"fill\", test_enqueue_fill, 1, dev_id, vchan, CHECK_ERRS) < 0)\n \t\tgoto err;\n \n+\tif ((info.dev_capa & RTE_DMA_CAPA_MEM_TO_DEV_SOURCE_BUFFER_FREE) &&\n+\t    dma_add_test[TEST_SRC_BUF_FREE].enabled == true) {\n+\t\tif (runtest(\"sbuf_free\", test_sbuf_free, 128, dev_id, vchan, CHECK_ERRS) < 0)\n+\t\t\tgoto err;\n+\t}\n+\n \trte_mempool_free(pool);\n \n \tif (rte_dma_stop(dev_id) < 0)\n@@ -922,11 +1026,37 @@ test_apis(void)\n \treturn ret;\n }\n \n+static void\n+parse_dma_env_var(void)\n+{\n+\tchar *dma_env_str = getenv(\"DPDK_ADD_DMA_TEST\");\n+\tchar *tests[32] = {0};\n+\tint n_tests = 0;\n+\tint i, j;\n+\n+\tif (dma_env_str && strlen(dma_env_str) > 0) {\n+\t\tchar *additional_test = strdup(dma_env_str);\n+\t\tif (additional_test) {\n+\t\t\tn_tests = rte_strsplit(additional_test, strlen(additional_test), tests,\n+\t\t\t\t       RTE_DIM(tests), ',');\n+\t\t\tfor (i = 0; i < n_tests; i++) {\n+\t\t\t\tfor (j = 0; j < TEST_MAX; j++) {\n+\t\t\t\t\tif (!strcmp(tests[i], dma_add_test[j].name))\n+\t\t\t\t\t\tdma_add_test[j].enabled = true;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t\tfree(additional_test);\n+\t}\n+}\n+\n static int\n test_dma(void)\n {\n \tint i;\n \n+\tparse_dma_env_var();\n+\n \t/* basic sanity on dmadev infrastructure */\n \tif (test_apis() < 0)\n \t\tERR_RETURN(\"Error performing API tests\\n\");\n",
    "prefixes": [
        "v1",
        "2/2"
    ]
}