From patchwork Thu Apr 26 10:45:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 904974 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=intel.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Wtyj1hdnz9rxx for ; Thu, 26 Apr 2018 20:46:05 +1000 (AEST) Received: from localhost ([::1]:41415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBePb-00014R-A7 for incoming@patchwork.ozlabs.org; Thu, 26 Apr 2018 06:46:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBeOp-00010A-P0 for qemu-devel@nongnu.org; Thu, 26 Apr 2018 06:45:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBeOl-0000SJ-Q6 for qemu-devel@nongnu.org; Thu, 26 Apr 2018 06:45:15 -0400 Received: from mga14.intel.com ([192.55.52.115]:13329) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBeOl-0000Rt-Fj for qemu-devel@nongnu.org; Thu, 26 Apr 2018 06:45:11 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Apr 2018 03:45:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,330,1520924400"; d="scan'208";a="49278285" Received: from debian.sh.intel.com ([10.67.104.164]) by fmsmga004.fm.intel.com with ESMTP; 26 Apr 2018 03:45:08 -0700 From: Tiwei Bie To: mst@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org Date: Thu, 26 Apr 2018 18:45:51 +0800 Message-Id: <20180426104553.31034-1-tiwei.bie@intel.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.115 Subject: [Qemu-devel] [PATCH 0/2] Support host notifier in libvhost-user and vhost-user-bridge X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dan.daly@intel.com, cunming.liang@intel.com, tiwei.bie@intel.com, zhihong.wang@intel.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This patch set extends libvhost-user and vhost-user-bridge to support the host notifier [1] feature in vhost user. A new API is added for libvhost-user to support setting host notifier for each queue: /** * vu_set_queue_host_notifier: * @dev: a VuDev context * @vq: a VuVirtq queue * @fd: a file descriptor * @size: host page size * @offset: notifier offset in @fd file * * Set queue's host notifier. This function may be called several * times for the same queue. If called with -1 @fd, the notifier * is removed. */ bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *vq, int fd, int size, int offset); A new option (-H) is added for vhost-user-bridge to enable the host notifier. It's pretty simple to test: # Launch vhost-user-bridge with host notifier enabled $ make tests/vhost-user-bridge $ ./tests/vhost-user-bridge -H # Launch QEMU on another terminal $ ./x86_64-softmmu/qemu-system-x86_64 \ -smp 4 -m 1024M -cpu host -enable-kvm \ -hda "$DISK" \ -object memory-backend-file,id=mem,size=1024M,mem-path=/dev/shm,share=on \ -numa node,memdev=mem -mem-prealloc \ -chardev socket,id=char0,path=/tmp/vubr.sock \ -netdev type=vhost-user,id=net0,chardev=char0 \ -device virtio-net-pci,netdev=net0,page-per-vq=on More details can be found from the patches. Thanks! [1] http://lists.nongnu.org/archive/html/qemu-devel/2018-04/msg01779.html Tiwei Bie (2): libvhost-user: support host notifier vhost-user-bridge: support host notifier contrib/libvhost-user/libvhost-user.c | 76 ++++++++++++++++++++++++--- contrib/libvhost-user/libvhost-user.h | 31 +++++++++++ tests/vhost-user-bridge.c | 98 +++++++++++++++++++++++++++++++++-- 3 files changed, 194 insertions(+), 11 deletions(-)