From f94be73dc9da4793c6412b674c9bc4aea5da75f3 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Tue, 6 Aug 2019 10:11:46 +0200 Subject: [PATCH] vhost: explicitly set VRING_USED_F_NO_NOTIFY We used to call a dpdk function to do it, but using a function for something that simple doesn't make sense. The function also does its internal queue lookup by vid and queue number, which could potentially fail, return an error and technically require SPDK to handle it. The function makes some sense for vhost-net applications which don't touch vrings directly but rely on rte_vhost's API for enqueueing/dequeuing mbufs. SPDK touches DPDK's rings directly for the entire I/O handling, so it might just as well for initialization. This serves as cleanup. Change-Id: Ifb44fa22ea5fc3633aa85f075aa1a5cd02f5423c Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466745 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- lib/vhost/vhost.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 415d532fe..366c1282e 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -1195,12 +1195,8 @@ start_device(int vid) continue; } - /* Disable notifications. */ - if (rte_vhost_enable_guest_notification(vid, i, 0) != 0) { - SPDK_ERRLOG("vhost device %d: Failed to disable guest notification on queue %"PRIu16"\n", vid, i); - goto out; - } - + /* Disable I/O submission notifications, we'll be polling. */ + q->vring.used->flags = VRING_USED_F_NO_NOTIFY; vsession->max_queues = i + 1; }