Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/35161/?format=api
http://patches.dpdk.org/api/patches/35161/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1518580892-32656-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": "<1518580892-32656-3-git-send-email-jianfeng.tan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1518580892-32656-3-git-send-email-jianfeng.tan@intel.com", "date": "2018-02-14T04:01:30", "name": "[dpdk-dev,2/4] vhost: avoid function call in data path", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "de62f6355be7ff3d7ab7bed6b859be9bfe160c14", "submitter": { "id": 313, "url": "http://patches.dpdk.org/api/people/313/?format=api", "name": "Jianfeng Tan", "email": "jianfeng.tan@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/1518580892-32656-3-git-send-email-jianfeng.tan@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/35161/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/35161/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 87A931B320;\n\tWed, 14 Feb 2018 04:59:51 +0100 (CET)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id C89D41B305\n\tfor <dev@dpdk.org>; Wed, 14 Feb 2018 04:59:48 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Feb 2018 19:59:48 -0800", "from dpdk06.sh.intel.com ([10.67.110.196])\n\tby orsmga002.jf.intel.com with ESMTP; 13 Feb 2018 19:59:47 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.46,510,1511856000\"; d=\"scan'208\";a=\"34520061\"", "From": "Jianfeng Tan <jianfeng.tan@intel.com>", "To": "dev@dpdk.org", "Cc": "Jianfeng Tan <jianfeng.tan@intel.com>, maxime.coquelin@redhat.com,\n\tyliu@fridaylinux.org", "Date": "Wed, 14 Feb 2018 04:01:30 +0000", "Message-Id": "<1518580892-32656-3-git-send-email-jianfeng.tan@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1518580892-32656-1-git-send-email-jianfeng.tan@intel.com>", "References": "<1518580892-32656-1-git-send-email-jianfeng.tan@intel.com>", "Subject": "[dpdk-dev] [PATCH 2/4] vhost: avoid function call in data path", "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://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": "<https://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": "Previously, get_device() is a function call. It's OK for slow path\nconfiguration, but takes some cycles for data path.\n\nTo avoid that, we turn this function to inline type.\n\nCc: maxime.coquelin@redhat.com\nCc: yliu@fridaylinux.org\n\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\n lib/librte_vhost/vhost.c | 13 -------------\n lib/librte_vhost/vhost.h | 13 ++++++++++++-\n 2 files changed, 12 insertions(+), 14 deletions(-)", "diff": "diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex a407067..f6f12a0 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -68,19 +68,6 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \treturn 0;\n }\n \n-struct virtio_net *\n-get_device(int vid)\n-{\n-\tstruct virtio_net *dev = vhost_devices[vid];\n-\n-\tif (unlikely(!dev)) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"(%d) device not found.\\n\", vid);\n-\t}\n-\n-\treturn dev;\n-}\n-\n void\n cleanup_vq(struct vhost_virtqueue *vq, int destroy)\n {\ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex ecd5b7b..3fce13b 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -343,7 +343,18 @@ gpa_to_hpa(struct virtio_net *dev, uint64_t gpa, uint64_t size)\n \treturn 0;\n }\n \n-struct virtio_net *get_device(int vid);\n+static __rte_always_inline struct virtio_net *\n+get_device(int vid)\n+{\n+\tstruct virtio_net *dev = vhost_devices[vid];\n+\n+\tif (unlikely(!dev)) {\n+\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\t\"(%d) device not found.\\n\", vid);\n+\t}\n+\n+\treturn dev;\n+}\n \n int vhost_new_device(void);\n void cleanup_device(struct virtio_net *dev, int destroy);\n", "prefixes": [ "dpdk-dev", "2/4" ] }{ "id": 35161, "url": "