DPDK patches and discussions
 help / color / mirror / Atom feed
From: Huawei Xie <huawei.xie@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 12/14] add branch hint
Date: Mon, 20 Oct 2014 12:38:24 +0800	[thread overview]
Message-ID: <1413779906-28113-13-git-send-email-huawei.xie@intel.com> (raw)
In-Reply-To: <1413779906-28113-1-git-send-email-huawei.xie@intel.com>

add branch hint

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
---
 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

  parent reply	other threads:[~2014-10-20  4:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20  4:38 [dpdk-dev] [PATCH 00/14] new vhost example Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 01/14] copy old " Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 02/14] remove virtio_dev_rx, virtio_dev_merge_rx, copy_from_mbuf_to_ring, virtio_dev_tx, virtio_dev_merge_tx Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 03/14] add bak two hpa region functions Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 04/14] dev->vdev Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 05/14] hpa region Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 06/14] enqueue_burst, dequeue_burst, mac learning Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 07/14] patch virtio_tx_route Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 08/14] remove gpa_to_vva, base_index Huawei Xie
2014-10-23  9:43   ` Thomas Monjalon
2014-10-20  4:38 ` [dpdk-dev] [PATCH 09/14] other APIs Huawei Xie
2014-10-23  9:44   ` Thomas Monjalon
2014-10-20  4:38 ` [dpdk-dev] [PATCH 10/14] vmdq_rx_q Huawei Xie
2014-10-23  9:45   ` Thomas Monjalon
2014-10-20  4:38 ` [dpdk-dev] [PATCH 11/14] minor fixes Huawei Xie
2014-10-20  4:38 ` Huawei Xie [this message]
2014-10-20  4:38 ` [dpdk-dev] [PATCH 13/14] INC_VEC Huawei Xie
2014-10-20  4:38 ` [dpdk-dev] [PATCH 14/14] Makefile Huawei Xie
2014-10-23  9:48   ` Thomas Monjalon
2014-10-20  5:21 ` [dpdk-dev] [PATCH 00/14] new vhost example Ouyang, Changchun
2014-10-23 11:10 ` Thomas Monjalon
2014-10-23 16:17   ` Xie, Huawei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1413779906-28113-13-git-send-email-huawei.xie@intel.com \
    --to=huawei.xie@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).