get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 48117,
    "url": "http://patchwork.dpdk.org/api/patches/48117/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/532f05a13228ffd85931807dd4aa2384a27b7da4.1542283782.git.anatoly.burakov@intel.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": "<532f05a13228ffd85931807dd4aa2384a27b7da4.1542283782.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/532f05a13228ffd85931807dd4aa2384a27b7da4.1542283782.git.anatoly.burakov@intel.com",
    "date": "2018-11-15T12:18:05",
    "name": "test: fix eal flags autotest hugepage file handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d1711bc524351fbd0a299c3512ffd47ef8167902",
    "submitter": {
        "id": 4,
        "url": "http://patchwork.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.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/532f05a13228ffd85931807dd4aa2384a27b7da4.1542283782.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 2438,
            "url": "http://patchwork.dpdk.org/api/series/2438/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=2438",
            "date": "2018-11-15T12:18:05",
            "name": "test: fix eal flags autotest hugepage file handling",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/2438/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/48117/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/48117/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 DE73B4CC3;\n\tThu, 15 Nov 2018 13:18:10 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 0F3B94CBD\n\tfor <dev@dpdk.org>; Thu, 15 Nov 2018 13:18:08 +0100 (CET)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t15 Nov 2018 04:18:07 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga005.fm.intel.com with ESMTP; 15 Nov 2018 04:18:06 -0800",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\twAFCI6KG003103; Thu, 15 Nov 2018 12:18:06 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id wAFCI5sT021624;\n\tThu, 15 Nov 2018 12:18:05 GMT",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id wAFCI5nT021620;\n\tThu, 15 Nov 2018 12:18:05 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,236,1539673200\"; d=\"scan'208\";a=\"280054618\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "shuaix.zhu@intel.com",
        "Date": "Thu, 15 Nov 2018 12:18:05 +0000",
        "Message-Id": "<532f05a13228ffd85931807dd4aa2384a27b7da4.1542283782.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH] test: fix eal flags autotest hugepage file\n\thandling",
        "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": "Before 18.05, DPDK could not release memory back to the system\nneither at runtime nor before shutting down. Over the course of\n18.05 up to 18.11, code was introduced to release memory at\nruntime, as well as an rte_eal_cleanup() function that is supposed\nto release all EAL-allocated memory before shutting down DPDK.\n\nWhen 3f9e31d71d63 (\"test: clean up on exit\") was introduced, the\ntest application started to use rte_eal_cleanup() to release all\nused memory after execution. However, the EAL flags autotest\nstill relies on the old behavior of leaving stuff behind in the\nhugetlbfs.\n\nThe fix is twofold. First, the test to check for leftover files\nin hugetlbfs is no longer valid as it is, because test application\nnow removes all files from hugetlbfs after exit. However, if we\nuse the --legacy-mem option, then old behavior of leaving files\nin hugetlbfs after execution is restored. So the first fix is to\nadd --legacy-mem to all the tests that expect files in hugetlbfs\nto be leftover.\n\nHowever, we also need to test if default memory mode *doesn't*\nleave any files behind, so we also extend the test to check for\nthese scenarios as well. So, both memtest1 and memtest2 are run\nin legacy and default mem modes, and are checked for any leftover\nfiles that are or are not supposed to be there.\n\nFixes: 3f9e31d71d63 (\"test: clean up on exit\")\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n    Checkpatch will complain about string lists not being declared\n    as static const char * const array - we can't do that here,\n    because ``prgname`` is not a compile-time constant.\n\n test/test/test_eal_flags.c | 94 +++++++++++++++++++++++++++++++-------\n 1 file changed, 78 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c\nindex 3a990766d..2acab9d69 100644\n--- a/test/test/test_eal_flags.c\n+++ b/test/test/test_eal_flags.c\n@@ -951,10 +951,15 @@ test_file_prefix(void)\n \t * 2. try to run secondary process without a corresponding primary process\n \t * (while failing to run, it will also remove any unused hugepage files)\n \t * 3. check if current process hugefiles are still in place and are locked\n-\t * 4. run a primary process with memtest1 prefix\n-\t * 5. check if memtest1 hugefiles are created\n-\t * 6. run a primary process with memtest2 prefix\n-\t * 7. check that only memtest2 hugefiles are present in the hugedir\n+\t * 4. run a primary process with memtest1 prefix in default and legacy\n+\t *    mem mode\n+\t * 5. check if memtest1 hugefiles are created in case of legacy mem\n+\t *    mode, and deleted in case of default mem mode\n+\t * 6. run a primary process with memtest2 prefix in default and legacy\n+\t *    mem modes\n+\t * 7. check that memtest2 hugefiles are present in the hugedir after a\n+\t *    run in legacy mode, and not present at all after run in default\n+\t *    mem mode\n \t */\n \tchar prefix[PATH_MAX] = \"\";\n \n@@ -971,13 +976,23 @@ test_file_prefix(void)\n \tconst char *argv0[] = {prgname, mp_flag, \"-c\", \"1\", \"-n\", \"2\", \"-m\", DEFAULT_MEM_SIZE,\n \t\t\t\"--file-prefix=\" memtest };\n \n-\t/* primary process with memtest1 */\n-\tconst char *argv1[] = {prgname, \"-c\", \"1\", \"-n\", \"2\", \"-m\", DEFAULT_MEM_SIZE,\n-\t\t\t\t\"--file-prefix=\" memtest1 };\n+\t/* primary process with memtest1 and default mem mode */\n+\tconst char *argv1[] = {prgname, \"-c\", \"1\", \"-n\", \"2\", \"-m\",\n+\t\t\tDEFAULT_MEM_SIZE, \"--file-prefix=\" memtest1 };\n \n-\t/* primary process with memtest2 */\n-\tconst char *argv2[] = {prgname, \"-c\", \"1\", \"-n\", \"2\", \"-m\", DEFAULT_MEM_SIZE,\n-\t\t\t\t\"--file-prefix=\" memtest2 };\n+\t/* primary process with memtest1 and legacy mem mode */\n+\tconst char *argv2[] = {prgname, \"-c\", \"1\", \"-n\", \"2\", \"-m\",\n+\t\t\tDEFAULT_MEM_SIZE, \"--file-prefix=\" memtest1,\n+\t\t\t\"--legacy-mem\" };\n+\n+\t/* primary process with memtest2 and legacy mem mode */\n+\tconst char *argv3[] = {prgname, \"-c\", \"1\", \"-n\", \"2\", \"-m\",\n+\t\t\tDEFAULT_MEM_SIZE, \"--file-prefix=\" memtest2,\n+\t\t\t\"--legacy-mem\" };\n+\n+\t/* primary process with memtest2 and default mem mode */\n+\tconst char *argv4[] = {prgname, \"-c\", \"1\", \"-n\", \"2\", \"-m\",\n+\t\t\tDEFAULT_MEM_SIZE, \"--file-prefix=\" memtest2 };\n \n \t/* check if files for current prefix are present */\n \tif (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {\n@@ -1024,31 +1039,78 @@ test_file_prefix(void)\n \t\treturn -1;\n \t}\n \n+\t/* we're running this process in default memory mode, which means it\n+\t * should clean up after itself on exit and leave no hugepages behind.\n+\t */\n \tif (launch_proc(argv1) != 0) {\n-\t\tprintf(\"Error - failed to run with --file-prefix=%s\\n\", memtest);\n+\t\tprintf(\"Error - failed to run with --file-prefix=%s\\n\",\n+\t\t\t\tmemtest1);\n+\t\treturn -1;\n+\t}\n+\n+\t/* check if memtest1_map0 is present */\n+\tif (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {\n+\t\tprintf(\"Error - hugepage files for %s were not deleted!\\n\",\n+\t\t\t\tmemtest1);\n+\t\treturn -1;\n+\t}\n+\n+\t/* now, we're running a process under the same prefix, but with legacy\n+\t * mem mode - this should leave behind hugepage files.\n+\t */\n+\tif (launch_proc(argv2) != 0) {\n+\t\tprintf(\"Error - failed to run with --file-prefix=%s\\n\",\n+\t\t\t\tmemtest1);\n \t\treturn -1;\n \t}\n \n \t/* check if memtest1_map0 is present */\n \tif (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 1) {\n-\t\tprintf(\"Error - hugepage files for %s were not created!\\n\", memtest1);\n+\t\tprintf(\"Error - hugepage files for %s were not created!\\n\",\n+\t\t\t\tmemtest1);\n \t\treturn -1;\n \t}\n \n-\tif (launch_proc(argv2) != 0) {\n-\t\tprintf(\"Error - failed to run with --file-prefix=%s\\n\", memtest2);\n+\tif (launch_proc(argv3) != 0) {\n+\t\tprintf(\"Error - failed to run with --file-prefix=%s\\n\",\n+\t\t\t\tmemtest2);\n \t\treturn -1;\n \t}\n \n \t/* check if hugefiles for memtest2 are present */\n \tif (process_hugefiles(memtest2, HUGEPAGE_CHECK_EXISTS) != 1) {\n-\t\tprintf(\"Error - hugepage files for %s were not created!\\n\", memtest2);\n+\t\tprintf(\"Error - hugepage files for %s were not created!\\n\",\n+\t\t\t\tmemtest2);\n \t\treturn -1;\n \t}\n \n \t/* check if hugefiles for memtest1 are present */\n \tif (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {\n-\t\tprintf(\"Error - hugepage files for %s were not deleted!\\n\", memtest1);\n+\t\tprintf(\"Error - hugepage files for %s were not deleted!\\n\",\n+\t\t\t\tmemtest1);\n+\t\treturn -1;\n+\t}\n+\n+\t/* this process will run in default mem mode, so it should not leave any\n+\t * hugepage files behind.\n+\t */\n+\tif (launch_proc(argv4) != 0) {\n+\t\tprintf(\"Error - failed to run with --file-prefix=%s\\n\",\n+\t\t\t\tmemtest2);\n+\t\treturn -1;\n+\t}\n+\n+\t/* check if hugefiles for memtest2 are present */\n+\tif (process_hugefiles(memtest2, HUGEPAGE_CHECK_EXISTS) != 0) {\n+\t\tprintf(\"Error - hugepage files for %s were not deleted!\\n\",\n+\t\t\t\tmemtest2);\n+\t\treturn -1;\n+\t}\n+\n+\t/* check if hugefiles for memtest1 are present */\n+\tif (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {\n+\t\tprintf(\"Error - hugepage files for %s were not deleted!\\n\",\n+\t\t\t\tmemtest1);\n \t\treturn -1;\n \t}\n \n",
    "prefixes": []
}