Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/6777/?format=api
https://patches.dpdk.org/api/patches/6777/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1439977869-28091-2-git-send-email-mukawa@igel.co.jp/", "project": { "id": 1, "url": "https://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": "<1439977869-28091-2-git-send-email-mukawa@igel.co.jp>", "list_archive_url": "https://inbox.dpdk.org/dev/1439977869-28091-2-git-send-email-mukawa@igel.co.jp", "date": "2015-08-19T09:51:08", "name": "[dpdk-dev,2/3] vhost: Fix RESET_OWNER handling not to close callfd", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "2e37d2b1bf8d9f053296b8fa9f3edf157db3b7d6", "submitter": { "id": 64, "url": "https://patches.dpdk.org/api/people/64/?format=api", "name": "Tetsuya Mukawa", "email": "mukawa@igel.co.jp" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1439977869-28091-2-git-send-email-mukawa@igel.co.jp/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/6777/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/6777/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 2B53A8E9D;\n\tWed, 19 Aug 2015 11:53:05 +0200 (CEST)", "from mail-pa0-f50.google.com (mail-pa0-f50.google.com\n\t[209.85.220.50]) by dpdk.org (Postfix) with ESMTP id 8FE228E7A\n\tfor <dev@dpdk.org>; Wed, 19 Aug 2015 11:53:03 +0200 (CEST)", "by paccq16 with SMTP id cq16so110635049pac.1\n\tfor <dev@dpdk.org>; Wed, 19 Aug 2015 02:53:03 -0700 (PDT)", "from localhost.localdomain (napt.igel.co.jp. [219.106.231.132])\n\tby smtp.gmail.com with ESMTPSA id\n\tqe3sm212368pbc.73.2015.08.19.02.53.01\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 19 Aug 2015 02:53:02 -0700 (PDT)" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=bsVxs/CQDP+RHClJ3ARr8SeUXImu/Rx5Imtm2sG4QC8=;\n\tb=JoS+Ook3KlSray77YhSRN3QcZtZ8fM69Ir3oc6vS7yM8z2GGDdAXCb1cLIAoMr/ReZ\n\tsCK32UL72mdbZULeF8HS9HyKEURkZqjGArBaSCuzXSvtNciiIEl+VVBlK/6pfN30n5xc\n\tdRG1BGQkIlsF+sVAXSKy3sw4FBj39OUaZDpGNqC3B6mij1MbdW4cY+eH13n6TG9pnnHP\n\tjuhRGUvNdGjGu/q+24907sW3zCiHklTdTy1Q6+RV2tOJZn6z4jN375yjnnX8DgsTi/i8\n\tzYPEWFI7LD5e4DuPsXMCCR8Tr9+sjVY7nesvCghj8O7OFMguey/I66bjyV0zzrfZ22E1\n\tAOAA==", "X-Gm-Message-State": "ALoCoQlIBCgUroCsap4yvD+KG0WnzaJm0VhIFYoqBdjXNWW1KBTY0ktMkUlCQ8u+QSEVPDQnPl/S", "X-Received": "by 10.66.90.166 with SMTP id bx6mr22563507pab.133.1439977982924; \n\tWed, 19 Aug 2015 02:53:02 -0700 (PDT)", "From": "Tetsuya Mukawa <mukawa@igel.co.jp>", "To": "dev@dpdk.org", "Date": "Wed, 19 Aug 2015 18:51:08 +0900", "Message-Id": "<1439977869-28091-2-git-send-email-mukawa@igel.co.jp>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1439977869-28091-1-git-send-email-mukawa@igel.co.jp>", "References": "<1439977869-28091-1-git-send-email-mukawa@igel.co.jp>", "Subject": "[dpdk-dev] [PATCH 2/3] vhost: Fix RESET_OWNER handling not to close\n\tcallfd", "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": "When RESET_OWNER message is issued, vhost backend shouldn't close\n'callfd', because it will be valid while vhost-user connection\nis established. It should be closed when connection is closed.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_vhost/virtio-net.c | 35 ++++++++++++++++++++++++-----------\n 1 file changed, 24 insertions(+), 11 deletions(-)", "diff": "diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c\nindex 144f301..7794e8b 100644\n--- a/lib/librte_vhost/virtio-net.c\n+++ b/lib/librte_vhost/virtio-net.c\n@@ -189,13 +189,9 @@ cleanup_device(struct virtio_net *dev)\n \t\tfree(dev->mem);\n \t}\n \n-\t/* Close any event notifiers opened by device. */\n-\tif ((int)dev->virtqueue[VIRTIO_RXQ]->callfd >= 0)\n-\t\tclose((int)dev->virtqueue[VIRTIO_RXQ]->callfd);\n+\t/* Close kickfd event notifiers opened by device. */\n \tif ((int)dev->virtqueue[VIRTIO_RXQ]->kickfd >= 0)\n \t\tclose((int)dev->virtqueue[VIRTIO_RXQ]->kickfd);\n-\tif ((int)dev->virtqueue[VIRTIO_TXQ]->callfd >= 0)\n-\t\tclose((int)dev->virtqueue[VIRTIO_TXQ]->callfd);\n \tif ((int)dev->virtqueue[VIRTIO_TXQ]->kickfd >= 0)\n \t\tclose((int)dev->virtqueue[VIRTIO_TXQ]->kickfd);\n }\n@@ -206,6 +202,12 @@ cleanup_device(struct virtio_net *dev)\n static void\n free_device(struct virtio_net_config_ll *ll_dev)\n {\n+\t/* close callfd when connection is closed */\n+\tif ((int)ll_dev->dev.virtqueue[VIRTIO_RXQ]->callfd >= 0)\n+\t\tclose((int)ll_dev->dev.virtqueue[VIRTIO_RXQ]->callfd);\n+\tif ((int)ll_dev->dev.virtqueue[VIRTIO_TXQ]->callfd >= 0)\n+\t\tclose((int)ll_dev->dev.virtqueue[VIRTIO_TXQ]->callfd);\n+\n \t/* Free any malloc'd memory */\n \trte_free(ll_dev->dev.virtqueue[VIRTIO_RXQ]);\n \trte_free(ll_dev->dev.virtqueue[VIRTIO_TXQ]);\n@@ -241,6 +243,21 @@ rm_config_ll_entry(struct virtio_net_config_ll *ll_dev,\n \t}\n }\n \n+\n+/*\n+ * Rset variables in device structure.\n+ */\n+static void\n+reset_device(struct virtio_net *dev)\n+{\n+\tdev->virtqueue[VIRTIO_RXQ]->kickfd = (eventfd_t)-1;\n+\tdev->virtqueue[VIRTIO_TXQ]->kickfd = (eventfd_t)-1;\n+\n+\t/* Backends are set to -1 indicating an inactive device. */\n+\tdev->virtqueue[VIRTIO_RXQ]->backend = VIRTIO_DEV_STOPPED;\n+\tdev->virtqueue[VIRTIO_TXQ]->backend = VIRTIO_DEV_STOPPED;\n+}\n+\n /*\n * Initialise all variables in device structure.\n */\n@@ -261,14 +278,10 @@ init_device(struct virtio_net *dev)\n \tmemset(dev->virtqueue[VIRTIO_RXQ], 0, sizeof(struct vhost_virtqueue));\n \tmemset(dev->virtqueue[VIRTIO_TXQ], 0, sizeof(struct vhost_virtqueue));\n \n-\tdev->virtqueue[VIRTIO_RXQ]->kickfd = (eventfd_t)-1;\n \tdev->virtqueue[VIRTIO_RXQ]->callfd = (eventfd_t)-1;\n-\tdev->virtqueue[VIRTIO_TXQ]->kickfd = (eventfd_t)-1;\n \tdev->virtqueue[VIRTIO_TXQ]->callfd = (eventfd_t)-1;\n \n-\t/* Backends are set to -1 indicating an inactive device. */\n-\tdev->virtqueue[VIRTIO_RXQ]->backend = VIRTIO_DEV_STOPPED;\n-\tdev->virtqueue[VIRTIO_TXQ]->backend = VIRTIO_DEV_STOPPED;\n+\treset_device(dev);\n }\n \n /*\n@@ -403,7 +416,7 @@ reset_owner(struct vhost_device_ctx ctx)\n \tll_dev = get_config_ll_entry(ctx);\n \n \tcleanup_device(&ll_dev->dev);\n-\tinit_device(&ll_dev->dev);\n+\treset_device(&ll_dev->dev);\n \n \treturn 0;\n }\n", "prefixes": [ "dpdk-dev", "2/3" ] }{ "id": 6777, "url": "