From nobody Mon Aug 19 11:03:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV7z2QMWz5Sp3j; Mon, 19 Aug 2024 11:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnV7y6VZcz4S9t; Mon, 19 Aug 2024 11:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065406; 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; bh=ubS5qKs/Q1caEnUii0RLyNExt4BWYhHHC86nb4K9YNk=; b=O2DzsKIsn23TEAOye/xkyp2GhnjeuGhHQ8AVsfyFQxBMXGCQa7SsjKtxwTXjwL2Oot6+cn Q0LH+01n2LqbvD9L0LEv+rV01q3V/yrf9Taj50XdG3cC+IBPyHz7XCmtFSqwRFhQHJk/kx Zc3KM5x0JwnTlsjZWNBNSiZJcSSn46zqBLXfxobYR9XlxYpeNFOFklQ4hWiLkjhfPJvU9v 4IOm6icpukPxZwrGl/HguWrvH+dgXsKYk5yX+y3TKbrBktkLw08VkbZ7XgJ9Fhh+MCNKbH GCdPHhGDjBaI7WHLfd2VHPqRoZVm0ZM3i3otBZErvO0UDVKHrQrebtO4yRXYqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065406; a=rsa-sha256; cv=none; b=ypIpYHgbFnPwjEC1Gb8ApSgcC2QNwQNKm7QxrX5p9OO8Lqbna8obfKSAmsWFgJ+c+Wu2oV krd4RcFoNkwk0zPvaaDNJoItJoJ4lo/Uen16oskd3D2RQNIUAmq6maK3r8KV3IUGZBpGY0 2jpIfU2Zlbm0Gx/mZf1d7jQqGPtqE/0eH2UzRZ7vd/ZCaC2s4mlzNwUjuXM/0DMHMxxFF0 M4c4gmwbYbm0KO5D705O5nDj8BZ6jENBSEqthCjCeQ0FGkDEX0CWCMBSnnGsQeunvh77Tb ERW4ECRawruEdh+oJChuYfjNPI9cqEDuUDJln2hfBdXbN7kS1sjBo5D4NVqhkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065406; 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; bh=ubS5qKs/Q1caEnUii0RLyNExt4BWYhHHC86nb4K9YNk=; b=e/qyTMX7BexJ74vnQUFVckpPaeJ8lK2UKJveyYunZU3nwV4hpwsT2z5EyO3xzHvZ6V/du5 doWakGkqsUaBPuvFCJlA6u8ZFZ9Y3v4d/E7CkNvoKtuNsbY4dlQp8993CFkW2vo0Yb37Fa mG96NxTJLAv0kQEU+XtPCMWnPk5gXK4ofmqHkgIoLPKIHrlaaBS77k0ENLZCDkTV8n5EvN fT5s2LlYxdLp63orCVe/jhOViKQG46UBlR4KneisTORsfoxfOaCwPPcje5aabVWH0VR6N+ 7ElYS1TnToaQQGuzaLcE8Fu1MB1WaZZlMjLJaJProjcMIZ7/6DIjv47Q4vQ1zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV7y60dnzFGk; Mon, 19 Aug 2024 11:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JB3QgH037531; Mon, 19 Aug 2024 11:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3QIA037528; Mon, 19 Aug 2024 11:03:26 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:26 GMT Message-Id: <202408191103.47JB3QIA037528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 17a597bc13aa - main - buf_ring: Consistently use atomic_*_32 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17a597bc13aa59ee90facaf9b8dada80f32eb52d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=17a597bc13aa59ee90facaf9b8dada80f32eb52d commit 17a597bc13aa59ee90facaf9b8dada80f32eb52d Author: Andrew Turner AuthorDate: 2024-07-29 10:28:33 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 09:04:25 +0000 buf_ring: Consistently use atomic_*_32 We are operating on uint32_t values, use uint32_t atomic functions. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46150 --- sys/sys/buf_ring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 2d61f393712d..47ed04f570c1 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -94,7 +94,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) } continue; } - } while (!atomic_cmpset_acq_int(&br->br_prod_head, prod_head, prod_next)); + } while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next)); #ifdef DEBUG_BUFRING if (br->br_ring[prod_head] != NULL) panic("dangling value in enqueue"); @@ -108,7 +108,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) */ while (br->br_prod_tail != prod_head) cpu_spinwait(); - atomic_store_rel_int(&br->br_prod_tail, prod_next); + atomic_store_rel_32(&br->br_prod_tail, prod_next); critical_exit(); return (0); } @@ -132,7 +132,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) critical_exit(); return (NULL); } - } while (!atomic_cmpset_acq_int(&br->br_cons_head, cons_head, cons_next)); + } while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next)); buf = br->br_ring[cons_head]; #ifdef DEBUG_BUFRING @@ -146,7 +146,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) while (br->br_cons_tail != cons_head) cpu_spinwait(); - atomic_store_rel_int(&br->br_cons_tail, cons_next); + atomic_store_rel_32(&br->br_cons_tail, cons_next); critical_exit(); return (buf);