get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17167,
    "url": "http://patches.dpdk.org/api/patches/17167/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1479747322-5774-6-git-send-email-jblunck@infradead.org/",
    "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": "<1479747322-5774-6-git-send-email-jblunck@infradead.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1479747322-5774-6-git-send-email-jblunck@infradead.org",
    "date": "2016-11-21T16:55:20",
    "name": "[dpdk-dev,v2,6/8] virtio: Don't depend on struct rte_eth_dev's pci_dev",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8f0bfade193712013a516a0168dc7e37e0551805",
    "submitter": {
        "id": 249,
        "url": "http://patches.dpdk.org/api/people/249/?format=api",
        "name": "Jan Blunck",
        "email": "jblunck@infradead.org"
    },
    "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/1479747322-5774-6-git-send-email-jblunck@infradead.org/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/17167/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/17167/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B5F8C6CB8;\n\tMon, 21 Nov 2016 17:57:23 +0100 (CET)",
            "from mail-wm0-f68.google.com (mail-wm0-f68.google.com\n\t[74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 22C3E5687\n\tfor <dev@dpdk.org>; Mon, 21 Nov 2016 17:57:11 +0100 (CET)",
            "by mail-wm0-f68.google.com with SMTP id u144so544542wmu.0\n\tfor <dev@dpdk.org>; Mon, 21 Nov 2016 08:57:11 -0800 (PST)",
            "from weierstrass.local.net ([91.200.110.70])\n\tby smtp.gmail.com with ESMTPSA id\n\tv202sm20536051wmv.8.2016.11.21.08.57.09\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 21 Nov 2016 08:57:10 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=27C1aYr9nIq0w2zRR3dHopzvOKOmG1t7h6Zy0kvJ+eM=;\n\tb=TrDrtJEFPZksarH0jxt5bzRccmFHM/kTpiCdgUu9Cs/LoRqmYo7BdNmJU7QGvb59YT\n\tkZkwXTXvMunlhDgA6XYblLZgh9QdvY5BJ/7VhKaS6AfCWIJ+RXIBTlbKhCw7+c0cA4Sc\n\tPslLSL8U/IsBF11ydU22rDD4SsvykbIDwR11Pt2INLTUZ5hXDH8+++hLdqkAWlRvZwza\n\tuCmbWexQ5SONiTI9g/fkj1tUjpOYCL4Kt91cfPx8QPwgsq/EFTcB+fBUjwIpHgOoBqAZ\n\tjuA4M/TOoVrq6Va5Ld5A3XizlPP5oxY512/jfd6kx4Tqsd40a2JaUZ7UeGrF4KhMpDr/\n\t6NUg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references;\n\tbh=27C1aYr9nIq0w2zRR3dHopzvOKOmG1t7h6Zy0kvJ+eM=;\n\tb=jK0NF1DyRsljYeDKiaEY505IvSwWr3od60e6kGI3sfgkud9ezjjq6dFwSXwl6cdNqM\n\t5uKzlQduiHbz21y/NI3NRQD7FM4YbHxDYoG8B43WUqblZ1rI165BsG6rcT/F+fj4ZEgs\n\tJg+5fDDmQ8IpPP7ZLGueC9Wsl2chDeDaIt3kY6kkr6XvYajoUWoTicgsvpBJW+uMZO5D\n\t8o+utNU1eqqvf6ZzlCrf3eX4iNELt8zUaRAujSWOV2OXfw8jSHj261gkMfo3oV+WgZIQ\n\trTAvmuU/P3ZGsINW+j4qHbH9K5aYGBQQTjMsBxKJJ08nQRgAyuEnQ0SQ9ajSx/mOXAth\n\t5WjA==",
        "X-Gm-Message-State": "AKaTC03itbeaylX4NhVY3Y+xbLmRDjRn2jMcbAvUix/UzSHH8e6K9FsrwhZfnPVeh79x9w==",
        "X-Received": "by 10.194.164.226 with SMTP id\n\tyt2mr11875529wjb.201.1479747430719; \n\tMon, 21 Nov 2016 08:57:10 -0800 (PST)",
        "From": "Jan Blunck <jblunck@infradead.org>",
        "To": "dev@dpdk.org",
        "Cc": "shreyansh.jain@nxp.com,\n\tdavid.marchand@6wind.com",
        "Date": "Mon, 21 Nov 2016 17:55:20 +0100",
        "Message-Id": "<1479747322-5774-6-git-send-email-jblunck@infradead.org>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1479747322-5774-1-git-send-email-jblunck@infradead.org>",
        "References": "<1479747322-5774-1-git-send-email-jblunck@infradead.org>",
        "Subject": "[dpdk-dev] [PATCH v2 6/8] virtio: Don't depend on struct\n\trte_eth_dev's pci_dev",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "We don't need to depend on rte_eth_dev->pci_dev to differentiate between\nthe virtio_user and the virtio_pci case. Instead we can use the private\nvirtio_hw struct to get that information.\n\nSigned-off-by: Jan Blunck <jblunck@infradead.org>\n---\n drivers/net/virtio/virtio_ethdev.c | 21 ++++++++++-----------\n 1 file changed, 10 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex da9668e..023101d 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -483,11 +483,11 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)\n \t\thw->cvq = cvq;\n \t}\n \n-\t/* For virtio_user case (that is when dev->pci_dev is NULL), we use\n+\t/* For virtio_user case (that is when hw->dev is NULL), we use\n \t * virtual address. And we need properly set _offset_, please see\n \t * VIRTIO_MBUF_DATA_DMA_ADDR in virtqueue.h for more information.\n \t */\n-\tif (dev->pci_dev)\n+\tif (hw->dev)\n \t\tvq->offset = offsetof(struct rte_mbuf, buf_physaddr);\n \telse {\n \t\tvq->vq_ring_mem = (uintptr_t)mz->addr;\n@@ -1190,7 +1190,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \tstruct virtio_hw *hw = eth_dev->data->dev_private;\n \tstruct virtio_net_config *config;\n \tstruct virtio_net_config local_config;\n-\tstruct rte_pci_device *pci_dev = eth_dev->pci_dev;\n+\tstruct rte_pci_device *pci_dev = hw->dev;\n \tint ret;\n \n \t/* Reset the device although not necessary at startup */\n@@ -1294,7 +1294,6 @@ int\n eth_virtio_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct virtio_hw *hw = eth_dev->data->dev_private;\n-\tstruct rte_pci_device *pci_dev;\n \tuint32_t dev_flags = RTE_ETH_DEV_DETACHABLE;\n \tint ret;\n \n@@ -1317,10 +1316,11 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)\n \t\treturn -ENOMEM;\n \t}\n \n-\tpci_dev = eth_dev->pci_dev;\n-\n-\tif (pci_dev) {\n-\t\tret = vtpci_init(pci_dev, hw, &dev_flags);\n+\t/* For virtio_user case the hw->virtio_user_dev is populated by\n+\t * virtio_user_eth_dev_alloc() before eth_virtio_dev_init() is called.\n+\t */\n+\tif (!hw->virtio_user_dev) {\n+\t\tret = vtpci_init(ETH_DEV_PCI_DEV(eth_dev), hw, &dev_flags);\n \t\tif (ret)\n \t\t\treturn ret;\n \t}\n@@ -1343,7 +1343,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)\n static int\n eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)\n {\n-\tstruct rte_pci_device *pci_dev;\n \tstruct virtio_hw *hw = eth_dev->data->dev_private;\n \n \tPMD_INIT_FUNC_TRACE();\n@@ -1353,7 +1352,6 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)\n \n \tvirtio_dev_stop(eth_dev);\n \tvirtio_dev_close(eth_dev);\n-\tpci_dev = eth_dev->pci_dev;\n \n \teth_dev->dev_ops = NULL;\n \teth_dev->tx_pkt_burst = NULL;\n@@ -1367,7 +1365,8 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)\n \t\trte_intr_callback_unregister(vtpci_intr_handle(hw),\n \t\t\t\t\t\tvirtio_interrupt_handler,\n \t\t\t\t\t\teth_dev);\n-\trte_eal_pci_unmap_device(pci_dev);\n+\tif (hw->dev)\n+\t\trte_eal_pci_unmap_device(hw->dev);\n \n \tPMD_INIT_LOG(DEBUG, \"dev_uninit completed\");\n \n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "6/8"
    ]
}