Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/21399/?format=api
http://patches.dpdk.org/api/patches/21399/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1488563803-87754-3-git-send-email-jianfeng.tan@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": "<1488563803-87754-3-git-send-email-jianfeng.tan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1488563803-87754-3-git-send-email-jianfeng.tan@intel.com", "date": "2017-03-03T17:56:40", "name": "[dpdk-dev,2/5] net/virtio-user: add rxq interrupt mode support", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "58e8f9e992e8e787b2042e74b324a12f38bbc04b", "submitter": { "id": 313, "url": "http://patches.dpdk.org/api/people/313/?format=api", "name": "Jianfeng Tan", "email": "jianfeng.tan@intel.com" }, "delegate": { "id": 355, "url": "http://patches.dpdk.org/api/users/355/?format=api", "username": "yliu", "first_name": "Yuanhan", "last_name": "Liu", "email": "yuanhan.liu@linux.intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1488563803-87754-3-git-send-email-jianfeng.tan@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/21399/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/21399/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 7115EFB66;\n\tFri, 3 Mar 2017 18:56:24 +0100 (CET)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id ECEDAFB34\n\tfor <dev@dpdk.org>; Fri, 3 Mar 2017 18:55:58 +0100 (CET)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t03 Mar 2017 09:55:58 -0800", "from dpdk06.sh.intel.com ([10.239.129.195])\n\tby fmsmga005.fm.intel.com with ESMTP; 03 Mar 2017 09:55:57 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.35,237,1484035200\"; d=\"scan'208\";a=\"71894491\"", "From": "Jianfeng Tan <jianfeng.tan@intel.com>", "To": "dev@dpdk.org", "Cc": "yuanhan.liu@linux.intel.com, david.marchand@6wind.com,\n\tJianfeng Tan <jianfeng.tan@intel.com>", "Date": "Fri, 3 Mar 2017 17:56:40 +0000", "Message-Id": "<1488563803-87754-3-git-send-email-jianfeng.tan@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1488563803-87754-1-git-send-email-jianfeng.tan@intel.com>", "References": "<1488563803-87754-1-git-send-email-jianfeng.tan@intel.com>", "Subject": "[dpdk-dev] [PATCH 2/5] net/virtio-user: add rxq interrupt mode\n\tsupport", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <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": "Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\n drivers/net/virtio/virtio_ethdev.c | 17 ++++++++++++++--\n drivers/net/virtio/virtio_user/virtio_user_dev.c | 25 +++++++++++++++++++++++-\n drivers/net/virtio/virtio_user/virtio_user_dev.h | 2 +-\n drivers/net/virtio/virtio_user_ethdev.c | 12 +++++++++++-\n 4 files changed, 51 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 4dc03b9..5d80d1a 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -1264,6 +1264,10 @@ virtio_configure_intr(struct rte_eth_dev *dev)\n {\n \tstruct virtio_hw *hw = dev->data->dev_private;\n \n+\n+#ifdef RTE_VIRTIO_USER\n+ if (!hw->virtio_user_dev) {\n+#endif\n \tif (!rte_intr_cap_multiple(dev->intr_handle)) {\n \t\tPMD_INIT_LOG(ERR, \"Multiple intr vector not supported\");\n \t\treturn -ENOTSUP;\n@@ -1273,6 +1277,9 @@ virtio_configure_intr(struct rte_eth_dev *dev)\n \t\tPMD_INIT_LOG(ERR, \"Fail to create eventfd\");\n \t\treturn -1;\n \t}\n+#ifdef RTE_VIRTIO_USER\n+\t}\n+#endif\n \n \tif (!dev->intr_handle->intr_vec) {\n \t\tdev->intr_handle->intr_vec =\n@@ -1293,6 +1300,9 @@ virtio_configure_intr(struct rte_eth_dev *dev)\n \t\t\t\t virtio_interrupt_handler,\n \t\t\t\t dev);\n \n+#ifdef RTE_VIRTIO_USER\n+ if (!hw->virtio_user_dev) {\n+#endif\n \t/* DO NOT try to remove this! This function will enable msix, or QEMU\n \t * will encounter SIGSEGV when DRIVER_OK is sent.\n \t * And for legacy devices, this should be done before queue/vec binding\n@@ -1303,6 +1313,9 @@ virtio_configure_intr(struct rte_eth_dev *dev)\n \t\tPMD_DRV_LOG(ERR, \"interrupt enable failed\");\n \t\treturn -1;\n \t}\n+#ifdef RTE_VIRTIO_USER\n+\t}\n+#endif\n \n \tif (virtio_queues_bind_intr(dev) < 0) {\n \t\tPMD_INIT_LOG(ERR, \"Failed to bind queue/interrupt\");\n@@ -1409,6 +1422,8 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \tif (ret < 0)\n \t\treturn ret;\n \n+\tvtpci_reinit_complete(hw);\n+\n \tif (eth_dev->data->dev_conf.intr_conf.rxq) {\n \t\tif (virtio_configure_intr(eth_dev) < 0) {\n \t\t\tPMD_INIT_LOG(ERR, \"failed to configure interrupt\");\n@@ -1416,8 +1431,6 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \t\t}\n \t}\n \n-\tvtpci_reinit_complete(hw);\n-\n \tif (pci_dev)\n \t\tPMD_INIT_LOG(DEBUG, \"port %d vendorID=0x%x deviceID=0x%x\",\n \t\t\teth_dev->data->port_id, pci_dev->id.vendor_id,\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex 21ed00d..9777d6b 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -140,8 +140,28 @@ virtio_user_queue_setup(struct virtio_user_dev *dev,\n \treturn 0;\n }\n \n+static void\n+virtio_user_fill_intr_handle(struct virtio_user_dev *dev, uint8_t portid)\n+{\n+\tuint32_t i;\n+\tstruct rte_eth_dev *eth_dev = &rte_eth_devices[portid];\n+\n+\tif (!eth_dev->intr_handle) {\n+\t\teth_dev->intr_handle = malloc(sizeof(*eth_dev->intr_handle));\n+\t\tif (!eth_dev->intr_handle)\n+\t\t\treturn;\n+\t\tmemset(eth_dev->intr_handle, 0, sizeof(*eth_dev->intr_handle));\n+\t}\n+\n+\tfor (i = 0; i < dev->max_queue_pairs; ++i)\n+\t\teth_dev->intr_handle->efds[i] = dev->callfds[i];\n+\teth_dev->intr_handle->nb_efd = dev->max_queue_pairs;\n+\teth_dev->intr_handle->max_intr = dev->max_queue_pairs + 1;\n+\teth_dev->intr_handle->type = RTE_INTR_HANDLE_VDEV;\n+}\n+\n int\n-virtio_user_start_device(struct virtio_user_dev *dev)\n+virtio_user_start_device(struct virtio_user_dev *dev, uint8_t portid)\n {\n \tuint64_t features;\n \tint ret;\n@@ -175,6 +195,9 @@ virtio_user_start_device(struct virtio_user_dev *dev)\n \t */\n \tdev->ops->enable_qp(dev, 0, 1);\n \n+\t/* Step 5: prepare for interrupt mode */\n+\tvirtio_user_fill_intr_handle(dev, portid);\n+\n \treturn 0;\n error:\n \t/* TODO: free resource here or caller to check */\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h\nindex 0d39f40..3b529f0 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h\n@@ -66,7 +66,7 @@ struct virtio_user_dev {\n \tstruct virtio_user_backend_ops *ops;\n };\n \n-int virtio_user_start_device(struct virtio_user_dev *dev);\n+int virtio_user_start_device(struct virtio_user_dev *dev, uint8_t portid);\n int virtio_user_stop_device(struct virtio_user_dev *dev);\n int virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t\t\t int cq, int queue_size, const char *mac);\ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 0b226ac..fa79419 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -101,7 +101,7 @@ virtio_user_set_status(struct virtio_hw *hw, uint8_t status)\n \tstruct virtio_user_dev *dev = virtio_user_get_dev(hw);\n \n \tif (status & VIRTIO_CONFIG_STATUS_DRIVER_OK)\n-\t\tvirtio_user_start_device(dev);\n+\t\tvirtio_user_start_device(dev, hw->port_id);\n \telse if (status == VIRTIO_CONFIG_STATUS_RESET)\n \t\tvirtio_user_reset(hw);\n \tdev->status = status;\n@@ -148,6 +148,15 @@ virtio_user_set_config_irq(struct virtio_hw *hw __rte_unused,\n \treturn VIRTIO_MSI_NO_VECTOR;\n }\n \n+static uint16_t\n+virtio_user_set_queue_irq(struct virtio_hw *hw __rte_unused,\n+\t\t\t struct virtqueue *vq __rte_unused,\n+\t\t\t uint16_t vec)\n+{\n+\t/* pretend we have done that */\n+\treturn vec;\n+}\n+\n /* This function is to get the queue size, aka, number of descs, of a specified\n * queue. Different with the VHOST_USER_GET_QUEUE_NUM, which is used to get the\n * max supported queues.\n@@ -226,6 +235,7 @@ const struct virtio_pci_ops virtio_user_ops = {\n \t.set_features\t= virtio_user_set_features,\n \t.get_isr\t= virtio_user_get_isr,\n \t.set_config_irq\t= virtio_user_set_config_irq,\n+\t.set_queue_irq\t= virtio_user_set_queue_irq,\n \t.get_queue_num\t= virtio_user_get_queue_num,\n \t.setup_queue\t= virtio_user_setup_queue,\n \t.del_queue\t= virtio_user_del_queue,\n", "prefixes": [ "dpdk-dev", "2/5" ] }{ "id": 21399, "url": "