From nobody Mon Oct 6 08:24:26 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 171CF2236FD for ; Thu, 24 Jul 2025 06:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753339242; cv=none; b=WUq40FprQJkKfGgZkaP6C75qxmSKYGQ8BCH2FO9D2qtnvZaCJyqu82+ZYFgJ3bFVFwmHmtmrn5RAR87m9IxSDnkVycDWvDKp/bjePguNnVNybeYeko+ZdCBcHd9B3eYmuuaIvYNUsDigtuochkNW9gV5DL3tAJ1JN0s5zgO3TMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753339242; c=relaxed/simple; bh=uwOmbujZkWwi6D/4k0/v8CyYvQ0s2kR+uX1sT0+5Cto=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GVWy3V58U97nfQl+qEVWoN6OkEydcoyn1B/0uK2mKJjMM8GYEKzdKfpORQg6ZzcM+msQhfkvWRJE0YCX+ehzBy764SPfTov1SVpGfUtEmkXmIS7OtTGTgQgnM82oR2i4lo3fsWidMKFktQYoqQyu+aqIosqwhpc6x7r3ps8LgvM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bROK3MID; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bROK3MID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753339240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mnKH3qFNhW0egQn6fG6AuCnYHUyntbTarBkYRfvYpGA=; b=bROK3MIDGs86+2pTXz2aMUtLB8BmTZI4qzAyG26JIYGveRLaBVYrVPQ9IwwmTEBQ0fz6i2 HP4rRgPXwVHy+Bm0RIgXsOV/ZWufiELXOQeHYHmN8AQCSjbyAygLdzeoUdKtUx6mE78e8K sy1/3nGr/aYST9jQO5/DPNx51ddnzV0= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-jJRPRtOaM2-buU408YXjNg-1; Thu, 24 Jul 2025 02:40:35 -0400 X-MC-Unique: jJRPRtOaM2-buU408YXjNg-1 X-Mimecast-MFC-AGG-ID: jJRPRtOaM2-buU408YXjNg_1753339235 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E28D319560A5; Thu, 24 Jul 2025 06:40:34 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.112.231]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B975F180035E; Thu, 24 Jul 2025 06:40:31 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH V4 02/19] virtio_ring: switch to use vring_virtqueue in virtqueue_poll variants Date: Thu, 24 Jul 2025 14:40:00 +0800 Message-ID: <20250724064017.26058-3-jasowang@redhat.com> In-Reply-To: <20250724064017.26058-1-jasowang@redhat.com> References: <20250724064017.26058-1-jasowang@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Acked-by: Eugenio P=C3=A9rez Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 02df3c9ab337..3eb1449d13b3 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -915,11 +915,10 @@ static unsigned int virtqueue_enable_cb_prepare_split= (struct virtqueue *_vq) return last_used_idx; } =20 -static bool virtqueue_poll_split(struct virtqueue *_vq, unsigned int last_= used_idx) +static bool virtqueue_poll_split(struct vring_virtqueue *vq, + unsigned int last_used_idx) { - struct vring_virtqueue *vq =3D to_vvq(_vq); - - return (u16)last_used_idx !=3D virtio16_to_cpu(_vq->vdev, + return (u16)last_used_idx !=3D virtio16_to_cpu(vq->vq.vdev, vq->split.vring.used->idx); } =20 @@ -1845,9 +1844,8 @@ static unsigned int virtqueue_enable_cb_prepare_packe= d(struct virtqueue *_vq) return vq->last_used_idx; } =20 -static bool virtqueue_poll_packed(struct virtqueue *_vq, u16 off_wrap) +static bool virtqueue_poll_packed(struct vring_virtqueue *vq, u16 off_wrap) { - struct vring_virtqueue *vq =3D to_vvq(_vq); bool wrap_counter; u16 used_idx; =20 @@ -2612,8 +2610,8 @@ bool virtqueue_poll(struct virtqueue *_vq, unsigned i= nt last_used_idx) return false; =20 virtio_mb(vq->weak_barriers); - return vq->packed_ring ? virtqueue_poll_packed(_vq, last_used_idx) : - virtqueue_poll_split(_vq, last_used_idx); + return vq->packed_ring ? virtqueue_poll_packed(vq, last_used_idx) : + virtqueue_poll_split(vq, last_used_idx); } EXPORT_SYMBOL_GPL(virtqueue_poll); =20 --=20 2.39.5