From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 97AE33DE for ; Mon, 20 Oct 2014 06:31:07 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 19 Oct 2014 21:32:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,749,1406617200"; d="scan'208";a="592145323" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 19 Oct 2014 21:39:16 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id s9K4dEx3004266; Mon, 20 Oct 2014 12:39:14 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s9K4dBHF028232; Mon, 20 Oct 2014 12:39:13 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id s9K4dBXP028228; Mon, 20 Oct 2014 12:39:11 +0800 From: Huawei Xie To: dev@dpdk.org Date: Mon, 20 Oct 2014 12:38:24 +0800 Message-Id: <1413779906-28113-13-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1413779906-28113-1-git-send-email-huawei.xie@intel.com> References: <1413779906-28113-1-git-send-email-huawei.xie@intel.com> Subject: [dpdk-dev] [PATCH 12/14] add branch hint X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 04:31:08 -0000 add branch hint Signed-off-by: Huawei Xie --- examples/vhost/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index b2b92e9..fb22df4 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1012,7 +1012,7 @@ virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m) LOG_DEBUG(VHOST_DATA, "(%"PRIu64") TX: MAC address is local\n", tdev->device_fh); - if (dev_ll->vdev->remove) { + if (unlikely(dev_ll->vdev->remove)) { /*drop the packet if the device is marked for removal*/ LOG_DEBUG(VHOST_DATA, "(%"PRIu64") Device is marked for removal\n", tdev->device_fh); } else { @@ -1210,7 +1210,7 @@ switch_worker(__attribute__((unused)) void *arg) vdev = dev_ll->vdev; dev = vdev->dev; - if (vdev->remove) { + if (unlikely(vdev->remove)) { dev_ll = dev_ll->next; unlink_vmdq(vdev); vdev->ready = DEVICE_SAFE_REMOVE; @@ -1249,7 +1249,7 @@ switch_worker(__attribute__((unused)) void *arg) } } - if (!vdev->remove) { + if (likely(!vdev->remove)) { /* Handle guest TX*/ tx_count = rte_vhost_dequeue_burst(dev, VIRTIO_TXQ, mbuf_pool, pkts_burst, MAX_PKT_BURST); /* If this is the first received packet we need to learn the MAC and setup VMDQ */ -- 1.8.1.4