get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1784,
    "url": "http://patches.dpdk.org/api/patches/1784/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1418019716-4962-8-git-send-email-changchun.ouyang@intel.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": "<1418019716-4962-8-git-send-email-changchun.ouyang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1418019716-4962-8-git-send-email-changchun.ouyang@intel.com",
    "date": "2014-12-08T06:21:46",
    "name": "[dpdk-dev,RFC,07/17] virtio: Remove unnecessary adapter structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "e62ae1845f135d6bf9773c52c640595881963264",
    "submitter": {
        "id": 31,
        "url": "http://patches.dpdk.org/api/people/31/?format=api",
        "name": "Ouyang Changchun",
        "email": "changchun.ouyang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1418019716-4962-8-git-send-email-changchun.ouyang@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/1784/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/1784/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 01935DE4;\n\tMon,  8 Dec 2014 07:22:24 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id A44C63B5\n\tfor <dev@dpdk.org>; Mon,  8 Dec 2014 07:22:20 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP; 07 Dec 2014 22:22:19 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 07 Dec 2014 22:11:45 -0800",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id sB86MGZD019095;\n\tMon, 8 Dec 2014 14:22:16 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid sB86MEZA005055; Mon, 8 Dec 2014 14:22:16 +0800",
            "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sB86MERm005050; \n\tMon, 8 Dec 2014 14:22:14 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"426355297\"",
        "From": "Ouyang Changchun <changchun.ouyang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon,  8 Dec 2014 14:21:46 +0800",
        "Message-Id": "<1418019716-4962-8-git-send-email-changchun.ouyang@intel.com>",
        "X-Mailer": "git-send-email 1.7.12.2",
        "In-Reply-To": "<1418019716-4962-1-git-send-email-changchun.ouyang@intel.com>",
        "References": "<1418019716-4962-1-git-send-email-changchun.ouyang@intel.com>",
        "Subject": "[dpdk-dev] [RFC PATCH 07/17] virtio: Remove unnecessary adapter\n\tstructure",
        "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": "Cleanup virtio code by eliminating unnecessary nesting of\nvirtio hardware structure inside adapter structure.\nAlso allows removing unneeded macro, making code clearer.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/librte_pmd_virtio/virtio_ethdev.c | 43 ++++++++++++-----------------------\n lib/librte_pmd_virtio/virtio_ethdev.h |  9 --------\n lib/librte_pmd_virtio/virtio_rxtx.c   |  3 +--\n 3 files changed, 16 insertions(+), 39 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c\nindex 829838c..c89614d 100644\n--- a/lib/librte_pmd_virtio/virtio_ethdev.c\n+++ b/lib/librte_pmd_virtio/virtio_ethdev.c\n@@ -207,8 +207,7 @@ virtio_send_command(struct virtqueue *vq, struct virtio_pmd_ctrl *ctrl,\n static int\n virtio_set_multiple_queues(struct rte_eth_dev *dev, uint16_t nb_queues)\n {\n-\tstruct virtio_hw *hw\n-\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tstruct virtio_pmd_ctrl ctrl;\n \tint dlen[1];\n \tint ret;\n@@ -242,8 +241,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,\n \tconst struct rte_memzone *mz;\n \tuint16_t vq_size;\n \tint size;\n-\tstruct virtio_hw *hw =\n-\t\tVIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tstruct virtqueue  *vq = NULL;\n \n \t/* Write the virtqueue index to the Queue Select Field */\n@@ -383,8 +381,7 @@ virtio_dev_cq_queue_setup(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx,\n \tstruct virtqueue *vq;\n \tuint16_t nb_desc = 0;\n \tint ret;\n-\tstruct virtio_hw *hw =\n-\t\tVIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \n \tPMD_INIT_FUNC_TRACE();\n \tret = virtio_dev_queue_setup(dev, VTNET_CQ, VTNET_SQ_CQ_QUEUE_IDX,\n@@ -410,8 +407,7 @@ virtio_dev_close(struct rte_eth_dev *dev)\n static void\n virtio_dev_promiscuous_enable(struct rte_eth_dev *dev)\n {\n-\tstruct virtio_hw *hw\n-\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tstruct virtio_pmd_ctrl ctrl;\n \tint dlen[1];\n \tint ret;\n@@ -430,8 +426,7 @@ virtio_dev_promiscuous_enable(struct rte_eth_dev *dev)\n static void\n virtio_dev_promiscuous_disable(struct rte_eth_dev *dev)\n {\n-\tstruct virtio_hw *hw\n-\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tstruct virtio_pmd_ctrl ctrl;\n \tint dlen[1];\n \tint ret;\n@@ -450,8 +445,7 @@ virtio_dev_promiscuous_disable(struct rte_eth_dev *dev)\n static void\n virtio_dev_allmulticast_enable(struct rte_eth_dev *dev)\n {\n-\tstruct virtio_hw *hw\n-\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tstruct virtio_pmd_ctrl ctrl;\n \tint dlen[1];\n \tint ret;\n@@ -470,8 +464,7 @@ virtio_dev_allmulticast_enable(struct rte_eth_dev *dev)\n static void\n virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)\n {\n-\tstruct virtio_hw *hw\n-\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tstruct virtio_pmd_ctrl ctrl;\n \tint dlen[1];\n \tint ret;\n@@ -853,8 +846,7 @@ virtio_interrupt_handler(__rte_unused struct rte_intr_handle *handle,\n \t\t\t void *param)\n {\n \tstruct rte_eth_dev *dev = param;\n-\tstruct virtio_hw *hw =\n-\t\tVIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tuint8_t isr;\n \n \t/* Read interrupt status which clears interrupt */\n@@ -880,12 +872,11 @@ static int\n eth_virtio_dev_init(__rte_unused struct eth_driver *eth_drv,\n \t\tstruct rte_eth_dev *eth_dev)\n {\n+\tstruct virtio_hw *hw = eth_dev->data->dev_private;\n \tstruct virtio_net_config *config;\n \tstruct virtio_net_config local_config;\n \tuint32_t offset_conf = sizeof(config->mac);\n \tstruct rte_pci_device *pci_dev;\n-\tstruct virtio_hw *hw =\n-\t\tVIRTIO_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n \n \tif (RTE_PKTMBUF_HEADROOM < sizeof(struct virtio_net_hdr)) {\n \t\tPMD_INIT_LOG(ERR,\n@@ -1010,7 +1001,7 @@ static struct eth_driver rte_virtio_pmd = {\n \t\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,\n \t},\n \t.eth_dev_init = eth_virtio_dev_init,\n-\t.dev_private_size = sizeof(struct virtio_adapter),\n+\t.dev_private_size = sizeof(struct virtio_hw),\n };\n \n /*\n@@ -1053,8 +1044,7 @@ static int\n virtio_dev_configure(struct rte_eth_dev *dev)\n {\n \tconst struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;\n-\tstruct virtio_hw *hw =\n-\t\tVIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tint ret;\n \n \tPMD_INIT_LOG(DEBUG, \"configure\");\n@@ -1078,8 +1068,7 @@ static int\n virtio_dev_start(struct rte_eth_dev *dev)\n {\n \tuint16_t nb_queues, i;\n-\tstruct virtio_hw *hw =\n-\t\tVIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \n \t/* Tell the host we've noticed this device. */\n \tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_ACK);\n@@ -1185,8 +1174,7 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev)\n static void\n virtio_dev_stop(struct rte_eth_dev *dev)\n {\n-\tstruct virtio_hw *hw =\n-\t\tVIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \n \t/* reset the NIC */\n \tvtpci_irq_config(hw, 0);\n@@ -1199,8 +1187,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet\n {\n \tstruct rte_eth_link link, old;\n \tuint16_t status;\n-\tstruct virtio_hw *hw =\n-\t\tVIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \tmemset(&link, 0, sizeof(link));\n \tvirtio_dev_atomic_read_link_status(dev, &link);\n \told = link;\n@@ -1232,7 +1219,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet\n static void\n virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n {\n-\tstruct virtio_hw *hw = VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \n \tdev_info->driver_name = dev->driver->pci_drv.name;\n \tdev_info->max_rx_queues = (uint16_t)hw->max_rx_queues;\ndiff --git a/lib/librte_pmd_virtio/virtio_ethdev.h b/lib/librte_pmd_virtio/virtio_ethdev.h\nindex 1da3c62..55c9749 100644\n--- a/lib/librte_pmd_virtio/virtio_ethdev.h\n+++ b/lib/librte_pmd_virtio/virtio_ethdev.h\n@@ -110,15 +110,6 @@ uint16_t virtio_recv_mergeable_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\n uint16_t virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\tuint16_t nb_pkts);\n \n-/*\n- * Structure to store private data for each driver instance (for each port).\n- */\n-struct virtio_adapter {\n-\tstruct virtio_hw hw;\n-};\n-\n-#define VIRTIO_DEV_PRIVATE_TO_HW(adapter)\\\n-\t(&((struct virtio_adapter *)adapter)->hw)\n \n /*\n  * The VIRTIO_NET_F_GUEST_TSO[46] features permit the host to send us\ndiff --git a/lib/librte_pmd_virtio/virtio_rxtx.c b/lib/librte_pmd_virtio/virtio_rxtx.c\nindex a5756e1..73ad3ac 100644\n--- a/lib/librte_pmd_virtio/virtio_rxtx.c\n+++ b/lib/librte_pmd_virtio/virtio_rxtx.c\n@@ -326,8 +326,7 @@ virtio_dev_vring_start(struct virtqueue *vq, int queue_type)\n void\n virtio_dev_cq_start(struct rte_eth_dev *dev)\n {\n-\tstruct virtio_hw *hw\n-\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n \n \tif (hw->cvq) {\n \t\tvirtio_dev_vring_start(hw->cvq, VTNET_CQ);\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "07/17"
    ]
}