From nobody Sun Apr 28 14:19:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544608843489541.4421499877592; Wed, 12 Dec 2018 02:00:43 -0800 (PST) Received: from localhost ([::1]:43598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX1Jq-0002B6-DZ for importer@patchew.org; Wed, 12 Dec 2018 05:00:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX1EP-0005gT-Ts for qemu-devel@nongnu.org; Wed, 12 Dec 2018 04:55:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gX1EM-0005vc-ON for qemu-devel@nongnu.org; Wed, 12 Dec 2018 04:55:05 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:39145 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gX1EM-0005t8-AR for qemu-devel@nongnu.org; Wed, 12 Dec 2018 04:55:02 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E097E21649A50; Wed, 12 Dec 2018 17:54:54 +0800 (CST) Received: from [127.0.0.1] (10.177.16.168) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Wed, 12 Dec 2018 17:54:50 +0800 To: "Michael S. Tsirkin" , Stefan Hajnoczi , Jason Wang From: jiangyiwen Message-ID: <5C10DAE9.3010605@huawei.com> Date: Wed, 12 Dec 2018 17:54:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.177.16.168] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 45.249.212.32 Subject: [Qemu-devel] [PATCH] vhost-vsock: support parse mergeable feature 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: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Currently vhost-vsock doesn't have any feature bits, so it don't support parse mergeable rx buffer feature. And the feature is support in another series of patches named "VSOCK: support mergeable rx buffer in vhost-vsock". So we neet to support parse mergeable feature in vhost-vsock if above patches are merged. Signed-off-by: Yiwen Jiang --- hw/virtio/vhost-vsock.c | 9 +++++++-- include/standard-headers/linux/virtio_vsock.h | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c index aa5af92..5023c05 100644 --- a/hw/virtio/vhost-vsock.c +++ b/hw/virtio/vhost-vsock.c @@ -178,8 +178,13 @@ static uint64_t vhost_vsock_get_features(VirtIODevice = *vdev, uint64_t requested_features, Error **errp) { - /* No feature bits used yet */ - return requested_features; + VHostVSock *vsock =3D VHOST_VSOCK(vdev); + uint64_t features; + + virtio_add_feature(&requested_features, VIRTIO_VSOCK_F_MRG_RXBUF); + features =3D requested_features & vsock->vhost_dev.features; + + return features; } static void vhost_vsock_handle_output(VirtIODevice *vdev, VirtQueue *vq) diff --git a/include/standard-headers/linux/virtio_vsock.h b/include/standa= rd-headers/linux/virtio_vsock.h index be44321..4c583ec 100644 --- a/include/standard-headers/linux/virtio_vsock.h +++ b/include/standard-headers/linux/virtio_vsock.h @@ -38,6 +38,9 @@ #include "standard-headers/linux/virtio_ids.h" #include "standard-headers/linux/virtio_config.h" +/* Virtio-vsock feature */ +#define VIRTIO_VSOCK_F_MRG_RXBUF 0 /* Host can merge receive buffers. */ + struct virtio_vsock_config { uint64_t guest_cid; } QEMU_PACKED; --=20 1.8.3.1