From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.5 Received: by atuin.qyliss.net (Postfix, from userid 496) id 52EA836AF; Thu, 13 May 2021 00:51:12 +0000 (UTC) Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 0A9C235A4; Thu, 13 May 2021 00:50:24 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id A619A143AE; Wed, 12 May 2021 17:08:49 +0000 (UTC) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by atuin.qyliss.net (Postfix) with ESMTPS id 590DF143A3 for ; Wed, 12 May 2021 17:08:44 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 3CE45134A for ; Wed, 12 May 2021 13:08:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 12 May 2021 13:08:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=tAO081Z9ZDejC ronkddIfZNXX6mZ4QzAL9YoDT+Itlw=; b=keuMG++E0rxmpjjY2XG+9X6hGO6Mv pxaFZ518rw2DX4TqZ07Rdbk9xNmkPNPfAftUbMtzpkT9QIUQ5SHdhoVBVqWaNfxk DJV9G9otD0oiUV+kDew9cAUL/1fSMtgsT5MDd+cB/qeYLCrEAwmYuyNck94d+Qu+ 739DJXpuqBVQ79EMqzD0nV4vjVETWY2M+KYX3xeiNTvHFVHqXSgbFAtL+R5EjoJF rW8MXkzFVi+40f4EpFJ3o25bQHAsgqv5WEBa4Zru3phc0WhNOM5iw4sFonwoNFLI JGMyfO1g4lJboX98n7vrjrqLf8GfRqFA39y2z+1g5noEgYYbcMuhEol1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=tAO081Z9ZDejCronkddIfZNXX6mZ4QzAL9YoDT+Itlw=; b=IViwqUnn R8dDDUqAja9zjIU+iSphT1/CSmSnjdWTcqR+p0lgZ3Mt/StGI5lC2f5/tOmOhNjM Xgou7fxKgfef2I97C1HtBCDkKaoQhBOKDWvu5rwhWeFjvzAc0W9glnRxOkSvx6Pg +cKy+wDdYFOn/0NsKSj7Yo7W9dJXxKRcB3lyhRDCnQlqoyXHOCunaKIELKloXC4A qg9fSc+VexgC4A5uYCS/5dxFgn/v6aMDY6620rX2IxCpehEclkZtwt55yA4V9MM7 zS0mz51raKnts2gmb3M6+ZVuIaeWJIv4VFIEwwcCTOLX3lXOdvbSeRgS7ykGG9tZ YWWsW67OgDiDBA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehvddguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdr ihhsqeenucggtffrrghtthgvrhhnpefgfedukedvleeileeludefveehgeelgfegvdduje dvtdffueeuveffheeljeekvdenucfkphepkeegrddukeegrddvvdeirdekudenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehqhihlihhsshesvg hvvgdrqhihlhhishhsrdhnvght X-ME-Proxy: Received: from eve.qyliss.net (p54b8e251.dip0.t-ipconnect.de [84.184.226.81]) by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 12 May 2021 13:08:38 -0400 (EDT) Received: by eve.qyliss.net (Postfix, from userid 1000) id 3BEB7103A; Wed, 12 May 2021 17:08:36 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [RFC PATCH 2/4] vhost_rs: vhost_user: Add missing protocol features Date: Wed, 12 May 2021 17:08:10 +0000 Message-Id: <20210512170812.192540-3-hi@alyssa.is> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210512170812.192540-1-hi@alyssa.is> References: <20210512170812.192540-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: HDUDGS3NTQLU66MICTQFKQPSU2YQXUCM X-Message-ID-Hash: HDUDGS3NTQLU66MICTQFKQPSU2YQXUCM X-MailFrom: qyliss@eve.qyliss.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.4 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Based on cloud-hypervisor/vhost c3a835b55dc56aa0de04a9c0695368a6403e8e93. > vhost_user: Add missing protocol features > > The spec recently introduced some new protocol features, which we need > to be listed if we don't want to run into any issue when getting the > list of supported features from the backend. --- devices/src/virtio/vhost_user/net.rs | 10 +++++++--- vhost_rs/src/vhost_user/message.rs | 11 +++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/devices/src/virtio/vhost_user/net.rs b/devices/src/virtio/vhost_user/net.rs index 4d222d22..f2a3d79c 100644 --- a/devices/src/virtio/vhost_user/net.rs +++ b/devices/src/virtio/vhost_user/net.rs @@ -20,8 +20,8 @@ use super::handler::*; use super::vu_common_ctrl::*; use super::{Error, Result}; use crate::{pci::MsixConfig, virtio::Interrupt}; -use vhost_rs::vhost_user::message::VhostUserVirtioFeatures; -use vhost_rs::vhost_user::{Master, VhostUserMaster}; +use vhost_rs::vhost_user::message::{VhostUserProtocolFeatures, VhostUserVirtioFeatures}; +use vhost_rs::vhost_user::{Master, VhostUserMaster, VhostUserMasterReqHandler}; use vhost_rs::VhostBackend; use virtio_bindings::virtio_net; use virtio_bindings::virtio_ring; @@ -78,9 +78,13 @@ impl<'a> Net { let mut acked_features = 0; if backend_features & VhostUserVirtioFeatures::PROTOCOL_FEATURES.bits() != 0 { acked_features |= VhostUserVirtioFeatures::PROTOCOL_FEATURES.bits(); - vhost_user_net + let mut protocol_features = vhost_user_net .get_protocol_features() .map_err(Error::VhostUserGetProtocolFeatures)?; + protocol_features &= VhostUserProtocolFeatures::MQ; + vhost_user_net + .set_protocol_features(protocol_features) + .map_err(Error::VhostUserSetProtocolFeatures); } else { return Err(Error::VhostUserProtocolNotSupport); } diff --git a/vhost_rs/src/vhost_user/message.rs b/vhost_rs/src/vhost_user/message.rs index 834397f4..b3ed27a5 100644 --- a/vhost_rs/src/vhost_user/message.rs +++ b/vhost_rs/src/vhost_user/message.rs @@ -346,6 +346,17 @@ bitflags! { const SLAVE_SEND_FD = 0x0000_0400; /// Allow the slave to register a host notifier. const HOST_NOTIFIER = 0x0000_0800; + /// Support inflight shmfd. + const INFLIGHT_SHMFD = 0x0000_1000; + /// Support resetting the device. + const RESET_DEVICE = 0x0000_2000; + /// Support inband notifications. + const INBAND_NOTIFICATIONS = 0x0000_4000; + /// Support configuring memory slots. + const CONFIGURE_MEM_SLOTS = 0x0000_8000; + /// Support reporting status. + const STATUS = 0x0001_0000; + } } -- 2.31.0