DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: notify guest to fill buffer when there is no buffer
@ 2015-01-29 10:30 linhaifeng
  2015-01-29 10:39 ` Xie, Huawei
  0 siblings, 1 reply; 15+ messages in thread
From: linhaifeng @ 2015-01-29 10:30 UTC (permalink / raw)
  To: dev

From: Linhaifeng <haifeng.lin@huawei.com>

If we found there is no buffer we should notify virtio_net to
fill buffers.

We use mz send buffers from VM to VM,found that the other VM
stop to receive data after many hours.

Signed-off-by: Linhaifeng <haifeng.lin@huawei.com>
---
 lib/librte_vhost/vhost_rxtx.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c
index ccfd82f..013c526 100644
--- a/lib/librte_vhost/vhost_rxtx.c
+++ b/lib/librte_vhost/vhost_rxtx.c
@@ -87,9 +87,14 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
 		/*check that we have enough buffers*/
 		if (unlikely(count > free_entries))
 			count = free_entries;
-
-		if (count == 0)
+		/* If there is no buffers we should notify guest to fill. 
+		* This is need when guest use virtio_net driver(not pmd).
+		*/
+		if (count == 0) {
+			if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
+				eventfd_write((int)vq->kickfd, 1);	
 			return 0;
+		}
 
 		res_end_idx = res_base_idx + count;
 		/* vq->last_used_idx_res is atomically updated. */
-- 
1.9.0

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

end of thread, other threads:[~2015-02-09  4:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 10:30 [dpdk-dev] [PATCH] vhost: notify guest to fill buffer when there is no buffer linhaifeng
2015-01-29 10:39 ` Xie, Huawei
2015-01-29 12:39   ` Linhaifeng
2015-01-29 13:00     ` Xie, Huawei
2015-01-29 13:50       ` Linhaifeng
2015-01-30  8:20         ` Xu, Qian Q
2015-01-30 10:33           ` Linhaifeng
2015-02-01  6:04           ` Linhaifeng
     [not found]             ` <82F45D86ADE5454A95A89742C8D1410E01CA1DA3@shsmsx102.ccr.corp.intel.com>
     [not found]               ` <54CF6BB3.7080002@huawei.com>
     [not found]                 ` <C37D651A908B024F974696C65296B57B0F37C3F7@SHSMSX101.ccr.corp.intel.com>
     [not found]                   ` <54D08AFA.2030404@huawei.com>
     [not found]                     ` <82F45D86ADE5454A95A89742C8D1410E01CA3197@shsmsx102.ccr.corp.intel.com>
     [not found]                       ` <54D0926D.9010304@huawei.com>
2015-02-04  1:38                         ` Xu, Qian Q
2015-02-06  4:02                           ` Linhaifeng
2015-02-06  5:54                             ` Xu, Qian Q
2015-02-06 11:02                               ` Linhaifeng
2015-02-07  4:26                               ` Linhaifeng
2015-02-09  2:57                                 ` Xu, Qian Q
2015-02-09  4:11                                   ` Linhaifeng

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