From nobody Mon Feb 9 12:26:07 2026 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=1658140390; cv=none; d=zohomail.com; s=zohoarc; b=D/86BnM61nKq7bYbFLSI3DEF1NF57obfxaFy7B9A0nLwnVlrYwga4nB1bljFxKe6Dfz3c5a5Y1Jb7WzQ631Q3iPsqhEYpTLXAhDvoxZRIi+EC8R0BTzqNskByASEhBx1h6LdEEqReJnmrxs9r2o5lMzNBu7DteMk8lfTH6qfvoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658140390; 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=VpkW94v7wO47YN0nfwYhYcnj2RiAZSrGtQRBvd974kg=; b=hmCFWflULk1WTJlYd9Gr4LANlesq6dm5080Tbi35wXFT0wZccrs1Qh+Xri73va+GFcrHpur/kLAFbXlBtCvjc8KvW0O04BuQltL0x2moY0O1bIKOcMbYJAtFmvcyYy/XKPM7Llfe5wUTcRQhAxgj5DWIuKrM6WTINa/2eJ1IEvw= 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 1658140390706994.4473904290121; Mon, 18 Jul 2022 03:33:10 -0700 (PDT) Received: from localhost ([::1]:54538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDO3p-0003aL-MY for importer@patchew.org; Mon, 18 Jul 2022 06:33:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDO1b-0000YP-43 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 06:30:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:49976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDO1Y-0001Wi-Oq for qemu-devel@nongnu.org; Mon, 18 Jul 2022 06:30:50 -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-441-Vpkmsr13Ooqb5hDxmOjvJg-1; Mon, 18 Jul 2022 06:30:44 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 178D038041C6; Mon, 18 Jul 2022 10:30:44 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id F14C12166B26; Mon, 18 Jul 2022 10:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658140247; 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=VpkW94v7wO47YN0nfwYhYcnj2RiAZSrGtQRBvd974kg=; b=No/H8Hq0SO4uDKY2xJP5l7Bq5MRobKwh3kW8cjZex0kDc2Lfl8yRdnhNVjAZzaNh7tQwIQ 4EscWG5PK6tIfv3VW+z09r2iVL/okufW/PWbz+mDNBq6oulz1QHXushcisCyDLgnrOX2c2 o6KLoGcf28DJT2RzeJqXaP0Mg1noArM= X-MC-Unique: Vpkmsr13Ooqb5hDxmOjvJg-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Cindy Lu , Gautam Dawar , Cornelia Huck , Laurent Vivier , Paolo Bonzini , "Gonglei (Arei)" , Zhu Lingshan , Stefan Hajnoczi , Liuxiangdong , Jason Wang , Stefano Garzarella , Eli Cohen , Harpreet Singh Anand , "Michael S. Tsirkin" , Eric Blake , Markus Armbruster , Parav Pandit Subject: [PATCH v4 11/19] vhost: Expose vhost_svq_add Date: Mon, 18 Jul 2022 12:29:41 +0200 Message-Id: <20220718102949.2868267-12-eperezma@redhat.com> In-Reply-To: <20220718102949.2868267-1-eperezma@redhat.com> References: <20220718102949.2868267-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1658140392402100003 This allows external parts of SVQ to forward custom buffers to the device. Signed-off-by: Eugenio P=C3=A9rez --- hw/virtio/vhost-shadow-virtqueue.h | 3 +++ hw/virtio/vhost-shadow-virtqueue.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.h b/hw/virtio/vhost-shadow-vi= rtqueue.h index d9fc1f1799..dd78f4bec2 100644 --- a/hw/virtio/vhost-shadow-virtqueue.h +++ b/hw/virtio/vhost-shadow-virtqueue.h @@ -86,6 +86,9 @@ bool vhost_svq_valid_features(uint64_t features, Error **= errp); =20 void vhost_svq_push_elem(VhostShadowVirtqueue *svq, const VirtQueueElement *elem, uint32_t len); +int vhost_svq_add(VhostShadowVirtqueue *svq, const struct iovec *out_sg, + size_t out_num, const struct iovec *in_sg, size_t in_num, + VirtQueueElement *elem); =20 void vhost_svq_set_svq_kick_fd(VhostShadowVirtqueue *svq, int svq_kick_fd); void vhost_svq_set_svq_call_fd(VhostShadowVirtqueue *svq, int call_fd); diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-vi= rtqueue.c index b377e125e7..406a823c81 100644 --- a/hw/virtio/vhost-shadow-virtqueue.c +++ b/hw/virtio/vhost-shadow-virtqueue.c @@ -238,9 +238,9 @@ static void vhost_svq_kick(VhostShadowVirtqueue *svq) * * Return -EINVAL if element is invalid, -ENOSPC if dev queue is full */ -static int vhost_svq_add(VhostShadowVirtqueue *svq, const struct iovec *ou= t_sg, - size_t out_num, const struct iovec *in_sg, - size_t in_num, VirtQueueElement *elem) +int vhost_svq_add(VhostShadowVirtqueue *svq, const struct iovec *out_sg, + size_t out_num, const struct iovec *in_sg, size_t in_num, + VirtQueueElement *elem) { unsigned qemu_head; unsigned ndescs =3D in_num + out_num; --=20 2.31.1