From nobody Fri Nov 7 14:33:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548095036742902.6873452278691; Mon, 21 Jan 2019 10:23:56 -0800 (PST) Received: from localhost ([127.0.0.1]:57587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gleEl-0001Fy-Jq for importer@patchew.org; Mon, 21 Jan 2019 13:23:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gldy2-0004HR-RL for qemu-devel@nongnu.org; Mon, 21 Jan 2019 13:06:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gldy1-00043E-H1 for qemu-devel@nongnu.org; Mon, 21 Jan 2019 13:06:38 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:43998) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gldxz-0003z5-Kv for qemu-devel@nongnu.org; Mon, 21 Jan 2019 13:06:35 -0500 Received: by mail-wr1-x42d.google.com with SMTP id r10so24428413wrs.10 for ; Mon, 21 Jan 2019 10:06:34 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 133sm56197732wme.9.2019.01.21.10.06.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jan 2019 10:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5rrzvUkpuCnqMHM9DLoYJ4yP3OmI6m5/oEvaZDvNdUg=; b=TlmTrLIxLrBfeIrk0GDBqcR+1Jm3q5i76A4W3DPhz+5cTHRPSp7nHCQqN6PUcWTPmz cM0aqzkB4ccYg3jW9/PkCopSlNDboBiP/ukgAU1/TpNNTP6/a/LZmLaAz/Sd7vCFpsy6 CbeeuVleCpDM4tPCm4VHeRqpPE5Jq/F6DPmna02C2wJSOIv7s/nc/pd4USzIZ6AQQRAi g6m94JGTOojeXNUvp26ZtQWglDQAGWbPNSWuNfzsFUx9ykf5sMYIlBp1P0j8fatru8It wsNBTa/tuE17EdD+f/7+sN1Nvsq0j3KXW8VSBFNMu4cgQpyHjSHIBsKmQ60zjaNdzPaY si5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5rrzvUkpuCnqMHM9DLoYJ4yP3OmI6m5/oEvaZDvNdUg=; b=f2QdEE7KJuwB6XsXpRweo+a6bb4JNF9QhsgMN24hHesay253hbEaliWFyMNFDzUm1G 6f7VhH0Yz5/c8i/AAZ5Ldt0fNq6BquDhgcAkXPqqIY+YHhSIhEEwy7z2xUApD5K7c/bT S5b76+ZgE7w9WL03zte9PGMBXqxsZRVx54Du2FXvTqKnPdPZjbBPInJsnmTNxzE4CwuO VahxBfbP8bdtzRp0tiO+8f72H6iotX7gWWvpv77+9hbQWoHLKTuGgPx8zgQlz961dgQv C0m3LQItE+/2mwy+HfYx3un7YrRO9C3h81/nnAz68p2n+0Aqo+1/IXXhxOC1xtTRJXp3 EIEg== X-Gm-Message-State: AJcUukebiWi890en6T1GqDVKSnPiaYPnh3tl7A40e32jESqLZ+DX70YN Ub4I0uEovILPHQPDvaCWgvnVlGG+ X-Google-Smtp-Source: ALg8bN7yWf5FvBXiEP/3e40sCUdeVsYXknG7dIOA4sUQ26A1We6RoCVQbi6xGrPvfD4wdmZ/yF9FEw== X-Received: by 2002:a5d:418b:: with SMTP id m11mr27015170wrp.8.1548093992827; Mon, 21 Jan 2019 10:06:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 21 Jan 2019 19:05:41 +0100 Message-Id: <1548093980-43088-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1548093980-43088-1-git-send-email-pbonzini@redhat.com> References: <1548093980-43088-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d Subject: [Qemu-devel] [PULL 10/49] vhost-user: support cross-endian vnet headers 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) vhost-user already has a way to communicate the endianness of the guest via the vring endianness messages. The vring endianness always matches the vnet header endianness so there is no need to do anything else in the backend. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini Message-Id: <1543851204-41186-9-git-send-email-pbonzini@redhat.com> --- net/vhost-user.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/net/vhost-user.c b/net/vhost-user.c index a39f9c9..cd9659d 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -172,6 +172,17 @@ static void net_vhost_user_cleanup(NetClientState *nc) qemu_purge_queued_packets(nc); } =20 +static int vhost_user_set_vnet_endianness(NetClientState *nc, + bool enable) +{ + /* Nothing to do. If the server supports + * VHOST_USER_PROTOCOL_F_CROSS_ENDIAN, it will get the + * vnet header endianness from there. If it doesn't, negotiation + * fails. + */ + return 0; +} + static bool vhost_user_has_vnet_hdr(NetClientState *nc) { assert(nc->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_USER); @@ -193,6 +204,8 @@ static NetClientInfo net_vhost_user_info =3D { .cleanup =3D net_vhost_user_cleanup, .has_vnet_hdr =3D vhost_user_has_vnet_hdr, .has_ufo =3D vhost_user_has_ufo, + .set_vnet_be =3D vhost_user_set_vnet_endianness, + .set_vnet_le =3D vhost_user_set_vnet_endianness, }; =20 static gboolean net_vhost_user_watch(GIOChannel *chan, GIOCondition cond, --=20 1.8.3.1