get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 72975,
    "url": "http://patchwork.dpdk.org/api/patches/72975/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200703102332.1101232-5-bruce.richardson@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": "<20200703102332.1101232-5-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200703102332.1101232-5-bruce.richardson@intel.com",
    "date": "2020-07-03T10:23:32",
    "name": "[v3,4/4] eal: cache last directory permissions checked",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6c63e150d50534bf02ee1b2f0c0101ed0d9a7482",
    "submitter": {
        "id": 20,
        "url": "http://patchwork.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200703102332.1101232-5-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 10766,
            "url": "http://patchwork.dpdk.org/api/series/10766/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=10766",
            "date": "2020-07-03T10:23:28",
            "name": "improve runtime loading of shared drivers",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/10766/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/72975/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/72975/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E6C74A0519;\n\tFri,  3 Jul 2020 12:24:07 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E0EC51DB45;\n\tFri,  3 Jul 2020 12:23:55 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by dpdk.org (Postfix) with ESMTP id 9FEB51DB45\n for <dev@dpdk.org>; Fri,  3 Jul 2020 12:23:54 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 03 Jul 2020 03:23:54 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.222.84])\n by fmsmga006.fm.intel.com with ESMTP; 03 Jul 2020 03:23:52 -0700"
        ],
        "IronPort-SDR": [
            "\n G8ymC//d9P2PQ+eDyGWsvpyhyK4j235tu+wu78rRlLYsKrPBixNHIgOA89B7QtAMgwaUYORzir\n TWt1wS4Mo5HQ==",
            "\n iinpLMZf6WRgTxeZbqR7iJsuyTroFLn0Ll9qXqzxgNMtixnXU9Y02Beo4J/5yEhJ2BF5mARJ+b\n iHmxEgUT6wBw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9670\"; a=\"147142724\"",
            "E=Sophos;i=\"5.75,307,1589266800\"; d=\"scan'208\";a=\"147142724\"",
            "E=Sophos;i=\"5.75,307,1589266800\"; d=\"scan'208\";a=\"481984342\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "thomas@monjalon.net",
        "Cc": "dev@dpdk.org,\n\tBruce Richardson <bruce.richardson@intel.com>",
        "Date": "Fri,  3 Jul 2020 11:23:32 +0100",
        "Message-Id": "<20200703102332.1101232-5-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200703102332.1101232-1-bruce.richardson@intel.com>",
        "References": "<20200618135049.489773-1-bruce.richardson@intel.com>\n <20200703102332.1101232-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 4/4] eal: cache last directory permissions\n\tchecked",
        "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 <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": "When loading a directory of drivers, we check the same hierarchy multiple\ntimes. If we just cache the last directory checked, this avoids repeated\nchecks of the same path, since all drivers in that path have been added to\nthe list consecutively.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_eal/common/eal_common_options.c | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 6c63b9364..85d5ba723 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -414,11 +414,17 @@ verify_perms(const char *dirpath)\n \n \t/* if not root, check down one level first */\n \tif (strcmp(dirpath, \"/\") != 0) {\n+\t\tstatic __thread char last_dir_checked[PATH_MAX];\n \t\tchar copy[PATH_MAX];\n+\t\tconst char *dir;\n \n \t\tstrlcpy(copy, dirpath, PATH_MAX);\n-\t\tif (verify_perms(dirname(copy)) != 0)\n-\t\t\treturn -1;\n+\t\tdir = dirname(copy);\n+\t\tif (strncmp(dir, last_dir_checked, PATH_MAX) != 0) {\n+\t\t\tif (verify_perms(dir) != 0)\n+\t\t\t\treturn -1;\n+\t\t\tstrlcpy(last_dir_checked, dir, PATH_MAX);\n+\t\t}\n \t}\n \n \t/* call stat to check for permissions and ensure not world writable */\n",
    "prefixes": [
        "v3",
        "4/4"
    ]
}