get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 66124,
    "url": "http://patches.dpdk.org/api/patches/66124/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200228060727.192491-4-dmitry.kozliuk@gmail.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20200228060727.192491-4-dmitry.kozliuk@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200228060727.192491-4-dmitry.kozliuk@gmail.com",
    "date": "2020-02-28T06:07:25",
    "name": "[RFC,3/5] pci/windows: split config I/O into series of fixed-size operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "0cded86a2114e7f4423343fa3e0ba5dc2a6e50fd",
    "submitter": {
        "id": 1581,
        "url": "http://patches.dpdk.org/api/people/1581/?format=api",
        "name": "Dmitry Kozlyuk",
        "email": "dmitry.kozliuk@gmail.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200228060727.192491-4-dmitry.kozliuk@gmail.com/mbox/",
    "series": [
        {
            "id": 8720,
            "url": "http://patches.dpdk.org/api/series/8720/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8720",
            "date": "2020-02-28T06:07:22",
            "name": "virtio-net support for Windows draft",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8720/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/66124/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/66124/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 C3161A0561;\n\tFri, 28 Feb 2020 07:08:10 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 593A11BFFC;\n\tFri, 28 Feb 2020 07:07:52 +0100 (CET)",
            "from mail-lj1-f196.google.com (mail-lj1-f196.google.com\n [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 66A821BFEB\n for <dev@dpdk.org>; Fri, 28 Feb 2020 07:07:42 +0100 (CET)",
            "by mail-lj1-f196.google.com with SMTP id x7so2036699ljc.1\n for <dev@dpdk.org>; Thu, 27 Feb 2020 22:07:42 -0800 (PST)",
            "from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru.\n [37.110.65.23])\n by smtp.googlemail.com with ESMTPSA id\n r12sm4819281ljh.105.2020.02.27.22.07.40\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 27 Feb 2020 22:07:40 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=zui5bJjLh1Z1om8Qf1nWSVGOTNxMAqiih05iTDxadGw=;\n b=oaUisbZe+IhdNsy0hhRzTPKbM/FBAQ6trzjP/sqx7oKSneJRS8LZZT01IJntqVIgVq\n VAKaARD1tK64eNDOODNPKeqCQPXNdbERg1oqG7p6BodCmBr7F5/47v5nRAZm9G9PSe/G\n 9Kgf/E4sjvDUV2HVBOHfrdgspGxUnnhLNS3JOWEjMJBAprnRhlfNdYQePMaYCtl5gZap\n m2eITmgiGMDmu40ny43dksJquLBPYLVBOoZdWKkvcZQ9FtDB8yGGhDgMFpHW4VqYKrJn\n MnF8osj8wXiDDXoqRrSq8F/URq038LtN8S2MFI7UnFmJTvgmXIt3kyxYJOK3KxCWOrJG\n uIiw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=zui5bJjLh1Z1om8Qf1nWSVGOTNxMAqiih05iTDxadGw=;\n b=CLqKj1clSzCoh0wzmw7NR7BsI9WZFv2KazNYovD9WrBalniSfBMjy9AKLJGeGZrHf9\n sNIONe7xbZUQ0dD7CoIsuKy/EZ6ciVWFLKZyy5ls1ShhMmBPK9tZlZ68KjwVq42k2fpg\n BUvcAMfxDEGhcRse63laGlBtezpUJL1YMs0V6X1jfKmg8iBlW7lkHbwtfrOcXaQt9ML8\n gN5VkABI5GCBkjkR3SSiptSyU9p/rucczjOG5qFboEesdUpPnKcl7j6X0EyEcx9jLPlG\n S3kiun8iz2/UIwFGvteOGBItg1c+sOOxfsP/jg82Z65zYJNsJH5ILBFNMIbT4uixENO/\n VuBA==",
        "X-Gm-Message-State": "ANhLgQ3xfQ5KXUe0+oFJ/SLSLmSAPM7XYzTj+ZpmjIevCesHMIlDY9BB\n d3XGlJ6aESeFlgo9XRNfcZx6A6FF",
        "X-Google-Smtp-Source": "\n ADFU+vu8CMvcuCwyZvWYqkhv0GxNf2gukZCIPgdXQ4jg4Y5ICUENRPc6Y+V/MkeVF0yPSOpEoK8YwA==",
        "X-Received": "by 2002:a2e:96c6:: with SMTP id d6mr1823802ljj.4.1582870061680;\n Thu, 27 Feb 2020 22:07:41 -0800 (PST)",
        "From": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>",
        "Date": "Fri, 28 Feb 2020 09:07:25 +0300",
        "Message-Id": "<20200228060727.192491-4-dmitry.kozliuk@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200228060727.192491-1-dmitry.kozliuk@gmail.com>",
        "References": "<20200227071126.75162e92@Sovereign>\n <20200228060727.192491-1-dmitry.kozliuk@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [RFC PATCH 3/5] pci/windows: split config I/O into\n\tseries of fixed-size operations",
        "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": "PCI bus kernel driver mandates accessing config space in a series of\nreads/writes by 4, 2, or 1 bytes. NETUIO driver checks this requirement\nbefore performing config space I/O. Users of DPDK PCI bus driver,\nhowever, access config space without regard for this requirement.\n\nMake DPDK PCI bus driver split config I/O to a series of 4-, 2-,\nor 1-byte reads/writes. Each of these operations is a syscall to netUIO.\n\nSigned-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>\n---\n drivers/bus/pci/windows/pci.c | 45 ++++++++++++++++++++++++-----------\n 1 file changed, 31 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c\nindex 387ed4f02..4ffa6a610 100644\n--- a/drivers/bus/pci/windows/pci.c\n+++ b/drivers/bus/pci/windows/pci.c\n@@ -200,6 +200,32 @@ int send_ioctl(HANDLE f, DWORD ioctl,\n \treturn ERROR_SUCCESS;\n }\n \n+static int\n+pci_config_io_sized(HANDLE device, struct dpdk_pci_config_io *io,\n+\tvoid **buf, size_t *left_size, size_t access_size)\n+{\n+\tuint64_t out;\n+\n+\tio->access_size = access_size;\n+\n+\twhile (*left_size >= access_size) {\n+\t\tif (io->op == PCI_IO_WRITE)\n+\t\t\tmemcpy(&io->data, *buf, access_size);\n+\n+\t\tif (send_ioctl(device, IOCTL_NETUIO_PCI_CONFIG_IO,\n+\t\t\t\tio, sizeof(*io), &out, sizeof(out)) != ERROR_SUCCESS)\n+\t\t\treturn -1;\n+\n+\t\tif (io->op == PCI_IO_READ)\n+\t\t\tmemcpy(*buf, &out, access_size);\n+\n+\t\tio->offset += access_size;\n+\t\t*buf += access_size;\n+\t\t*left_size -= access_size;\n+\t}\n+\treturn 0;\n+}\n+\n /* Send IOCTL to driver to read/write PCI configuration space */\n static\n int pci_config_io(const struct rte_pci_device *dev, void *buf,\n@@ -227,23 +253,14 @@ int pci_config_io(const struct rte_pci_device *dev, void *buf,\n \tpci_io.dev_addr.dev_num = dev->addr.devid;\n \tpci_io.dev_addr.func_num = dev->addr.function;\n \tpci_io.offset = offset;\n-\tpci_io.access_size = sizeof(UINT32);\n \tpci_io.op = operation;\n \n-\tif (operation == PCI_IO_WRITE)\n-\t{\n-\t\tpci_io.data.u32 = *(UINT32 UNALIGNED*)buf;\n-\t}\n-\n-\tuint64_t  outputbuf = 0;\n-\tif (send_ioctl(f, IOCTL_NETUIO_PCI_CONFIG_IO, &pci_io, sizeof(pci_io),\n-\t\t\t\t&outputbuf, sizeof(outputbuf)) != ERROR_SUCCESS)\n+\tif (pci_config_io_sized(f, &pci_io, &buf, &len, sizeof(uint32_t)) < 0)\n+\t\tgoto error;\n+\tif (pci_config_io_sized(f, &pci_io, &buf, &len, sizeof(uint16_t)) < 0)\n+\t\tgoto error;\n+\tif (pci_config_io_sized(f, &pci_io, &buf, &len, sizeof(uint8_t)) < 0)\n \t\tgoto error;\n-\n-\tif (operation == PCI_IO_READ)\n-\t{\n-\t\tmemcpy(buf, &outputbuf, sizeof(UINT32));\n-\t}\n \n \tret = 0;\n error:\n",
    "prefixes": [
        "RFC",
        "3/5"
    ]
}