DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC PATCH] avail idx update optimizations
@ 2016-04-21 17:18 Huawei Xie
       [not found] ` <C37D651A908B024F974696C65296B57B4C713327@SHSMSX101.ccr.corp.intel.com>
  2016-04-27  8:53 ` [dpdk-dev] [PATCH] virtio: avoid avail ring entry index update if equal Huawei Xie
  0 siblings, 2 replies; 9+ messages in thread
From: Huawei Xie @ 2016-04-21 17:18 UTC (permalink / raw)
  To: dev

eliminate unnecessary cache to cache transfer between virtio and vhost
core

---
 drivers/net/virtio/virtqueue.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 4e9239e..8c46a83 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -302,7 +302,8 @@ vq_update_avail_ring(struct virtqueue *vq, uint16_t desc_idx)
 	 * descriptor.
 	 */
 	avail_idx = (uint16_t)(vq->vq_avail_idx & (vq->vq_nentries - 1));
-	vq->vq_ring.avail->ring[avail_idx] = desc_idx;
+	if (unlikely(vq->vq_ring.avail->ring[avail_idx] != desc_idx))
+		vq->vq_ring.avail->ring[avail_idx] = desc_idx;
 	vq->vq_avail_idx++;
 }
 
-- 
2.4.3

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-28 13:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-21 17:18 [dpdk-dev] [RFC PATCH] avail idx update optimizations Huawei Xie
     [not found] ` <C37D651A908B024F974696C65296B57B4C713327@SHSMSX101.ccr.corp.intel.com>
2016-04-24  2:45   ` Xie, Huawei
2016-04-24  9:15     ` Michael S. Tsirkin
2016-04-24 13:23       ` Xie, Huawei
2016-04-28  9:17         ` Xie, Huawei
2016-04-27  8:53 ` [dpdk-dev] [PATCH] virtio: avoid avail ring entry index update if equal Huawei Xie
2016-04-28  6:19   ` Yuanhan Liu
2016-04-28  8:14     ` Thomas Monjalon
2016-04-28 13:15       ` Xie, Huawei

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).