From nobody Mon Oct 6 06:29:01 2025 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 F0134D2FB for ; Thu, 24 Jul 2025 08:56:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753347373; cv=none; b=SD+NC87AVjeuGR8KiGgqATGLmtQv4U8sllKHkgf3yr+H2d+5ZoinTImzz+0+6ufBLSxU2AqROxNh7Y4sZrhe6khpbOpxicJG89i3f1gBjMS/DEdFfEKuteKiwU8kdk7NnBL0K3rVVxuMUyBIeb1ZyiSGr2vhaqxfgvMn3evZzdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753347373; c=relaxed/simple; bh=w8BbNZc7xuSnCQy7BnXIaO4o+xSf5DU6AR7DqOj/zEw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XTfiu8lRWL7G+tIJ1a3zm/m8RYVC2WLcfnzab1oRCDaGr+7rTHzt4jNRy7rxPW6WH5a+syMyim4aJ8tJk5Qvujse398mc9k1HtnpIdXFxC3ezCVgF+Bc5+J/Nixd6jxJDalOhtXZo6CafqC4ACwNaYP6fznDHCyK2u7E2r5lRzc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4bnlC40Zyrz13MhV; Thu, 24 Jul 2025 16:53:04 +0800 (CST) Received: from kwepemj200003.china.huawei.com (unknown [7.202.194.15]) by mail.maildlp.com (Postfix) with ESMTPS id 4FC62140121; Thu, 24 Jul 2025 16:56:02 +0800 (CST) Received: from localhost.huawei.com (10.90.31.46) by kwepemj200003.china.huawei.com (7.202.194.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 24 Jul 2025 16:56:01 +0800 From: Qinxin Xia To: <21cnbao@gmail.com>, , , CC: , , , , Subject: [PATCH 1/2] tools/dma: move dma_map_benchmark from selftests to tools/dma Date: Thu, 24 Jul 2025 16:55:59 +0800 Message-ID: <20250724085600.4101321-2-xiaqinxin@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250724085600.4101321-1-xiaqinxin@huawei.com> References: <20250724085600.4101321-1-xiaqinxin@huawei.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-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To kwepemj200003.china.huawei.com (7.202.194.15) Content-Type: text/plain; charset="utf-8" dma_map_benchmark is a standalone developer tool rather than an automated selftest. It has no pass/fail criteria, expects manual invocation, and is built as a normal userspace binary.Move it to tools/dma/ and add a minimal, the original selftest.Makefile entry is removed to avoid duplication. Signed-off-by: Qinxin Xia --- tools/Makefile | 13 +++++++------ tools/dma/Makefile | 15 +++++++++++++++ tools/{testing/selftests =3D> }/dma/config | 0 .../selftests =3D> }/dma/dma_map_benchmark.c | 0 tools/testing/selftests/dma/Makefile | 7 ------- 5 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 tools/dma/Makefile rename tools/{testing/selftests =3D> }/dma/config (100%) rename tools/{testing/selftests =3D> }/dma/dma_map_benchmark.c (100%) delete mode 100644 tools/testing/selftests/dma/Makefile diff --git a/tools/Makefile b/tools/Makefile index c31cbbd12c45..72dc0e936632 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -14,6 +14,7 @@ help: @echo ' counter - counter tools' @echo ' cpupower - a tool for all things x86 CPU power' @echo ' debugging - tools for debugging' + @echo ' dma - dma map benchmark' @echo ' firewire - the userspace part of nosy, an IEEE-139= 4 traffic sniffer' @echo ' firmware - Firmware tools' @echo ' freefall - laptop accelerometer program for disk p= rotection' @@ -69,7 +70,7 @@ acpi: FORCE cpupower: FORCE $(call descend,power/$@) =20 -counter firewire hv guest bootconfig spi usb virtio mm bpf iio gpio objtoo= l leds wmi firmware debugging tracing: FORCE +counter dma firewire hv guest bootconfig spi usb virtio mm bpf iio gpio ob= jtool leds wmi firmware debugging tracing: FORCE $(call descend,$@) =20 bpf/%: FORCE @@ -122,7 +123,7 @@ kvm_stat: FORCE ynl: FORCE $(call descend,net/ynl) =20 -all: acpi counter cpupower gpio hv firewire \ +all: acpi counter cpupower dma gpio hv firewire \ perf selftests bootconfig spi turbostat usb \ virtio mm bpf x86_energy_perf_policy \ tmon freefall iio objtool kvm_stat wmi \ @@ -134,7 +135,7 @@ acpi_install: cpupower_install: $(call descend,power/$(@:_install=3D),install) =20 -counter_install firewire_install gpio_install hv_install iio_install perf_= install bootconfig_install spi_install usb_install virtio_install mm_instal= l bpf_install objtool_install wmi_install debugging_install tracing_install: +counter_install dma_install firewire_install gpio_install hv_install iio_i= nstall perf_install bootconfig_install spi_install usb_install virtio_insta= ll mm_install bpf_install objtool_install wmi_install debugging_install tra= cing_install: $(call descend,$(@:_install=3D),install) =20 selftests_install: @@ -164,7 +165,7 @@ kvm_stat_install: ynl_install: $(call descend,net/$(@:_install=3D),install) =20 -install: acpi_install counter_install cpupower_install gpio_install \ +install: acpi_install counter_install cpupower_install dma_install gpio_in= stall \ hv_install firewire_install iio_install \ perf_install selftests_install turbostat_install usb_install \ virtio_install mm_install bpf_install x86_energy_perf_policy_install \ @@ -178,7 +179,7 @@ acpi_clean: cpupower_clean: $(call descend,power/cpupower,clean) =20 -counter_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean= virtio_clean mm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_cle= an leds_clean firmware_clean debugging_clean tracing_clean: +counter_clean dma_clean hv_clean firewire_clean bootconfig_clean spi_clean= usb_clean virtio_clean mm_clean wmi_clean bpf_clean iio_clean gpio_clean o= bjtool_clean leds_clean firmware_clean debugging_clean tracing_clean: $(call descend,$(@:_clean=3D),clean) =20 libapi_clean: @@ -224,7 +225,7 @@ build_clean: ynl_clean: $(call descend,net/$(@:_clean=3D),clean) =20 -clean: acpi_clean counter_clean cpupower_clean hv_clean firewire_clean \ +clean: acpi_clean counter_clean cpupower_clean dma_clean hv_clean firewire= _clean \ perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean us= b_clean virtio_clean \ mm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \ freefall_clean build_clean libbpf_clean libsubcmd_clean \ diff --git a/tools/dma/Makefile b/tools/dma/Makefile new file mode 100644 index 000000000000..6282eb41e51a --- /dev/null +++ b/tools/dma/Makefile @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: GPL-2.0 +bindir ?=3D /usr/bin + +CFLAGS +=3D -I../../include -I../../usr/include + +all: + $(CC) $(CFLAGS) dma_map_benchmark.c -o dma_map_benchmark + +install: all + install -D dma_map_benchmark $(bindir)/bin/dma_map_benchmark + +clean: + rm -f dma_map_benchmark + +.PHONY: all install clean diff --git a/tools/testing/selftests/dma/config b/tools/dma/config similarity index 100% rename from tools/testing/selftests/dma/config rename to tools/dma/config diff --git a/tools/testing/selftests/dma/dma_map_benchmark.c b/tools/dma/dm= a_map_benchmark.c similarity index 100% rename from tools/testing/selftests/dma/dma_map_benchmark.c rename to tools/dma/dma_map_benchmark.c diff --git a/tools/testing/selftests/dma/Makefile b/tools/testing/selftests= /dma/Makefile deleted file mode 100644 index cd8c5ece1cba..000000000000 --- a/tools/testing/selftests/dma/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -CFLAGS +=3D -I../../../../usr/include/ -CFLAGS +=3D -I../../../../include/ - -TEST_GEN_PROGS :=3D dma_map_benchmark - -include ../lib.mk --=20 2.33.0 From nobody Mon Oct 6 06:29:01 2025 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (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 2FCCA27144C for ; Thu, 24 Jul 2025 08:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753347374; cv=none; b=H0ONYO8t2mCi383i046eTsZlwDr79D/10aWebQ+tTX18HOncMoLEd4phNpr6IyzDxv0gzirUOnmJQudFg2RSeC8w9m+1Z+zXGS2JVqMij5kKH4PVTX6LuJTDET0LKa3kXkQZIjhjsS1kGpB07E0zB2RgrfE1AW2Xd1sHJu+e8PE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753347374; c=relaxed/simple; bh=LviThTNa7WFSySQCtkVWg9h/yH8uPysYxenL5Gkm01I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AWIuax/fEfCE3nZKX4/epUYa++si6+e2LV9ZXyun8XXE3/VqQ4g9buFPLZC8fg3LmzGaE0AfdMr6T13IRSOJkDQZmbQVixugPGNz8cCNdD+bhaaTy3UQprEylBfV9mc5r/W1SkH1nUQQ2MdCPZrX0QlZNPPsCtkb/SXeqNdAquk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4bnlHg1L12z27j13; Thu, 24 Jul 2025 16:57:03 +0800 (CST) Received: from kwepemj200003.china.huawei.com (unknown [7.202.194.15]) by mail.maildlp.com (Postfix) with ESMTPS id B92011A016C; Thu, 24 Jul 2025 16:56:02 +0800 (CST) Received: from localhost.huawei.com (10.90.31.46) by kwepemj200003.china.huawei.com (7.202.194.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 24 Jul 2025 16:56:02 +0800 From: Qinxin Xia To: <21cnbao@gmail.com>, , , CC: , , , , Subject: [PATCH 2/2] dma-mapping: benchmark: Add padding to ensure uABI remained consistent Date: Thu, 24 Jul 2025 16:56:00 +0800 Message-ID: <20250724085600.4101321-3-xiaqinxin@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250724085600.4101321-1-xiaqinxin@huawei.com> References: <20250724085600.4101321-1-xiaqinxin@huawei.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-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To kwepemj200003.china.huawei.com (7.202.194.15) Content-Type: text/plain; charset="utf-8" The padding field in the structure was previously reserved to maintain a stable interface for potential new fields, ensuring compatibility with user-space shared data structures. However,it was accidentally removed by tiantao in a prior commit, which may lead to incompatibility between user space and the kernel. This patch reinstates the padding to restore the original structure layout and preserve compatibility. Fixes: 8ddde07a3d28 ("dma-mapping: benchmark: extract a common header file = for map_benchmark definition") Cc: stable@vger.kernel.org Acked-by: Barry Song Signed-off-by: Qinxin Xia --- include/linux/map_benchmark.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/map_benchmark.h b/include/linux/map_benchmark.h index 62674c83bde4..2ac2fe52f248 100644 --- a/include/linux/map_benchmark.h +++ b/include/linux/map_benchmark.h @@ -27,5 +27,6 @@ struct map_benchmark { __u32 dma_dir; /* DMA data direction */ __u32 dma_trans_ns; /* time for DMA transmission in ns */ __u32 granule; /* how many PAGE_SIZE will do map/unmap once a time */ + __u8 expansion[76]; /* For future use */ }; #endif /* _KERNEL_DMA_BENCHMARK_H */ --=20 2.33.0