From patchwork Fri Mar 3 05:40:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Wei W" X-Patchwork-Id: 9602047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 695A16016C for ; Fri, 3 Mar 2017 05:44:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D363285F7 for ; Fri, 3 Mar 2017 05:44:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 514C6285F8; Fri, 3 Mar 2017 05:44:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 03775285FF for ; Fri, 3 Mar 2017 05:44:40 +0000 (UTC) Received: from localhost ([::1]:56264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjg19-0001Si-31 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 03 Mar 2017 00:44:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjg0r-0001S1-D5 for qemu-devel@nongnu.org; Fri, 03 Mar 2017 00:44:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjg0q-0006Rq-HS for qemu-devel@nongnu.org; Fri, 03 Mar 2017 00:44:21 -0500 Received: from mga01.intel.com ([192.55.52.88]:50436) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cjg0q-0006Q0-8R for qemu-devel@nongnu.org; Fri, 03 Mar 2017 00:44:20 -0500 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2017 21:44:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,235,1484035200"; d="scan'208";a="71114483" Received: from devel-ww.sh.intel.com ([10.239.48.105]) by orsmga005.jf.intel.com with ESMTP; 02 Mar 2017 21:44:16 -0800 From: Wei Wang To: virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org Date: Fri, 3 Mar 2017 13:40:27 +0800 Message-Id: <1488519630-89058-3-git-send-email-wei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488519630-89058-1-git-send-email-wei.w.wang@intel.com> References: <1488519630-89058-1-git-send-email-wei.w.wang@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.88 Subject: [Qemu-devel] [PATCH v7 kernel 2/5] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER 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: Andrea Arcangeli , "Michael S . Tsirkin" , Liang Li , Dave Hansen , Liang Li , Amit Shah , Wei Wang , Cornelia Huck , Paolo Bonzini , David Hildenbrand Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Liang Li Add a new feature bit, VIRTIO_BALLOON_F_CHUNK_TRANSFER. Please check the implementation patch commit for details about this feature. Signed-off-by: Liang Li Signed-off-by: Wei Wang Cc: Michael S. Tsirkin Cc: Paolo Bonzini Cc: Cornelia Huck Cc: Amit Shah Cc: Dave Hansen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Liang Li Cc: Wei Wang --- include/uapi/linux/virtio_balloon.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index 343d7dd..ed627b2 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h @@ -34,10 +34,14 @@ #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ +#define VIRTIO_BALLOON_F_CHUNK_TRANSFER 3 /* Transfer pages in chunks */ /* Size of a PFN in the balloon interface. */ #define VIRTIO_BALLOON_PFN_SHIFT 12 +/* Shift to get a chunk size */ +#define VIRTIO_BALLOON_CHUNK_SIZE_SHIFT 12 + struct virtio_balloon_config { /* Number of pages host wants Guest to give up. */ __u32 num_pages; @@ -82,4 +86,12 @@ struct virtio_balloon_stat { __virtio64 val; } __attribute__((packed)); +/* Response header structure */ +struct virtio_balloon_resp_hdr { + u8 cmd; + u8 flag; + __le16 id; /* cmd id */ + __le32 data_len; /* Payload len in bytes */ +}; + #endif /* _LINUX_VIRTIO_BALLOON_H */