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.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 02F262FD7C3 for ; Thu, 25 Sep 2025 10:37:57 +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=1758796679; cv=none; b=c+MIw8n3HeiOpUipoENf42wY/n27+hZBbvGFQ5eHHuH+WUhHlyP1F/fGNSSULd1MBYjFMCXUSGI3/hWn/NFw/r/ZA2uLH0gnZGhJbKIU+GtzCzBlEYy2jMe6vVCS9r13wczEi6GaiwibDhHzACM33Uh7EHntga83oX52UV4Ao+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758796679; c=relaxed/simple; bh=XEtnrHECrq/n5FpADL3LfMWZyQVu01mbzxn//nz4phE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Eq99D7JjxLIsd7Kg26JtAgR8VdLCST06+4ymdZYB75JLDwdEZQpKJ70xghkDfk6VstMz4iHaQ5OBvi0lb6o5A1cEpqlKojQGra3+g9b5VF9lhoj6twAq1JlNI6DJ42dIVl4HqKhSD/0Q1prKfp3gCHcHoIv3CHkN2dJFupnykp8= 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=ZmoWMgVd; 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="ZmoWMgVd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758796677; 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=Q4FPBkheUtQFJ5C3vs4XZzaAF/OMZmMv9SqfzyXlOTM=; b=ZmoWMgVdomkYk0HYKdLcFmv//vTwNLcYQw2Khc38FZqQtvbPI+uDa9KzUbYPByarUx7Ewe /tqUR5zmkBixrsQmY86Im7bvgL+zTNWfv0UwwjN25CuSPz+cUW0OJD/hlQSCHWmmeo0ciJ voFfaH3QpO38lzJkNfoeztbBX8mn0js= 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-563-v7Cl0Hy0Nv-t0Wy7mj3wMg-1; Thu, 25 Sep 2025 06:37:53 -0400 X-MC-Unique: v7Cl0Hy0Nv-t0Wy7mj3wMg-1 X-Mimecast-MFC-AGG-ID: v7Cl0Hy0Nv-t0Wy7mj3wMg_1758796673 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 F1DA01956095; Thu, 25 Sep 2025 10:37:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.112.10]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BA86619560A2; Thu, 25 Sep 2025 10:37:49 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH V7 08/19] virtio_ring: switch to use vring_virtqueue for enable_cb_prepare variants Date: Thu, 25 Sep 2025 18:36:57 +0800 Message-ID: <20250925103708.44589-9-jasowang@redhat.com> In-Reply-To: <20250925103708.44589-1-jasowang@redhat.com> References: <20250925103708.44589-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.0 on 10.30.177.12 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 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 9d084ee9f4d6..f46ebc60f911 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -898,9 +898,8 @@ static void virtqueue_disable_cb_split(struct virtqueue *_vq) } } -static unsigned int virtqueue_enable_cb_prepare_split(struct virtqueue *_vq) +static unsigned int virtqueue_enable_cb_prepare_split(struct vring_virtqueue *vq) { - struct vring_virtqueue *vq = to_vvq(_vq); u16 last_used_idx; START_USE(vq); @@ -914,10 +913,10 @@ static unsigned int virtqueue_enable_cb_prepare_split(struct virtqueue *_vq) vq->split.avail_flags_shadow &= ~VRING_AVAIL_F_NO_INTERRUPT; if (!vq->event) vq->split.vring.avail->flags = - cpu_to_virtio16(_vq->vdev, + cpu_to_virtio16(vq->vq.vdev, vq->split.avail_flags_shadow); } - vring_used_event(&vq->split.vring) = cpu_to_virtio16(_vq->vdev, + vring_used_event(&vq->split.vring) = cpu_to_virtio16(vq->vq.vdev, last_used_idx = vq->last_used_idx); END_USE(vq); return last_used_idx; @@ -1807,10 +1806,8 @@ static void virtqueue_disable_cb_packed(struct virtqueue *_vq) } } -static unsigned int virtqueue_enable_cb_prepare_packed(struct virtqueue *_vq) +static unsigned int virtqueue_enable_cb_prepare_packed(struct vring_virtqueue *vq) { - struct vring_virtqueue *vq = to_vvq(_vq); - START_USE(vq); /* @@ -2572,8 +2569,8 @@ unsigned int virtqueue_enable_cb_prepare(struct virtqueue *_vq) if (vq->event_triggered) vq->event_triggered = false; - return vq->packed_ring ? virtqueue_enable_cb_prepare_packed(_vq) : - virtqueue_enable_cb_prepare_split(_vq); + return vq->packed_ring ? virtqueue_enable_cb_prepare_packed(vq) : + virtqueue_enable_cb_prepare_split(vq); } EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare); -- 2.31.1