Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/9623/?format=api
http://patches.dpdk.org/api/patches/9623/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1450769304-22986-3-git-send-email-yuanhan.liu@linux.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": "<1450769304-22986-3-git-send-email-yuanhan.liu@linux.intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1450769304-22986-3-git-send-email-yuanhan.liu@linux.intel.com", "date": "2015-12-22T07:28:24", "name": "[dpdk-dev,v2,3/3] vhost: fix vq realloc at numa_realloc", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "10ebbd10dc107902822c2597d5fce27fe5211fa4", "submitter": { "id": 307, "url": "http://patches.dpdk.org/api/people/307/?format=api", "name": "Yuanhan Liu", "email": "yuanhan.liu@linux.intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1450769304-22986-3-git-send-email-yuanhan.liu@linux.intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/9623/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/9623/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 510888E69;\n\tTue, 22 Dec 2015 08:27:18 +0100 (CET)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 798588D8F\n\tfor <dev@dpdk.org>; Tue, 22 Dec 2015 08:27:14 +0100 (CET)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP; 21 Dec 2015 23:27:14 -0800", "from yliu-dev.sh.intel.com ([10.239.66.49])\n\tby fmsmga002.fm.intel.com with ESMTP; 21 Dec 2015 23:27:12 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.20,463,1444719600\"; d=\"scan'208\";a=\"878839800\"", "From": "Yuanhan Liu <yuanhan.liu@linux.intel.com>", "To": "dev@dpdk.org", "Date": "Tue, 22 Dec 2015 15:28:24 +0800", "Message-Id": "<1450769304-22986-3-git-send-email-yuanhan.liu@linux.intel.com>", "X-Mailer": "git-send-email 1.9.0", "In-Reply-To": "<1450769304-22986-1-git-send-email-yuanhan.liu@linux.intel.com>", "References": "<1450422247-6814-1-git-send-email-yuanhan.liu@linux.intel.com>\n\t<1450769304-22986-1-git-send-email-yuanhan.liu@linux.intel.com>", "Subject": "[dpdk-dev] [PATCH v2 3/3] vhost: fix vq realloc at numa_realloc", "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": "vq is allocated on pairs, hence we should do pair reallocation\nat numa_realloc() as well, otherwise an error like following\noccurs while do numa reallocation:\n\n VHOST_CONFIG: reallocate vq from 0 to 1 node\n PANIC in rte_free():\n Fatal error: Invalid memory\n\nThe reason we don't catch it is because numa_realloc() will\nnot take effect when RTE_LIBRTE_VHOST_NUMA is not enabled,\nwhich is the default case.\n\nFixes: e049ca6d10e0 (\"vhost-user: prepare multiple queue setup\")\n\nSigned-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>\nAcked-by: Huawei Xie <huawei.xie@intel.com>\n---\n lib/librte_vhost/virtio-net.c | 13 +++++++++++--\n 1 file changed, 11 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c\nindex 1566c93..7469312 100644\n--- a/lib/librte_vhost/virtio-net.c\n+++ b/lib/librte_vhost/virtio-net.c\n@@ -445,6 +445,13 @@ numa_realloc(struct virtio_net *dev, int index)\n \tstruct vhost_virtqueue *old_vq, *vq;\n \tint ret;\n \n+\t/*\n+\t * vq is allocated on pairs, we should try to do realloc\n+\t * on first queue of one queue pair only.\n+\t */\n+\tif (index % VIRTIO_QNUM != 0)\n+\t\treturn dev;\n+\n \told_dev = dev;\n \tvq = old_vq = dev->virtqueue[index];\n \n@@ -461,11 +468,12 @@ numa_realloc(struct virtio_net *dev, int index)\n \tif (oldnode != newnode) {\n \t\tRTE_LOG(INFO, VHOST_CONFIG,\n \t\t\t\"reallocate vq from %d to %d node\\n\", oldnode, newnode);\n-\t\tvq = rte_malloc_socket(NULL, sizeof(*vq), 0, newnode);\n+\t\tvq = rte_malloc_socket(NULL, sizeof(*vq) * VIRTIO_QNUM, 0,\n+\t\t\t\t newnode);\n \t\tif (!vq)\n \t\t\treturn dev;\n \n-\t\tmemcpy(vq, old_vq, sizeof(*vq));\n+\t\tmemcpy(vq, old_vq, sizeof(*vq) * VIRTIO_QNUM);\n \t\trte_free(old_vq);\n \t}\n \n@@ -491,6 +499,7 @@ numa_realloc(struct virtio_net *dev, int index)\n \n out:\n \tdev->virtqueue[index] = vq;\n+\tdev->virtqueue[index + 1] = vq + 1;\n \tvhost_devices[dev->device_fh] = dev;\n \n \treturn dev;\n", "prefixes": [ "dpdk-dev", "v2", "3/3" ] }{ "id": 9623, "url": "