Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/17102/?format=api
http://patches.dpdk.org/api/patches/17102/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1479636327-4166-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": "<1479636327-4166-6-git-send-email-jblunck@infradead.org>", "list_archive_url": "https://inbox.dpdk.org/dev/1479636327-4166-6-git-send-email-jblunck@infradead.org", "date": "2016-11-20T10:05:26", "name": "[dpdk-dev,6/7] 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": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1479636327-4166-6-git-send-email-jblunck@infradead.org/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/17102/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/17102/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 2C9D668F2;\n\tSun, 20 Nov 2016 11:08:28 +0100 (CET)", "from mail-wm0-f65.google.com (mail-wm0-f65.google.com\n\t[74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 203B3558B\n\tfor <dev@dpdk.org>; Sun, 20 Nov 2016 11:07:15 +0100 (CET)", "by mail-wm0-f65.google.com with SMTP id a20so18303954wme.2\n\tfor <dev@dpdk.org>; Sun, 20 Nov 2016 02:07:15 -0800 (PST)", "from weierstrass.local.net ([91.200.110.70])\n\tby smtp.gmail.com with ESMTPSA id\n\td184sm13235434wmd.8.2016.11.20.02.07.13\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 20 Nov 2016 02:07:13 -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=IkK1CeEMnAdNZhDfWiJPKyD6DWSUcWdZbYv/JtIBA4e2HE0Ue4p92Ml+UDtyJbQwXe\n\tGgSUyq8Jy1SFKr7XMDkOvm+POojHfCPUo7HdbUIwSsnMNVxWvLzZLEO6ZwoiU+tWeL00\n\tc2zx2ptNZKwxQpjdaCy2jPmg5PlSKGDUiORfysUNdEGlIPoHritaKOeaTfeAWdyHogz6\n\t/16iWbyyoMwgSK1aC32mwvjd85T3nUtJWnjauZ9BXnl4v05Z6ne2RCDls3pL799Ehofo\n\thG1YjstiVwhQmA1pJN3Ews+8msupB6g03wVcFaYiA6coPBTjOtCyVlMbjTBPyQuV6vSd\n\thqRQ==", "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=nGAUADaZNhmGY3SsZ/4e8LY6dZmDpF7b7RZQLKtdtKGoqo0wpJ9Rptx2WzEx4sQiw5\n\taJLjGcToMJttHnB/67qR1bCMqbseR32NdFqE9IQedtSzXbPqiYIfdoyQQ4RBJACsQfIs\n\tEnDLgIiL32kFtFFxLw708oIq2cfGqjqXIBlrhl+IIaHh4vXzMBVmyKj89GYdBBoviQ39\n\tXNHRZvdIfw+O65S7q+MPv6kqMDecoCTI+RoFcKdLayL8ab/attLY/01VATHKacIFbewf\n\t4K59Q1sCXMU465yUkc9oGtkFgOyS2wNu228yGyhw6B0aLpAiYpHmPxDXULrmrg15Pk74\n\tGSJw==", "X-Gm-Message-State": "AKaTC00+Y0bCLRHdg+bpNV5c9Zs0TUIOtHVFxK5EBuhbd/LfSOMt6gKLYo/t72CRIAu3YA==", "X-Received": "by 10.28.209.67 with SMTP id i64mr8569221wmg.48.1479636434702;\n\tSun, 20 Nov 2016 02:07:14 -0800 (PST)", "From": "Jan Blunck <jblunck@infradead.org>", "To": "dev@dpdk.org", "Cc": "shreyansh.jain@nxp.com", "Date": "Sun, 20 Nov 2016 11:05:26 +0100", "Message-Id": "<1479636327-4166-6-git-send-email-jblunck@infradead.org>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1479636327-4166-1-git-send-email-jblunck@infradead.org>", "References": "<1479636327-4166-1-git-send-email-jblunck@infradead.org>", "Subject": "[dpdk-dev] [PATCH 6/7] virtio: Don't depend on struct rte_eth_dev's\n\tpci_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", "6/7" ] }{ "id": 17102, "url": "