Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/59725/?format=api
http://patches.dpdk.org/api/patches/59725/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190925171329.63734-14-yong.liu@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": "<20190925171329.63734-14-yong.liu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190925171329.63734-14-yong.liu@intel.com", "date": "2019-09-25T17:13:27", "name": "[v3,13/15] vhost: cache address translation result", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5294bd68bbd344b928df8b0d340557e095763ff8", "submitter": { "id": 17, "url": "http://patches.dpdk.org/api/people/17/?format=api", "name": "Marvin Liu", "email": "yong.liu@intel.com" }, "delegate": { "id": 2642, "url": "http://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190925171329.63734-14-yong.liu@intel.com/mbox/", "series": [ { "id": 6522, "url": "http://patches.dpdk.org/api/series/6522/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6522", "date": "2019-09-25T17:13:14", "name": "vhost packed ring performance optimization", "version": 3, "mbox": "http://patches.dpdk.org/series/6522/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/59725/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/59725/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 87BF21BEFE;\n\tWed, 25 Sep 2019 11:33:16 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id CE3171BEB1\n\tfor <dev@dpdk.org>; Wed, 25 Sep 2019 11:33:00 +0200 (CEST)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Sep 2019 02:32:49 -0700", "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142])\n\tby fmsmga004.fm.intel.com with ESMTP; 25 Sep 2019 02:32:48 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.64,547,1559545200\"; d=\"scan'208\";a=\"213986301\"", "From": "Marvin Liu <yong.liu@intel.com>", "To": "maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com, \n\tstephen@networkplumber.org, gavin.hu@arm.com", "Cc": "dev@dpdk.org,\n\tMarvin Liu <yong.liu@intel.com>", "Date": "Thu, 26 Sep 2019 01:13:27 +0800", "Message-Id": "<20190925171329.63734-14-yong.liu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190925171329.63734-1-yong.liu@intel.com>", "References": "<20190919163643.24130-2-yong.liu@intel.com>\n\t<20190925171329.63734-1-yong.liu@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 13/15] vhost: cache address translation result", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Cache address translation result and use it in next translation. Due\nto limited regions are supported, buffers are most likely in same\nregion when doing data transmission.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>", "diff": "diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h\nindex 7fb172912..d90235cd6 100644\n--- a/lib/librte_vhost/rte_vhost.h\n+++ b/lib/librte_vhost/rte_vhost.h\n@@ -91,10 +91,18 @@ struct rte_vhost_mem_region {\n \tint fd;\n };\n \n+struct rte_vhost_mem_region_cache {\n+\tuint64_t guest_phys_addr;\n+\tuint64_t guest_phys_addr_end;\n+\tint64_t host_user_addr_offset;\n+\tuint64_t size;\n+};\n+\n /**\n * Memory structure includes region and mapping information.\n */\n struct rte_vhost_memory {\n+\tstruct rte_vhost_mem_region_cache cache_region;\n \tuint32_t nregions;\n \tstruct rte_vhost_mem_region regions[];\n };\n@@ -232,11 +240,30 @@ rte_vhost_va_from_guest_pa(struct rte_vhost_memory *mem,\n \tstruct rte_vhost_mem_region *r;\n \tuint32_t i;\n \n+\tstruct rte_vhost_mem_region_cache *r_cache;\n+\t/* check with cached region */\n+\tr_cache = &mem->cache_region;\n+\tif (likely(gpa >= r_cache->guest_phys_addr && gpa <\n+\t\t r_cache->guest_phys_addr_end)) {\n+\t\tif (unlikely(*len > r_cache->guest_phys_addr_end - gpa))\n+\t\t\t*len = r_cache->guest_phys_addr_end - gpa;\n+\n+\t\treturn gpa - r_cache->host_user_addr_offset;\n+\t}\n+\n+\n \tfor (i = 0; i < mem->nregions; i++) {\n \t\tr = &mem->regions[i];\n \t\tif (gpa >= r->guest_phys_addr &&\n \t\t gpa < r->guest_phys_addr + r->size) {\n \n+\t\t\tr_cache->guest_phys_addr = r->guest_phys_addr;\n+\t\t\tr_cache->guest_phys_addr_end = r->guest_phys_addr +\n+\t\t\t\t\t\t r->size;\n+\t\t\tr_cache->size = r->size;\n+\t\t\tr_cache->host_user_addr_offset = r->guest_phys_addr -\n+\t\t\t\t\t\t\t r->host_user_addr;\n+\n \t\t\tif (unlikely(*len > r->guest_phys_addr + r->size - gpa))\n \t\t\t\t*len = r->guest_phys_addr + r->size - gpa;\n \n", "prefixes": [ "v3", "13/15" ] }{ "id": 59725, "url": "