From nobody Wed Dec 17 05:57:14 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 8BD0426D4C3 for ; Mon, 16 Jun 2025 08:25:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750062348; cv=none; b=PF0V47uGH/K96mR24liocRmCjUoc/OoVTsPDFtfqgiOfXUDjwuUT389X3obiv2N6AA740RC+/wrTR0ytS/LTqSXJdbMKavXSLzLk6d7Xc/91EajjQLaI84/qKuYdv7juobBg0WjZimYeL3lzzeVmSRtednp1TJUVspn8RQbQfFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750062348; c=relaxed/simple; bh=btrWKaG8/rzeBsz6IdVxk16L4Rb/ZH0842aOqeUc3vs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MvB9UXCtVI8b/xuVFXQbITQtS7gqtBmdA3rk4T35UYPNBDJ1Z8+bmtWTcByYDHsMP30chdn0wKiS3PYBMEmNi7f7Lk9VF8m79AESTkUQlxl/XHBbH5ZDoaVCrpW23TVWlvZDQ13zp0s0LnDg/ZshuY1x3ZGOq3G8xAe/yZ4pSBs= 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=IbXYHX7v; arc=none smtp.client-ip=170.10.133.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="IbXYHX7v" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1750062345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iPs4Pk+ZGeTi5sQMll9sHQqrUEkat8mM6CgdpH2mZwY=; b=IbXYHX7vWgTtw09aHU1q2LqTHLuEh8hlTqhSwfvx13qeZW6FPsJBh80OVQk5N2Up23RQU/ IFqx20VZuYaL37Fmwk1L9Wth+zkOsWxitUr23vHChZsNIdBRWMSBozJZGbabWGq5qmhVCB hkjjK+Ixkr0dQVj5eoJvOfb7+VI/WMA= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-9Ak6MBoBNBeMEk4WGFebNA-1; Mon, 16 Jun 2025 04:25:43 -0400 X-MC-Unique: 9Ak6MBoBNBeMEk4WGFebNA-1 X-Mimecast-MFC-AGG-ID: 9Ak6MBoBNBeMEk4WGFebNA_1750062342 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76F661800282; Mon, 16 Jun 2025 08:25:42 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.112.72]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5411818003FC; Mon, 16 Jun 2025 08:25:38 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: xuanzhuo@linux.alibaba.com, eperezma@redhat.com, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH V3 04/19] virtio_ring: switch to use vring_virtqueue for virtqueue resize variants Date: Mon, 16 Jun 2025 16:25:02 +0800 Message-ID: <20250616082518.10411-5-jasowang@redhat.com> In-Reply-To: <20250616082518.10411-1-jasowang@redhat.com> References: <20250616082518.10411-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-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. 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 633379b2dc42..e7be480bee67 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1216,11 +1216,10 @@ static struct virtqueue *vring_create_virtqueue_spl= it( return vq; } =20 -static int virtqueue_resize_split(struct virtqueue *_vq, u32 num) +static int virtqueue_resize_split(struct vring_virtqueue *vq, u32 num) { struct vring_virtqueue_split vring_split =3D {}; - struct vring_virtqueue *vq =3D to_vvq(_vq); - struct virtio_device *vdev =3D _vq->vdev; + struct virtio_device *vdev =3D vq->vq.vdev; int err; =20 err =3D vring_alloc_queue_split(&vring_split, vdev, num, @@ -2183,11 +2182,10 @@ static struct virtqueue *vring_create_virtqueue_pac= ked( return vq; } =20 -static int virtqueue_resize_packed(struct virtqueue *_vq, u32 num) +static int virtqueue_resize_packed(struct vring_virtqueue *vq, u32 num) { struct vring_virtqueue_packed vring_packed =3D {}; - struct vring_virtqueue *vq =3D to_vvq(_vq); - struct virtio_device *vdev =3D _vq->vdev; + struct virtio_device *vdev =3D vq->vq.vdev; int err; =20 if (vring_alloc_queue_packed(&vring_packed, vdev, num, vring_dma_dev(vq))) @@ -2805,9 +2803,9 @@ int virtqueue_resize(struct virtqueue *_vq, u32 num, recycle_done(_vq); =20 if (vq->packed_ring) - err =3D virtqueue_resize_packed(_vq, num); + err =3D virtqueue_resize_packed(vq, num); else - err =3D virtqueue_resize_split(_vq, num); + err =3D virtqueue_resize_split(vq, num); =20 return virtqueue_enable_after_reset(_vq); } --=20 2.34.1