From mboxrd@z Thu Jan 1 00:00:00 1970 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 C911D22A80E for ; Fri, 16 May 2025 01:40:44 +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=1747359647; cv=none; b=ov/NMH28UjgkACHEgU66pvEX4XxidPbhDuxWxjzb9ltE7rvkSXaBI693Ki8P/RUphdPWRxpOQF0FaF+6Mv57osW+wwQLcjG2XpWEbcsGgp63QVtHF76K+iM3r9acIDNDP/4olIAWTkYSQFT/OfE0Sz662m1e9TCM//0WW0NyuA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747359647; c=relaxed/simple; bh=6v7iKCaGXBl/sCIYDYhT3XaQSdPX7ulIlQka7azF4j4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=LafiPBSFgWXzdzJc+QtNIFIe+FhbRiivOwa/H9ld2oNVjwUrytdzDTcn6dNX3Fir9e0Y+YhjGbGMKg6uQQZH8K36Drku4VxqrseCXZBPajZE1I0T0Wj3iLvWIiPpSbZ6U9uRA0kVUu25aQ473nQQRNXxwo7F9KF78UnRjoIjh/k= 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.162.112]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Zz8tq573Kz27hcJ; Fri, 16 May 2025 09:41:23 +0800 (CST) Received: from kwepemj200003.china.huawei.com (unknown [7.202.194.15]) by mail.maildlp.com (Postfix) with ESMTPS id 1B277140149; Fri, 16 May 2025 09:40:36 +0800 (CST) Received: from localhost.huawei.com (10.90.30.45) 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; Fri, 16 May 2025 09:40:35 +0800 From: Qinxin Xia To: <21cnbao@gmail.com>, , CC: , , , , , , , Subject: [PATCH v4 0/4] dma-mapping: benchmark: Add support for dma_map_sg Date: Fri, 16 May 2025 09:40:30 +0800 Message-ID: <20250516014034.1577549-1-xiaqinxin@huawei.com> X-Mailer: git-send-email 2.33.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemj200003.china.huawei.com (7.202.194.15) Modify the framework to adapt to more map modes, add benchmark support for dma_map_sg, and add support sg map mode in ioctl. The result: [root@localhost]# ./dma_map_benchmark -m 1 -g 8 -t 8 -s 30 -d 2 dma mapping mode: DMA_MAP_SG_MODE dma mapping benchmark: threads:8 seconds:30 node:-1 dir:FROM_DEVICE granule/sg_nents: 8 average map latency(us):1.4 standard deviation:0.3 average unmap latency(us):1.3 standard deviation:0.3 [root@localhost]# ./dma_map_benchmark -m 0 -g 8 -t 8 -s 30 -d 2 dma mapping mode: DMA_MAP_SINGLE_MODE dma mapping benchmark: threads:8 seconds:30 node:-1 dir:FROM_DEVICE granule/sg_nents: 8 average map latency(us):1.0 standard deviation:0.3 average unmap latency(us):1.3 standard deviation:0.5 --- Changes since V3: - Address the comments from Barry, change mode to a more specific namespace. - Link: https://lore.kernel.org/all/20250509020238.3378396-1-xiaqinxin@huawei.com/ Changes since V2: - Address the comments from Barry and ALOK, some commit information and function input parameter names are modified to make them more accurate. - Link: https://lore.kernel.org/all/20250506030100.394376-1-xiaqinxin@huawei.com/ Changes since V1: - Address the comments from Barry, added some comments and changed the unmap type to void. - Link: https://lore.kernel.org/lkml/20250212022718.1995504-1-xiaqinxin@huawei.com/ Qinxin Xia (4): dma-mapping: benchmark: Add padding to ensure uABI remained consistent dma-mapping: benchmark: modify the framework to adapt to more map modes dma-mapping: benchmark: add support for dma_map_sg selftests/dma: Add dma_map_sg support for dma_map_benchmark include/linux/map_benchmark.h | 46 +++- kernel/dma/map_benchmark.c | 225 ++++++++++++++++-- .../testing/selftests/dma/dma_map_benchmark.c | 16 +- 3 files changed, 252 insertions(+), 35 deletions(-) -- 2.33.0