From nobody Mon Feb 9 16:34:32 2026 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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549305866319931.5012348040696; Mon, 4 Feb 2019 10:44:26 -0800 (PST) Received: from localhost ([127.0.0.1]:47358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqjEC-0002mo-32 for importer@patchew.org; Mon, 04 Feb 2019 13:44:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqj6p-00050T-Mi for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqj6n-0003S1-Q5 for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:43 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:41797) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqj6l-0003H8-TL for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:41 -0500 Received: by mail-wr1-x433.google.com with SMTP id x10so940202wrs.8 for ; Mon, 04 Feb 2019 10:36:24 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s132sm8836236wmf.28.2019.02.04.10.36.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:36:22 -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=FaxaRT+r4MRj4HTWujm41vURhOYiUy6eHc4zHeQ5fIdGDkol/GqCKaiT+AEpPFXcQC CIz0PSQDjMzVBgO5EDJGNj97CSV6R/M/mtv0ySwMo7VJEKFV5pdFrd08ROXm73+sH4/x UQnIbQhkgTpCms0bxSve8+0FihCODgoOqky+xEw78SMaed96viWgqK+jJ0/WV/CssVkz 6Z5ohAt6ot37PrEI0z5i75s74cYZSH2ikX4sMNTFPX4FxvEutq4n0jOAS83DTZrN5Q5M TAdxa2DDvVtcjSDElsztwqiJePwi9vqvzo/GCuSjWU/lzWM8WF05mc6b03aCe6l73ekd ejiQ== 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=SF2xivNes5ctIKo3PoJ66LcO7cvwmhWv1X7PXQwv+YbgIKITis4L8woP1as7TMKoiB LvnYi5Ka/D+yfimmXCsSR6Zx9JwEx05MExS8y5biIckwsYcNWcYkbD5roQkjHjGQyXXH VAzmTJNGoOhMdWtt5F/ZtKn4MbNwmMBQANQ4eGOIc0K3LX0x0zAX6PJXI3+ii2Y8e16i dT6F+XwVLhIHHP5Uv50w1gHjXZECbZ4YdVSaVbR51gq2KOw8k5yo2yaqtlvl7GI8XVTP JbjF281IQdNy0+ryga14yMShs8X49kVyzGNmDpNNIzJVMDBTJNGV8qaxAWb9guq9SNCB 7Iyw== X-Gm-Message-State: AHQUAuZ1rQVJ541n55UfCr+RiWtNjaOvYYCSAEcF8iLbAUq1p4bqEfHC kuNmbTTzNejnyFGA0h12vNNJPz45 X-Google-Smtp-Source: AHgI3IYJpVy1priL9PrH3oq2crdZJ8m1C1+N9fBjM4cWsnWz/kgzWRZZM0jFXeFN7w+EsHPx5iFi5Q== X-Received: by 2002:a5d:45d0:: with SMTP id b16mr570461wrs.86.1549305383493; Mon, 04 Feb 2019 10:36:23 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2019 19:35:05 +0100 Message-Id: <1549305379-51117-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> References: <1549305379-51117-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::433 Subject: [Qemu-devel] [PULL 03/77] 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