From nobody Wed Oct 8 09:05:58 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 AD2DB1B0421 for ; Tue, 1 Jul 2025 01:14:47 +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=1751332489; cv=none; b=GFKZsZLNWFSYnWWqxr4fp3NJwTxkHQQSk9XXgLStUP5/9OeqLVWrFILoeUclbegWIxWJMWZWKfcoKjlpWHcPRykQc3VMky/OsD26xPtkoSR4BxnkJxTKee3bSJ42J6b3QdWMDddmJMPjKdpbBG7wzsI3jF/E1R0XhZd87rHwNBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751332489; c=relaxed/simple; bh=YSsBe6LdTHYtKVga5PocRlqM8qR4L0H+XWsQj2ddj0g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IIfWFErzQIxSKr06oewrltHZ8VDCuY4uOGNp8QaTnhcqrSMl6/si/baCxMTZsjpVb+Lb2EvddWKjAY3l5mkpQz+zJ/kPy1BmUIA39KU+GDO7DCj2UeowfP4oCJzDisJmWLTVp7Yd9yaZU3+bUU5uXap6NGRSk9aTmRebgOPGb3A= 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=GvJAe/j9; 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="GvJAe/j9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751332486; 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=rmeRRCSnBG4kFkIf6ISy+E1tN0sQsjbYYUh5C2Zc5HE=; b=GvJAe/j9YvaVNlMOrhSzcLXTALZi6jZq7mOG9kEVT389qfLLrnjdJoufJIwpBzRVNDwSAW A8TrhJDvhqmatXEVVHOQCGsqdFwdQEEwAiRfUb5DapMmimL2wbG5YOQAJNnRQ2rrinEFeD q/b2TxIQVQAj7i+3XpJ/ehhYt69a/Z0= 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-651-2jqd0ZQYNAGGBQ9BJPFcoQ-1; Mon, 30 Jun 2025 21:14:43 -0400 X-MC-Unique: 2jqd0ZQYNAGGBQ9BJPFcoQ-1 X-Mimecast-MFC-AGG-ID: 2jqd0ZQYNAGGBQ9BJPFcoQ_1751332482 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D7C151978F63; Tue, 1 Jul 2025 01:14:41 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.112.134]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6322E30001B1; Tue, 1 Jul 2025 01:14:35 +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, hch@infradead.org, xieyongji@bytedance.com Subject: [PATCH 5/9] virtio_ring: rename dma_handle to map_handle Date: Tue, 1 Jul 2025 09:13:57 +0800 Message-ID: <20250701011401.74851-6-jasowang@redhat.com> In-Reply-To: <20250701011401.74851-1-jasowang@redhat.com> References: <20250701011401.74851-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.4 Content-Type: text/plain; charset="utf-8" Following patch will introduce virtio map opreations which means the address is not necessarily used for DMA. Let's rename the dma_handle to map_handle first. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 5f17f8d91f1a..04e754874bec 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -306,18 +306,18 @@ size_t virtio_max_dma_size(const struct virtio_device= *vdev) EXPORT_SYMBOL_GPL(virtio_max_dma_size); =20 static void *vring_alloc_queue(struct virtio_device *vdev, size_t size, - dma_addr_t *dma_handle, gfp_t flag, + dma_addr_t *map_handle, gfp_t flag, void *map_token) { if (vring_use_map_api(vdev)) { return dma_alloc_coherent(map_token, size, - dma_handle, flag); + map_handle, flag); } else { void *queue =3D alloc_pages_exact(PAGE_ALIGN(size), flag); =20 if (queue) { phys_addr_t phys_addr =3D virt_to_phys(queue); - *dma_handle =3D (dma_addr_t)phys_addr; + *map_handle =3D (dma_addr_t)phys_addr; =20 /* * Sanity check: make sure we dind't truncate @@ -330,7 +330,7 @@ static void *vring_alloc_queue(struct virtio_device *vd= ev, size_t size, * warning and abort if we end up with an * unrepresentable address. */ - if (WARN_ON_ONCE(*dma_handle !=3D phys_addr)) { + if (WARN_ON_ONCE(*map_handle !=3D phys_addr)) { free_pages_exact(queue, PAGE_ALIGN(size)); return NULL; } @@ -340,11 +340,11 @@ static void *vring_alloc_queue(struct virtio_device *= vdev, size_t size, } =20 static void vring_free_queue(struct virtio_device *vdev, size_t size, - void *queue, dma_addr_t dma_handle, + void *queue, dma_addr_t map_handle, void *map_token) { if (vring_use_map_api(vdev)) - dma_free_coherent(map_token, size, queue, dma_handle); + dma_free_coherent(map_token, size, queue, map_handle); else free_pages_exact(queue, PAGE_ALIGN(size)); } --=20 2.34.1