Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/19494/?format=api
http://patches.dpdk.org/api/patches/19494/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1484637030-106261-6-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": "<1484637030-106261-6-git-send-email-jianfeng.tan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1484637030-106261-6-git-send-email-jianfeng.tan@intel.com", "date": "2017-01-17T07:10:25", "name": "[dpdk-dev,v4,05/10] net/virtio: add Rx queue intr enable/disable functions", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "c7ed5302e3a56a3a8c1100b9772f5f5f0108426e", "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/1484637030-106261-6-git-send-email-jianfeng.tan@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/19494/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/19494/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 E561E5320;\n\tTue, 17 Jan 2017 08:10:25 +0100 (CET)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 7D521106A\n\tfor <dev@dpdk.org>; Tue, 17 Jan 2017 08:09:56 +0100 (CET)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga104.jf.intel.com with ESMTP; 16 Jan 2017 23:09:56 -0800", "from dpdk06.sh.intel.com ([10.239.129.195])\n\tby fmsmga002.fm.intel.com with ESMTP; 16 Jan 2017 23:09:54 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.33,243,1477983600\"; d=\"scan'208\";\n\ta=\"1113750162\"", "From": "Jianfeng Tan <jianfeng.tan@intel.com>", "To": "dev@dpdk.org", "Cc": "yuanhan.liu@linux.intel.com, stephen@networkplumber.org,\n\tlei.a.yao@intel.com, Jianfeng Tan <jianfeng.tan@intel.com>", "Date": "Tue, 17 Jan 2017 07:10:25 +0000", "Message-Id": "<1484637030-106261-6-git-send-email-jianfeng.tan@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1484637030-106261-1-git-send-email-jianfeng.tan@intel.com>", "References": "<1480810702-114815-1-git-send-email-jianfeng.tan@intel.com>\n\t<1484637030-106261-1-git-send-email-jianfeng.tan@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 05/10] net/virtio: add Rx queue intr\n\tenable/disable functions", "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": "This patch implements interrupt enable/disable functions for each\nRx queue. And we rely on flags of avail queue as the hint for virtio\ndevice to interrupt virtio driver or not.\n\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\nTested-by: Lei Yao <lei.a.yao@intel.com>\n---\n drivers/net/virtio/virtio_ethdev.c | 22 ++++++++++++++++++++++\n drivers/net/virtio/virtqueue.c | 11 -----------\n drivers/net/virtio/virtqueue.h | 16 +++++++++++++++-\n 3 files changed, 37 insertions(+), 12 deletions(-)", "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex bec2be2..4224d17 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -717,6 +717,26 @@ virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n \treturn 0;\n }\n \n+static int\n+virtio_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)\n+{\n+\tstruct virtnet_rx *rxvq = dev->data->rx_queues[queue_id];\n+\tstruct virtqueue *vq = rxvq->vq;\n+\n+\tvirtqueue_enable_intr(vq);\n+\treturn 0;\n+}\n+\n+static int\n+virtio_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)\n+{\n+\tstruct virtnet_rx *rxvq = dev->data->rx_queues[queue_id];\n+\tstruct virtqueue *vq = rxvq->vq;\n+\n+\tvirtqueue_disable_intr(vq);\n+\treturn 0;\n+}\n+\n /*\n * dev_ops for virtio, bare necessities for basic operation\n */\n@@ -738,6 +758,8 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {\n \t.xstats_reset = virtio_dev_stats_reset,\n \t.link_update = virtio_dev_link_update,\n \t.rx_queue_setup = virtio_dev_rx_queue_setup,\n+\t.rx_queue_intr_enable = virtio_dev_rx_queue_intr_enable,\n+\t.rx_queue_intr_disable = virtio_dev_rx_queue_intr_disable,\n \t.rx_queue_release = virtio_dev_queue_release,\n \t.rx_descriptor_done = virtio_dev_rx_queue_done,\n \t.tx_queue_setup = virtio_dev_tx_queue_setup,\ndiff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c\nindex 7f60e3e..9ad77b8 100644\n--- a/drivers/net/virtio/virtqueue.c\n+++ b/drivers/net/virtio/virtqueue.c\n@@ -38,17 +38,6 @@\n #include \"virtio_logs.h\"\n #include \"virtio_pci.h\"\n \n-void\n-virtqueue_disable_intr(struct virtqueue *vq)\n-{\n-\t/*\n-\t * Set VRING_AVAIL_F_NO_INTERRUPT to hint host\n-\t * not to interrupt when it consumes packets\n-\t * Note: this is only considered a hint to the host\n-\t */\n-\tvq->vq_ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;\n-}\n-\n /*\n * Two types of mbuf to be cleaned:\n * 1) mbuf that has been consumed by backend but not used by virtio.\ndiff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h\nindex b1070e0..f9e3736 100644\n--- a/drivers/net/virtio/virtqueue.h\n+++ b/drivers/net/virtio/virtqueue.h\n@@ -274,7 +274,21 @@ vring_desc_init(struct vring_desc *dp, uint16_t n)\n /**\n * Tell the backend not to interrupt us.\n */\n-void virtqueue_disable_intr(struct virtqueue *vq);\n+static inline void\n+virtqueue_disable_intr(struct virtqueue *vq)\n+{\n+\tvq->vq_ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;\n+}\n+\n+/**\n+ * Tell the backend to interrupt us.\n+ */\n+static inline void\n+virtqueue_enable_intr(struct virtqueue *vq)\n+{\n+\tvq->vq_ring.avail->flags &= (~VRING_AVAIL_F_NO_INTERRUPT);\n+}\n+\n /**\n * Dump virtqueue internal structures, for debug purpose only.\n */\n", "prefixes": [ "dpdk-dev", "v4", "05/10" ] }{ "id": 19494, "url": "