From nobody Thu Jun 13 09:56:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666184746; cv=none; d=zohomail.com; s=zohoarc; b=d9issV0CmVJ/n4r0yBjMzUuccHVK61ioteblfn36vc6qQCdC3vpxUXAuJSwiP0yatJrrXRe6nPMBnkkBRvTfktTMu4cv8l7v7u2wwvt3EW+JBLOGxCbbWunkIB4yC0mS6jcC/sJZSuuuKyM61MkHoN6rpy2I527q4hz67xdm8wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666184746; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HQqvvXt2mnDRPwk4MtdkOd7P1aVjVbus7fcouF/Xkqk=; b=XVHfgqS1DHp6zVA9yZYVCnwlDRKIbBpXE7Y3mf+aKcjmC7xgcU2aT+eETRbDw0o1OhDkdHHCU1Q2ZklVMN4Ks23AmpZu/mOGKWC0djLDjZvw/baDGZFvIQgNna9jrtoBZ8TJBQpd7tzchPqNXUIGMEIX6+ys/rrgLdP7f0iCBBk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666184746203347.7560787382449; Wed, 19 Oct 2022 06:05:46 -0700 (PDT) Received: from localhost ([::1]:40162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol8lF-00033X-P4 for importer@patchew.org; Wed, 19 Oct 2022 09:05:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yj-00069W-UH for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yh-0002H9-4j for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:32 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-343-lK_47yIgOyeIbFsMlW1N5A-1; Wed, 19 Oct 2022 08:52:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 81C9385A59D; Wed, 19 Oct 2022 12:52:20 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2936D4081B60; Wed, 19 Oct 2022 12:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666183950; 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=HQqvvXt2mnDRPwk4MtdkOd7P1aVjVbus7fcouF/Xkqk=; b=PUfhklVD88cJrWUFiKhKVUJbG+os4b63jnzv6bwZ6Y10o38/puBi3WtVOpVjVqP0Glqpyi ZEIKYT/OzQlKSxGZYrYS85lXxM1iUfPXJ4BwleMB4GLt8OWXUMAO/5gqEvJdmHlu90Fx1+ Pbn95bZx40pFUFk2XN4gfs9MFvrIDqo= X-MC-Unique: lK_47yIgOyeIbFsMlW1N5A-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Zhu Lingshan , Harpreet Singh Anand , Stefano Garzarella , Si-Wei Liu , Jason Wang , "Michael S. Tsirkin" , Cindy Lu , Laurent Vivier , Eli Cohen , Liuxiangdong , Parav Pandit , Gautam Dawar Subject: [RFC PATCH v2 1/8] vdpa: Delete duplicated vdpa_feature_bits entry Date: Wed, 19 Oct 2022 14:52:03 +0200 Message-Id: <20221019125210.226291-2-eperezma@redhat.com> In-Reply-To: <20221019125210.226291-1-eperezma@redhat.com> References: <20221019125210.226291-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.256, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666184748452100001 This entry was duplicated on referenced commit. Removing it. Fixes: 402378407dbd ("vhost-vdpa: multiqueue support") Signed-off-by: Eugenio P=C3=A9rez Acked-by: Jason Wang --- net/vhost-vdpa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 4bc3fd01a8..eebf29f5c1 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -63,7 +63,6 @@ const int vdpa_feature_bits[] =3D { VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_RX_EXTRA, VIRTIO_NET_F_CTRL_VLAN, - VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_CTRL_MAC_ADDR, VIRTIO_NET_F_RSS, VIRTIO_NET_F_MQ, --=20 2.31.1 From nobody Thu Jun 13 09:56:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666186152; cv=none; d=zohomail.com; s=zohoarc; b=oA5BSR/3zaSKCX95yPJNpAPy2VmLNZU75mj0lbi0j5Dye2ies6rTSLkKA8Uf0ZaXZadDwkx6nIeykiaylW3AEfKchxctYigSFCGnUEW4756DXsR2MP9n4OVhLguWdUMoBYXeI0uqUoGHp+4tFTBRdSpH0awtp31L8KIj2qyPRYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666186152; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ab7dW9paGVspfEgQ6PmFdF3QH0gPQPtXGHDenD+bubo=; b=HFe92pn32dPRKEar+FwBzR76nTxOirY17iAP69P9Mg1+IPBLDh8uXRsHKNbcUAfyKg372YuJTO3hdMLwcuCW85ZhI0kSVJZw6oLOM34VIzAKb5ovdoXwZpN4EawXva0c2kO5cY5r1vUPgcplIJSZ5I0lY1bDF2EzYBXj+kXXr5c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666186152356304.7905023988005; Wed, 19 Oct 2022 06:29:12 -0700 (PDT) Received: from localhost ([::1]:60800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol98A-0004as-FW for importer@patchew.org; Wed, 19 Oct 2022 09:29:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yh-00060M-JC for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Ye-0002Gr-QQ for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:31 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-187-WuMrbfaCN9ihBMX2NbPr0A-1; Wed, 19 Oct 2022 08:52:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2DA192932480; Wed, 19 Oct 2022 12:52:23 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCFFC4081B60; Wed, 19 Oct 2022 12:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666183948; 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=ab7dW9paGVspfEgQ6PmFdF3QH0gPQPtXGHDenD+bubo=; b=hWBRai7ou2ATqrk7RfF8lDDVehQgzqyxM+9q7DqBxDLMZsYh+HXPmqy/VqMRpUxtDLs8oq ZXImmlODW0838pZnTdXod9120/i1t4oBA82mjoqg+8gGwfUBvPsHm/lQMwCphwUMjxGgiC 8eDqJjTqac5L1uyuK7Jf4BeKmgGMqWg= X-MC-Unique: WuMrbfaCN9ihBMX2NbPr0A-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Zhu Lingshan , Harpreet Singh Anand , Stefano Garzarella , Si-Wei Liu , Jason Wang , "Michael S. Tsirkin" , Cindy Lu , Laurent Vivier , Eli Cohen , Liuxiangdong , Parav Pandit , Gautam Dawar Subject: [RFC PATCH v2 2/8] vdpa: Save emulated features list in vhost_vdpa Date: Wed, 19 Oct 2022 14:52:04 +0200 Message-Id: <20221019125210.226291-3-eperezma@redhat.com> In-Reply-To: <20221019125210.226291-1-eperezma@redhat.com> References: <20221019125210.226291-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.256, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666186153731100001 At this moment only _F_LOG is added there. However future patches add features that depend on the kind of device. In particular, only net devices can add VIRTIO_F_GUEST_ANNOUNCE. So let's allow vhost_vdpa creator to set custom emulated device features. Signed-off-by: Eugenio P=C3=A9rez --- include/hw/virtio/vhost-vdpa.h | 2 ++ hw/virtio/vhost-vdpa.c | 8 ++++---- net/vhost-vdpa.c | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h index 1111d85643..50083e1e3b 100644 --- a/include/hw/virtio/vhost-vdpa.h +++ b/include/hw/virtio/vhost-vdpa.h @@ -31,6 +31,8 @@ typedef struct vhost_vdpa { bool iotlb_batch_begin_sent; MemoryListener listener; struct vhost_vdpa_iova_range iova_range; + /* VirtIO device features that can be emulated by qemu */ + uint64_t added_features; uint64_t acked_features; bool shadow_vqs_enabled; /* IOVA mapping used by the Shadow Virtqueue */ diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 7468e44b87..ddb5e29288 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -660,8 +660,8 @@ static int vhost_vdpa_set_features(struct vhost_dev *de= v, =20 v->acked_features =3D features; =20 - /* We must not ack _F_LOG if SVQ is enabled */ - features &=3D ~BIT_ULL(VHOST_F_LOG_ALL); + /* Do not ack features emulated by qemu */ + features &=3D ~v->added_features; } =20 trace_vhost_vdpa_set_features(dev, features); @@ -1244,8 +1244,8 @@ static int vhost_vdpa_get_features(struct vhost_dev *= dev, int ret =3D vhost_vdpa_get_dev_features(dev, features); =20 if (ret =3D=3D 0 && v->shadow_vqs_enabled) { - /* Add SVQ logging capabilities */ - *features |=3D BIT_ULL(VHOST_F_LOG_ALL); + /* Add emulated capabilities */ + *features |=3D v->added_features; } =20 return ret; diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index eebf29f5c1..3803452800 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -599,6 +599,10 @@ static NetClientState *net_vhost_vdpa_init(NetClientSt= ate *peer, s->vhost_vdpa.index =3D queue_pair_index; s->vhost_vdpa.shadow_vqs_enabled =3D svq; s->vhost_vdpa.iova_tree =3D iova_tree; + if (svq) { + /* Add SVQ logging capabilities */ + s->vhost_vdpa.added_features |=3D BIT_ULL(VHOST_F_LOG_ALL); + } if (!is_datapath) { s->cvq_cmd_out_buffer =3D qemu_memalign(qemu_real_host_page_size(), vhost_vdpa_net_cvq_cmd_page_le= n()); --=20 2.31.1 From nobody Thu Jun 13 09:56:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666184658; cv=none; d=zohomail.com; s=zohoarc; b=aCtSqWmq4/8LeOydHs4MRJUGWFI1RKB2dlbWA8dgcrv5Rjd0DB3d207ifu73BM5Fj4xsXbloJ/3yWshuhDdcVlrRCNyrsawCb+yTEGs2lf3rfJ/ZHxeWnIfmpb6NoIjKA5Ipv66Exiwx97We8LA/2CSspl05fw8nF1aBnEGLG8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666184658; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7QrYOKz2aeFipRQ6UbtRS6WhcLuSCDEKhE969yrivaY=; b=CLKXtIB5OpVdYmzNxWO/JbPp3YpWJ2yRA61WeEdhxdABsZGOKmALAaGL/ACeZinofEyloJHPxzI3l55ueUyi2q3Yv7uTQkcauet22jmxzD8k35xq31G4wzncqu262tcO/krriDjxU9IIhySZomkUsvE5xMD7FH/e6X+uM8IL+Z4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666184658826697.7189485436963; Wed, 19 Oct 2022 06:04:18 -0700 (PDT) Received: from localhost ([::1]:36148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol8k4-0002S7-Dv for importer@patchew.org; Wed, 19 Oct 2022 09:04:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yj-00068g-NU for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yg-0002H5-Ra for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:33 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-194-uyE7YLjFOsqusc_46M0cXg-1; Wed, 19 Oct 2022 08:52:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4CC8185A7AD; Wed, 19 Oct 2022 12:52:25 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 757714081B60; Wed, 19 Oct 2022 12:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666183950; 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=7QrYOKz2aeFipRQ6UbtRS6WhcLuSCDEKhE969yrivaY=; b=fdM4DFAa/Rq2nqHiIWX0clPYX1yeip6lwH1ZRjjvNDQ9AkLIkQiNbxemk2Rv7kGwtab9WY krHRE1cAuYMqMQ0VSxufd8000Lbp42HnAK/YDqCybuWerZI/0x2ydR4FPekOys9WnUChi6 GnNTlBiUad51C8MuAipNSHXJ41zSS6w= X-MC-Unique: uyE7YLjFOsqusc_46M0cXg-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Zhu Lingshan , Harpreet Singh Anand , Stefano Garzarella , Si-Wei Liu , Jason Wang , "Michael S. Tsirkin" , Cindy Lu , Laurent Vivier , Eli Cohen , Liuxiangdong , Parav Pandit , Gautam Dawar Subject: [RFC PATCH v2 3/8] vhost_net: Emulate link state up if backend doesn't expose it Date: Wed, 19 Oct 2022 14:52:05 +0200 Message-Id: <20221019125210.226291-4-eperezma@redhat.com> In-Reply-To: <20221019125210.226291-1-eperezma@redhat.com> References: <20221019125210.226291-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.256, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666184660827100003 At this moment this code path is not reached, but vdpa devices can offer VIRTIO_NET_F_STATUS unconditionally. While the guest must assume that link is always up by the standard, qemu will set the status bit to 1 always in this case. This makes little use by itself, but VIRTIO_NET_F_STATUS is needed for the guest to read status bit VIRTIO_NET_F_GUEST_ANNOUNCE, used by feature VIRTIO_NET_F_GUEST_ANNOUNCE. So qemu must emulate status feature in case it needs to emulate the guest announce feature. Signed-off-by: Eugenio P=C3=A9rez --- hw/net/vhost_net.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index d28f8b974b..5660606c1d 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -117,7 +117,32 @@ uint64_t vhost_net_get_features(struct vhost_net *net,= uint64_t features) int vhost_net_get_config(struct vhost_net *net, uint8_t *config, uint32_t config_len) { - return vhost_dev_get_config(&net->dev, config, config_len, NULL); + VirtIODevice *vdev; + int r =3D vhost_dev_get_config(&net->dev, config, config_len, NULL); + + if (unlikely(r !=3D 0)) { + return r; + } + + if (config_len < endof(struct virtio_net_config, status)) { + return 0; + } + + /* + * TODO: Perform this only if vhost_vdpa. + */ + vdev =3D net->dev.vdev; + if (!vdev) { + /* Device is starting */ + return 0; + } + + if ((net->dev.acked_features & BIT_ULL(VIRTIO_NET_F_STATUS)) && + !(net->dev.features & BIT_ULL(VIRTIO_NET_F_STATUS))) { + ((struct virtio_net_config *)config)->status |=3D VIRTIO_NET_S_LIN= K_UP; + } + + return 0; } int vhost_net_set_config(struct vhost_net *net, const uint8_t *data, uint32_t offset, uint32_t size, uint32_t flags) --=20 2.31.1 From nobody Thu Jun 13 09:56:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666184715; cv=none; d=zohomail.com; s=zohoarc; b=GxgqrPW0P0tokr4Hxb/doHj8IExlQwKj4aCXnE+pUTAdOcuXDO+IPiwAblSkjRasv9p1lT2htU436vGUIKixLUjESDPC/PySS+1I3iAYuaW0/U3Jz4geeozMM4zB+dCc+iiMUjUq2mwYhK6tIdeHCQHijwItEzG+0sid9EWbIIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666184715; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SoTz4WrSj/6TG264UMdH3uDpSJqGlI8R2/aF+QLXIAc=; b=N++oSQy20Y5eG4Rt/NwjvQCKNwt+VQuKG5GCVTaa5E8taGPp6dynrShK1ZFcsL2Zg2Q1cGK+HEFAyRaoFB7oCyhxKjKJqbGcX5vS2dzZkki9FVBfsTg5T7fb3gVF4tLT3/hAkGhb8Ppdpz7M7HVZnNps5ZnJWZOOp3jTt5s+93U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666184715580545.4592127899599; Wed, 19 Oct 2022 06:05:15 -0700 (PDT) Received: from localhost ([::1]:36154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol8kz-0002TT-Fa for importer@patchew.org; Wed, 19 Oct 2022 09:05:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Z1-0006WF-Oe for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Ym-0002Hf-DS for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:51 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-500-0lIn7BriPhCe4vF0G8BOxQ-1; Wed, 19 Oct 2022 08:52:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6B822857FB0; Wed, 19 Oct 2022 12:52:28 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16E664081B60; Wed, 19 Oct 2022 12:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666183954; 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=SoTz4WrSj/6TG264UMdH3uDpSJqGlI8R2/aF+QLXIAc=; b=jLdjtrxGSaQK2XsjCmN58zByY4+hHJYHNd/y3uIlH4BwUozBsiP+aubsYE9txmeKcqFNaz 1Jg4Kj/KWyzSBByQU0yudoTvnAKxZWElBAEuuTF92P0NRi5ay4XM5SypYf3Ds4RPWl2M1s qFbS9ymOq7YuGTV1fcSJhVXzTzOncZo= X-MC-Unique: 0lIn7BriPhCe4vF0G8BOxQ-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Zhu Lingshan , Harpreet Singh Anand , Stefano Garzarella , Si-Wei Liu , Jason Wang , "Michael S. Tsirkin" , Cindy Lu , Laurent Vivier , Eli Cohen , Liuxiangdong , Parav Pandit , Gautam Dawar Subject: [RFC PATCH v2 4/8] vdpa: Expose VIRTIO_NET_F_STATUS unconditionally Date: Wed, 19 Oct 2022 14:52:06 +0200 Message-Id: <20221019125210.226291-5-eperezma@redhat.com> In-Reply-To: <20221019125210.226291-1-eperezma@redhat.com> References: <20221019125210.226291-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666184715916100001 Now that qemu can handle and emulate it if the vdpa backend does not support it we can offer it always. Signed-off-by: Eugenio P=C3=A9rez --- net/vhost-vdpa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 3803452800..fca21d5b79 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -602,6 +602,9 @@ static NetClientState *net_vhost_vdpa_init(NetClientSta= te *peer, if (svq) { /* Add SVQ logging capabilities */ s->vhost_vdpa.added_features |=3D BIT_ULL(VHOST_F_LOG_ALL); + + /* VIRTIO_NET_F_STATUS is mandatory for _F_GUEST_ANNOUNCE. */ + s->vhost_vdpa.added_features |=3D BIT_ULL(VIRTIO_NET_F_STATUS); } if (!is_datapath) { s->cvq_cmd_out_buffer =3D qemu_memalign(qemu_real_host_page_size(), --=20 2.31.1 From nobody Thu Jun 13 09:56:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666185509; cv=none; d=zohomail.com; s=zohoarc; b=hWiaoixn0cZ+TwkKu8k9O2iToQ3J3q3hUdYJe+Jgi58rHjlfhhsGu0mI/1/px1nNvAV45exwzBCIaTQY53WsFxtE4aJCaRnj3Rtkewd0Idp/Z0P/k47r20jln82WRc/MnZyVX0OQ9cvV9fPXA+wsUcNrwZeIaojgCaWGfLEmFxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666185509; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WUoMSiMZQmcCwuUwdcYUEB/TvyEqvIQErNRynamLkig=; b=QckqqD+hSx9kWUN5EnLKHM1S+W1NficYy+2emjOvc9IqEwyPoz0LLpGfaeEHdolz3kCHCpeGFCKIPVGkSh1u7+OsHKgCslhCn25bsDyMqr5mKFX3Mie8sf+JNYjctJl+my5gU/Xgs+yQLqGW1EnOnjEEkigAoK6HXWzjag5xByI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666185509859482.35825623368726; Wed, 19 Oct 2022 06:18:29 -0700 (PDT) Received: from localhost ([::1]:44148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol8xo-0007gy-KM for importer@patchew.org; Wed, 19 Oct 2022 09:18:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yp-0006LQ-3s for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yn-0002Hl-F6 for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:38 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-222-n5Tms6KzObyeMKtJsu4qHg-1; Wed, 19 Oct 2022 08:52:31 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 182982932488; Wed, 19 Oct 2022 12:52:31 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3CC34081B60; Wed, 19 Oct 2022 12:52:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666183955; 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=WUoMSiMZQmcCwuUwdcYUEB/TvyEqvIQErNRynamLkig=; b=B46f6UCLJCOWyBL5wp8q5kqFgneQGbIoLjTiqqT4U4KMdzqVrYE+03HiSltG6T6UPPSHAY NAKICwl+/IOUPmKYrVdpwG5/2NQbR7HAO3LdtBe/kDPRbRWU60wxp2l8aEWy3S2Gj7l19h jRIfOEv4WHwZKDa3MbjU0ysE0m6eJuM= X-MC-Unique: n5Tms6KzObyeMKtJsu4qHg-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Zhu Lingshan , Harpreet Singh Anand , Stefano Garzarella , Si-Wei Liu , Jason Wang , "Michael S. Tsirkin" , Cindy Lu , Laurent Vivier , Eli Cohen , Liuxiangdong , Parav Pandit , Gautam Dawar Subject: [RFC PATCH v2 5/8] vdpa: Remove shadow CVQ command check Date: Wed, 19 Oct 2022 14:52:07 +0200 Message-Id: <20221019125210.226291-6-eperezma@redhat.com> In-Reply-To: <20221019125210.226291-1-eperezma@redhat.com> References: <20221019125210.226291-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.256, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666185511823100001 The guest will see undefined behavior if it issue not negotiate commands, bit it is expected somehow. Simplify code deleting this check. Signed-off-by: Eugenio P=C3=A9rez Acked-by: Jason Wang --- net/vhost-vdpa.c | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index fca21d5b79..3374c21b4d 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -461,48 +461,6 @@ static NetClientInfo net_vhost_vdpa_cvq_info =3D { .check_peer_type =3D vhost_vdpa_check_peer_type, }; =20 -/** - * Do not forward commands not supported by SVQ. Otherwise, the device cou= ld - * accept it and qemu would not know how to update the device model. - */ -static bool vhost_vdpa_net_cvq_validate_cmd(const void *out_buf, size_t le= n) -{ - struct virtio_net_ctrl_hdr ctrl; - - if (unlikely(len < sizeof(ctrl))) { - qemu_log_mask(LOG_GUEST_ERROR, - "%s: invalid legnth of out buffer %zu\n", __func__, = len); - return false; - } - - memcpy(&ctrl, out_buf, sizeof(ctrl)); - switch (ctrl.class) { - case VIRTIO_NET_CTRL_MAC: - switch (ctrl.cmd) { - case VIRTIO_NET_CTRL_MAC_ADDR_SET: - return true; - default: - qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid mac cmd %u\n", - __func__, ctrl.cmd); - }; - break; - case VIRTIO_NET_CTRL_MQ: - switch (ctrl.cmd) { - case VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: - return true; - default: - qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid mq cmd %u\n", - __func__, ctrl.cmd); - }; - break; - default: - qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid control class %u\n", - __func__, ctrl.class); - }; - - return false; -} - /** * Validate and copy control virtqueue commands. * @@ -526,16 +484,10 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShad= owVirtqueue *svq, .iov_len =3D sizeof(status), }; ssize_t dev_written =3D -EINVAL; - bool ok; =20 out.iov_len =3D iov_to_buf(elem->out_sg, elem->out_num, 0, s->cvq_cmd_out_buffer, vhost_vdpa_net_cvq_cmd_len()); - ok =3D vhost_vdpa_net_cvq_validate_cmd(s->cvq_cmd_out_buffer, out.iov_= len); - if (unlikely(!ok)) { - goto out; - } - dev_written =3D vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(status)); if (unlikely(dev_written < 0)) { goto out; --=20 2.31.1 From nobody Thu Jun 13 09:56:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666184838; cv=none; d=zohomail.com; s=zohoarc; b=Y4egMpcZx0yk6fEfkeAfKR6oB8IpJa6ymHVhG3MxCcY27kL835JXkMyMCzYVVsRzje14VNTyKau+bsdWaG0pa06+1dYzwG/WyRnrZCHy3QlOeJR/pwup1/XAvIhLNTZslHQ+EyKt6k4/twuS3A3yAtnY/AW8DeBKxo/ef03zKBM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666184838; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TVL69tt3U4Sp+yF4eyxZwls4Hc0ZvfnFa/OTrYDffMU=; b=YQA5+fElHkmU44Vm22ypGOlqPEvIhpDMy40dl+CUyh29tajTtb1HpCTzflwT3xOHhQss4/XfB1w+9MlIxtjRkFo+Pzlmvd1Hr2Safrobo625kI9ogpTxxZqwYyaft8h3NmrMdlr0dIjryz1yd69pvXAzlzmvaqhNbB8nGZ/vTEg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666184838273159.96800152039634; Wed, 19 Oct 2022 06:07:18 -0700 (PDT) Received: from localhost ([::1]:35018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol8mz-0006dE-33 for importer@patchew.org; Wed, 19 Oct 2022 09:07:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yp-0006LT-Eb for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44396) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yo-0002Hx-1j for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:39 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-357-s0Gxk_CsM5OwAtx0qCATyQ-1; Wed, 19 Oct 2022 08:52:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B7B0129DD9B8; Wed, 19 Oct 2022 12:52:33 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60E6E4081B60; Wed, 19 Oct 2022 12:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666183957; 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=TVL69tt3U4Sp+yF4eyxZwls4Hc0ZvfnFa/OTrYDffMU=; b=gT+i8fPvhv2V7Dd2uTg/wsglrpAKgIH7dFpptPirCYFN4gfsujyCufbCF9n+fwxQ/h2o4k 9zKjv7/Pcbk28f47V8iZptN7XWqRvHrbYr87pywC1QWZJx++Eujw+7CCv1agWJMlvV6Egj Aga1U0ENUwuREbzRpcY5/qYRIoJiW4k= X-MC-Unique: s0Gxk_CsM5OwAtx0qCATyQ-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Zhu Lingshan , Harpreet Singh Anand , Stefano Garzarella , Si-Wei Liu , Jason Wang , "Michael S. Tsirkin" , Cindy Lu , Laurent Vivier , Eli Cohen , Liuxiangdong , Parav Pandit , Gautam Dawar Subject: [RFC PATCH v2 6/8] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_handle_ctrl_avail Date: Wed, 19 Oct 2022 14:52:08 +0200 Message-Id: <20221019125210.226291-7-eperezma@redhat.com> In-Reply-To: <20221019125210.226291-1-eperezma@redhat.com> References: <20221019125210.226291-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.256, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666184838872100001 Since this capability is emulated by qemu shadowed CVQ cannot forward it to the device. Process all that command within qemu. Signed-off-by: Eugenio P=C3=A9rez --- net/vhost-vdpa.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 3374c21b4d..5fda405a66 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -488,9 +488,18 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShado= wVirtqueue *svq, out.iov_len =3D iov_to_buf(elem->out_sg, elem->out_num, 0, s->cvq_cmd_out_buffer, vhost_vdpa_net_cvq_cmd_len()); - dev_written =3D vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(status)); - if (unlikely(dev_written < 0)) { - goto out; + if (*(uint8_t *)s->cvq_cmd_out_buffer =3D=3D VIRTIO_NET_CTRL_ANNOUNCE)= { + /* + * Guest announce capability is emulated by qemu, so dont forward = to + * the device. + */ + dev_written =3D sizeof(status); + *s->status =3D VIRTIO_NET_OK; + } else { + dev_written =3D vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(stat= us)); + if (unlikely(dev_written < 0)) { + goto out; + } } =20 if (unlikely(dev_written < sizeof(status))) { --=20 2.31.1 From nobody Thu Jun 13 09:56:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666184657; cv=none; d=zohomail.com; s=zohoarc; b=APRhkO/qhsUxSvPfSgPuKshd90tJZi3o7R+7OerZZjn4+TzcUWd+r4RrZJK1LQSBSRNIjrCOGCOD1H5GAaiMtFrvYd4wO8F/5RRaAFt8XfVnS2NVuOi7AkUoXnzlCfvq9Js7aGk7yDX8Fh/yytGoJMT2YTG/bpiOGNrj6o2p358= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666184657; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dlLuvcUarN69elwvHlh5K3FVhKPGqTSF12DmuECjccc=; b=WmXYFes8XxI+l2/B+ygmQBUWt9DGpXuXyX1xWNDwctfGKCgTBUH9khnmHcgr6F+FctuWzL4PNUMw+uxOUj1x4lLbWtf+xWUaNeNwADSrfH7SqDVyLZ60rwnU8USonH1eAIWhi70H+hAIOR9YIdSayju/l4svNlw9GRW8Omd8SIY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666184657318977.2619959587479; Wed, 19 Oct 2022 06:04:17 -0700 (PDT) Received: from localhost ([::1]:36130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol8k3-0002OY-Ly for importer@patchew.org; Wed, 19 Oct 2022 09:04:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yt-0006Q5-3a for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39240) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yr-0002Ik-KA for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:42 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-2nC0wrjFO5eWouTBEBDN_Q-1; Wed, 19 Oct 2022 08:52:36 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 58EE3185A79C; Wed, 19 Oct 2022 12:52:36 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BD744081B60; Wed, 19 Oct 2022 12:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666183961; 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=dlLuvcUarN69elwvHlh5K3FVhKPGqTSF12DmuECjccc=; b=LI5qzVAlNHLD3dpwzHs/kZnrSN/JthJW7QytfulsAzAXn/tC/+bfTrYltcfCyKV2TSc9PW KAO7xEDSoRPaw+qXPb65yN5hDyRbntsXj31VveeCcnsQT8oyjmvdS8ALtFNlV35pEyEm/U bxNojkIwv/4qsBL0g93E3rEDpJtBvBU= X-MC-Unique: 2nC0wrjFO5eWouTBEBDN_Q-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Zhu Lingshan , Harpreet Singh Anand , Stefano Garzarella , Si-Wei Liu , Jason Wang , "Michael S. Tsirkin" , Cindy Lu , Laurent Vivier , Eli Cohen , Liuxiangdong , Parav Pandit , Gautam Dawar Subject: [RFC PATCH v2 7/8] vhost_net: return VIRTIO_NET_S_ANNOUNCE is device model has it set Date: Wed, 19 Oct 2022 14:52:09 +0200 Message-Id: <20221019125210.226291-8-eperezma@redhat.com> In-Reply-To: <20221019125210.226291-1-eperezma@redhat.com> References: <20221019125210.226291-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.256, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666184658958100001 Temporal, as this affects other vhost backends and we must check status feature first. Signed-off-by: Eugenio P=C3=A9rez --- hw/net/vhost_net.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 5660606c1d..300f370e2a 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -118,6 +118,7 @@ int vhost_net_get_config(struct vhost_net *net, uint8_= t *config, uint32_t config_len) { VirtIODevice *vdev; + VirtIONet *n; int r =3D vhost_dev_get_config(&net->dev, config, config_len, NULL); =20 if (unlikely(r !=3D 0)) { @@ -142,6 +143,13 @@ int vhost_net_get_config(struct vhost_net *net, uint8= _t *config, ((struct virtio_net_config *)config)->status |=3D VIRTIO_NET_S_LIN= K_UP; } =20 + if (!(net->dev.acked_features & BIT_ULL(VIRTIO_NET_F_GUEST_ANNOUNCE)))= { + return 0; + } + + n =3D VIRTIO_NET(vdev); + ((struct virtio_net_config *)config)->status |=3D + (n->status & VIRTIO_NET_S_ANNOU= NCE); return 0; } int vhost_net_set_config(struct vhost_net *net, const uint8_t *data, --=20 2.31.1 From nobody Thu Jun 13 09:56:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666185174; cv=none; d=zohomail.com; s=zohoarc; b=OSntS+5dR2d+OR43ZZCqsvSKankH7G8yNHRT/9dLo9RIto6CxZXhqRmI8C03XroCtUgYgqzSmzuiRnAxsou/UzqkHrIylhLw9uaHVSPU8FrxWeUsJvxtmR8MxjAZGIFE0HTWjqzjkuV55ArpJ+IipQnciA2oTpFnLpTscobTJ2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666185174; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F5A6Wz4vTjMQXnGigxrbVFmdXH778LWcKk1IV3D0UUo=; b=Xj+C4lQCL/GIqetxxuZL+tuKuSq4aaAYlxbPEbULN3TTPIyZZqtNIOwlRPub+bToncLl3Hotac7evhpRMZl1ad00UXz7uyYKqIOKzdavTgJaA4Q1kbobzS/1L0mB4X0VQcNtPCOHMhLwnxpzb4UPW/pm7UT+O+MpUZ5c4JLmRgg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666185174096406.6666204608663; Wed, 19 Oct 2022 06:12:54 -0700 (PDT) Received: from localhost ([::1]:48686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol8sO-00023w-Qk for importer@patchew.org; Wed, 19 Oct 2022 09:12:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yw-0006Qu-3s for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:29873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8Yu-0002Jl-OA for qemu-devel@nongnu.org; Wed, 19 Oct 2022 08:52:45 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-e_O3ih92NVGFsrAf8InYYA-1; Wed, 19 Oct 2022 08:52:40 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C92587B2A2; Wed, 19 Oct 2022 12:52:40 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id A17724081B61; Wed, 19 Oct 2022 12:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666183964; 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=F5A6Wz4vTjMQXnGigxrbVFmdXH778LWcKk1IV3D0UUo=; b=SzJoOJOZWzK57tUPDS53LLdlvkPwYu2zI+Lp8Eu0O1BGJigBYbiD7rZAMtZFBhRIOrL8x9 kmVTORThY/M2Z3Ww5XFkR20uWVhanzRzb1/nOcmlVveUeNQhKSiac5vuHd/bH/n7poD2fi PJBEpVno56ogdbOtksqwHfAyH8O/Usg= X-MC-Unique: e_O3ih92NVGFsrAf8InYYA-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Zhu Lingshan , Harpreet Singh Anand , Stefano Garzarella , Si-Wei Liu , Jason Wang , "Michael S. Tsirkin" , Cindy Lu , Laurent Vivier , Eli Cohen , Liuxiangdong , Parav Pandit , Gautam Dawar Subject: [RFC PATCH v2 8/8] vdpa: Offer VIRTIO_NET_F_GUEST_ANNOUNCE feature if SVQ is enabled Date: Wed, 19 Oct 2022 14:52:10 +0200 Message-Id: <20221019125210.226291-9-eperezma@redhat.com> In-Reply-To: <20221019125210.226291-1-eperezma@redhat.com> References: <20221019125210.226291-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.256, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666185175526100001 So qemu emulates it in case the device does not support it. Signed-off-by: Eugenio P=C3=A9rez --- net/vhost-vdpa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 5fda405a66..64442e8455 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -566,6 +566,9 @@ static NetClientState *net_vhost_vdpa_init(NetClientSta= te *peer, =20 /* VIRTIO_NET_F_STATUS is mandatory for _F_GUEST_ANNOUNCE. */ s->vhost_vdpa.added_features |=3D BIT_ULL(VIRTIO_NET_F_STATUS); + + /* We can emulate guest announce shadowing CVQ */ + s->vhost_vdpa.added_features |=3D BIT_ULL(VIRTIO_NET_F_GUEST_ANNOU= NCE); } if (!is_datapath) { s->cvq_cmd_out_buffer =3D qemu_memalign(qemu_real_host_page_size(), --=20 2.31.1