From mboxrd@z Thu Jan 1 00:00:00 1970 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 4C1FF2DBF47 for ; Mon, 20 Oct 2025 07:10:55 +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=1760944256; cv=none; b=LaWXyLiLdQpYfRsC3Nl3ncnf09WIazGEmBriGBLWFcnIWYQwWP9MMnB0ko6IaF3IiMrJhFu9eIxdQZgzkM3uq72gxsjfBFhkhyqsnOjmsBywdkYP84/P3Q9ofgOnMfy+2VOC+9fXuK4Ac8qGbJ7zF0F9DSst5NZzpwYs6l6i5UU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760944256; c=relaxed/simple; bh=RR0+NM9tP19wOBCCAz+KfyimeAaDE1SQocegbFBadpg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GfnZtKjp8HuNeTdr0QPjk2YTxRn0Wy9dSNwb6GexXOQ5DAn7NtOKxkBG5AmcTVCh0Vqb5/5cpURhNp/8W1fWR+evtzCHVxW1FLbLmfLu4XimKI0NuwYvrluSjfMwOo1Z7maLrXpTIq3rJk6Ny0T9wR7O1vV+TbXBH0b5u2DbZv0= 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=OJpiOXWq; 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="OJpiOXWq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760944254; 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=Rt9CavJgBPAgRO3Nlj+9uYFblWnPYDRcaD5WdFy9CE0=; b=OJpiOXWqD3SxZZn+UkyPXBPECkOgtVpLhqQXfkzpuzX7+Hqm9+VrNH6CVJpoB36OHdlpXS r6jZDnUStQUL0b53IoF5D3QisjocbOr/F0ktm2vPxmkWjUT31gcyOczhugJcMXMRQjAwAH L7b4XbMKJUTxmtThaNrqNszF+PL/k78= Received: from mx-prod-mc-01.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-516-hsUvmDxbPPCqRX_dX8ItAA-1; Mon, 20 Oct 2025 03:10:51 -0400 X-MC-Unique: hsUvmDxbPPCqRX_dX8ItAA-1 X-Mimecast-MFC-AGG-ID: hsUvmDxbPPCqRX_dX8ItAA_1760944251 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D654119560B0; Mon, 20 Oct 2025 07:10:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.113.29]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EDFAA300019F; Mon, 20 Oct 2025 07:10:47 +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 V8 10/19] virtio_ring: switch to use vring_virtqueue for disable_cb variants Date: Mon, 20 Oct 2025 15:09:54 +0800 Message-ID: <20251020071003.28834-11-jasowang@redhat.com> In-Reply-To: <20251020071003.28834-1-jasowang@redhat.com> References: <20251020071003.28834-1-jasowang@redhat.com> Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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érez Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 61ce9645c3a6..768933daba9a 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -874,10 +874,8 @@ static void *virtqueue_get_buf_ctx_split(struct vring_virtqueue *vq, return ret; } -static void virtqueue_disable_cb_split(struct virtqueue *_vq) +static void virtqueue_disable_cb_split(struct vring_virtqueue *vq) { - struct vring_virtqueue *vq = to_vvq(_vq); - if (!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT)) { vq->split.avail_flags_shadow |= VRING_AVAIL_F_NO_INTERRUPT; @@ -893,7 +891,7 @@ static void virtqueue_disable_cb_split(struct virtqueue *_vq) vring_used_event(&vq->split.vring) = 0x0; else vq->split.vring.avail->flags = - cpu_to_virtio16(_vq->vdev, + cpu_to_virtio16(vq->vq.vdev, vq->split.avail_flags_shadow); } } @@ -1786,10 +1784,8 @@ static void *virtqueue_get_buf_ctx_packed(struct vring_virtqueue *vq, return ret; } -static void virtqueue_disable_cb_packed(struct virtqueue *_vq) +static void virtqueue_disable_cb_packed(struct vring_virtqueue *vq) { - struct vring_virtqueue *vq = to_vvq(_vq); - if (vq->packed.event_flags_shadow != VRING_PACKED_EVENT_FLAG_DISABLE) { vq->packed.event_flags_shadow = VRING_PACKED_EVENT_FLAG_DISABLE; @@ -2542,9 +2538,9 @@ void virtqueue_disable_cb(struct virtqueue *_vq) struct vring_virtqueue *vq = to_vvq(_vq); if (vq->packed_ring) - virtqueue_disable_cb_packed(_vq); + virtqueue_disable_cb_packed(vq); else - virtqueue_disable_cb_split(_vq); + virtqueue_disable_cb_split(vq); } EXPORT_SYMBOL_GPL(virtqueue_disable_cb); -- 2.31.1