From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Luyci5ay; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 9841D5A061D for ; Fri, 17 Jan 2025 19:04:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737137097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6bbqbCASyRhia8EAavw6yuMNLcEH183jKnydSLqLjiM=; b=Luyci5ay8pz9OvK5/5HTyg3lMsGuF/To0OHYogyNyDwVkHVBiSsxUZMtQD73fbb9b2+OAL A9NOLTdLpgJdHQ/WKBkiF6ov9UcOQmXc7tjdhIe4Rb6XeWy8GsQKsh/XI5OxYZZNe2FRIP cW2kcsRM7ZhqGwQmxswfSmBX6n3Thos= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-wyCy2YmOMbOc0r-13lB96A-1; Fri, 17 Jan 2025 13:04:56 -0500 X-MC-Unique: wyCy2YmOMbOc0r-13lB96A-1 X-Mimecast-MFC-AGG-ID: wyCy2YmOMbOc0r-13lB96A Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-38bf4913669so582986f8f.2 for ; Fri, 17 Jan 2025 10:04:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737137094; x=1737741894; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6bbqbCASyRhia8EAavw6yuMNLcEH183jKnydSLqLjiM=; b=SFEFvdVIau/IWMvT5mnZMD4mG7JhrSRIO1eFA2O+avMT8KuWMai8V3lwpTWzfDxd3C bMuBlLfi8Krxkc+qD/vLV6uzM0vuXYDtJhL2/djjEt+YeDpZAw6hgzhSmGeqWKRAU0Z1 Hi6aswEoh6HTxgwJ12OIChaR93Qpif9hkuoGLZj/N0FJ2OlHcrIHt5MlZUnan2HbJ5n7 goNFeupAMwWFzGDAeqK6P9Z52UvNsKovfTfLiFltOJnmvQkwFTi3L3jdpWM+/ssn5rbQ OckPQAaYRGg6AtSoSwVyvwrASoEwJAHYNQ3PWEzS1fPVIF3yY/Gp0VMC/Ums93LWL0KA WLSQ== X-Gm-Message-State: AOJu0YxpuW57OYMk4M97JiH86eD+n7EMHiRst6Vk9oL740p18dR56gKt WckYfZTQOIqcXzcWFWfvmV0YU5dBsKeNWuaKWBljUJecK0+JfGCwSugXqGTJzzhikCN33vMAqYY J/vhI93QwxKCUY2fG//FnJ/LWBlrvAdj1FX2usbk2D0YIfh2qI5ApVPGut+o7G281RSHx2QvS/O FKtoXiNsaiVDcTLlGy9FxTjKowz0D6Vfvr X-Gm-Gg: ASbGnctd6t+J3svaH3Gt6gNoyoaZcgwCCUE4VlevOwHP5zN0ipZawiXIPcxiwmXio5e v9FkFRXdCSP7ri5EZIXpvXE6pLaFw3xPg0FIV6xLmpnvRbKWqVyusNC4mr4ymv/ThXdCqyjcAzv fSGjMMzVdzyeIx24huOPOHU/8FTIuaCgyXsuxszNJ1ScQXTUVhFpDWg9OUPyqINay23I1FsUDaZ aQGhwTVJJA5ltUAd6cdxHVR6K7TpLU88gf3M8H/896TJMV9lCCQP4FYC7FqGE1gemFC X-Received: by 2002:a05:6000:1a87:b0:385:fc97:9c63 with SMTP id ffacd0b85a97d-38bf5657288mr3822356f8f.9.1737137094119; Fri, 17 Jan 2025 10:04:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6UoxKyNRE+ObOFa4Ifow/2vd7d/yGw7Ak21EGH8lenDBFkDmxef+dQkI+qrixYrxZCO/fKg== X-Received: by 2002:a05:6000:1a87:b0:385:fc97:9c63 with SMTP id ffacd0b85a97d-38bf5657288mr3822312f8f.9.1737137093695; Fri, 17 Jan 2025 10:04:53 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf3214df8sm3100024f8f.4.2025.01.17.10.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:04:52 -0800 (PST) Date: Fri, 17 Jan 2025 19:04:50 +0100 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH 2/9] vhost-user: update protocol features and commands list Message-ID: <20250117190450.1681e7ee@elisabeth> In-Reply-To: <20241219111400.2352110-3-lvivier@redhat.com> References: <20241219111400.2352110-1-lvivier@redhat.com> <20241219111400.2352110-3-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: GW3woWp9ASUMs5h4MrspfHfxKHR2z9NgcOPzuweXWgY_1737137095 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 4QU5CZI3YGBKAD6ROUVBQTCR5Z4SGKCV X-Message-ID-Hash: 4QU5CZI3YGBKAD6ROUVBQTCR5Z4SGKCV X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 19 Dec 2024 12:13:53 +0100 Laurent Vivier wrote: > vhost-user protocol specification has been updated with > feature flags and commands we will need to implement migration. > > Signed-off-by: Laurent Vivier > --- > vhost_user.c | 5 +++++ > vhost_user.h | 46 ++++++++++++++++++++++++++++++++++++++++++---- > 2 files changed, 47 insertions(+), 4 deletions(-) > > diff --git a/vhost_user.c b/vhost_user.c > index 4b8558fa851f..48226a8b7686 100644 > --- a/vhost_user.c > +++ b/vhost_user.c > @@ -110,6 +110,11 @@ static const char *vu_request_to_string(unsigned int req) > REQ(VHOST_USER_GET_MAX_MEM_SLOTS), > REQ(VHOST_USER_ADD_MEM_REG), > REQ(VHOST_USER_REM_MEM_REG), > + REQ(VHOST_USER_SET_STATUS), > + REQ(VHOST_USER_GET_STATUS), > + REQ(VHOST_USER_GET_SHARED_OBJECT), > + REQ(VHOST_USER_SET_DEVICE_STATE_FD), > + REQ(VHOST_USER_CHECK_DEVICE_STATE), > }; > #undef REQ > return vu_request_str[req]; > diff --git a/vhost_user.h b/vhost_user.h > index 464ba21e962f..fbacb5560755 100644 > --- a/vhost_user.h > +++ b/vhost_user.h > @@ -37,6 +37,10 @@ enum vhost_user_protocol_feature { > VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD = 12, > VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS = 14, > VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS = 15, > + VHOST_USER_PROTOCOL_F_STATUS = 16, > + /* Feature 17 reserved for VHOST_USER_PROTOCOL_F_XEN_MMAP. */ > + VHOST_USER_PROTOCOL_F_SHARED_OBJECT = 18, > + VHOST_USER_PROTOCOL_F_DEVICE_STATE = 19, > > VHOST_USER_PROTOCOL_F_MAX > }; > @@ -83,6 +87,11 @@ enum vhost_user_request { > VHOST_USER_GET_MAX_MEM_SLOTS = 36, > VHOST_USER_ADD_MEM_REG = 37, > VHOST_USER_REM_MEM_REG = 38, > + VHOST_USER_SET_STATUS = 39, > + VHOST_USER_GET_STATUS = 40, > + VHOST_USER_GET_SHARED_OBJECT = 41, > + VHOST_USER_SET_DEVICE_STATE_FD = 42, > + VHOST_USER_CHECK_DEVICE_STATE = 43, > VHOST_USER_MAX > }; > > @@ -128,12 +137,39 @@ struct vhost_user_memory { > struct vhost_user_memory_region regions[VHOST_MEMORY_BASELINE_NREGIONS]; > }; > > +/** > + * struct vhost_user_log - Address and size of the shared memory region used > + * to log page update > + * @mmap_size: Size of the shared memory region > + * @mmap_offset: Offset of the shared memory region > + */ > +struct vhost_user_log { > + uint64_t mmap_size; > + uint64_t mmap_offset; > +}; > + > +/** > + * struct vhost_user_transfer_device_state - Set the direction and phase > + * of the backend device state fd > + * @direction: Device state transfer direction (save or load) > + * @phase: Migration phase (only stopped is supported) > + */ > +struct vhost_user_transfer_device_state { > + uint32_t direction; > +#define VHOST_USER_TRANSFER_STATE_DIRECTION_SAVE 0 > +#define VHOST_USER_TRANSFER_STATE_DIRECTION_LOAD 1 > + uint32_t phase; > +#define VHOST_USER_TRANSFER_STATE_PHASE_STOPPED 0 > +}; > + > /** > * union vhost_user_payload - vhost-user message payload > - * @u64: 64-bit payload > - * @state: vring state payload > - * @addr: vring addresses payload > - * vhost_user_memory: Memory regions information payload > + * @u64: 64-bit payload > + * @state: vring state payload > + * @addr: vring addresses payload > + * @vhost_user_memory: Memory regions information payload > + * @vhost_user_log: Memory logging payload > + * @vhost_user_transfer_device_state: Device state payload Nit: these are called 'memory', 'log', and 'transfer_state'. > */ > union vhost_user_payload { > #define VHOST_USER_VRING_IDX_MASK 0xff > @@ -142,6 +178,8 @@ union vhost_user_payload { > struct vhost_vring_state state; > struct vhost_vring_addr addr; > struct vhost_user_memory memory; > + struct vhost_user_log log; > + struct vhost_user_transfer_device_state transfer_state; > }; > > /** -- Stefano