Skip to contentSkip to conversation

app/dma-perf: introduce dma-perf application

RFC Superseded Cheng Jiang 3 participants 10 messages Sep 15, 2022 – Oct 25, 2022 Arm/Amlogic Meson SoC support

v1 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 app/dma-perf: introduce dma-perf application

There are many high-performance DMA devices supported in DPDK now, and these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are supported for now.

---
 app/meson.build               |   1 +
 app/test-dma-perf/benchmark.c | 537 ++++++++++++++++++++++++++++++++++
 app/test-dma-perf/benchmark.h |  12 +
 app/test-dma-perf/config.ini  |  61 ++++
 app/test-dma-perf/main.c      | 399 +++++++++++++++++++++++++
 app/test-dma-perf/main.h      |  55 ++++
 app/test-dma-perf/meson.build |  16 +
 7 files changed, 1081 insertions(+)
 create mode 100644 app/test-dma-perf/benchmark.c
 create mode 100644 app/test-dma-perf/benchmark.h
 create mode 100644 app/test-dma-perf/config.ini
 create mode 100644 app/test-dma-perf/main.c
 create mode 100644 app/test-dma-perf/main.h
 create mode 100644 app/test-dma-perf/meson.build
app/meson.build +1 -0
index 93d8c15032..3826a10a27 100644
@@ -18,6 +18,7 @@ apps = [
         'test-pmd',
         'test-regex',
         'test-sad',
+        'test-dma-perf',
 ]
 
 default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
app/test-dma-perf/benchmark.c new file +537 -0

537 lines not on this page · raw message

app/test-dma-perf/benchmark.h new file +12 -0
new file mode 100644
index 0000000000..2809985dcc
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2022 Intel Corporation
+ */
+
+#ifndef _BENCHMARK_H_
+#define _BENCHMARK_H_
+
+void dma_copy_benchmark(struct test_configure *cfg);
+
+void cpu_copy_benchmark(struct test_configure *cfg);
+
+#endif /* _BENCHMARK_H_ */
app/test-dma-perf/config.ini new file +61 -0

61 lines not on this page · raw message

app/test-dma-perf/main.c new file +399 -0

400 lines not on this page · raw message

app/test-dma-perf/main.h new file +55 -0

55 lines not on this page · raw message

app/test-dma-perf/meson.build new file +16 -0
new file mode 100644
index 0000000000..71a4a4e378
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019-2022 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+allow_experimental_apis = true
+
+deps += ['dmadev', 'mbuf', 'cfgfile']
+
+sources = files(
+        'main.c',
+        'benchmark.c',
+)
\ No newline at end of file
Signature · 1 line
2.35.1
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines

From: Cheng Jiang [mailto:[email protected]]
Sent: Thursday, 15 September 2022 17.48

There are many high-performance DMA devices supported in DPDK now, and these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the
performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are supported for now.

Quoted 16 lines
---
 app/meson.build               |   1 +
 app/test-dma-perf/benchmark.c | 537 ++++++++++++++++++++++++++++++++++
 app/test-dma-perf/benchmark.h |  12 +
 app/test-dma-perf/config.ini  |  61 ++++
 app/test-dma-perf/main.c      | 399 +++++++++++++++++++++++++
 app/test-dma-perf/main.h      |  55 ++++
 app/test-dma-perf/meson.build |  16 +
 7 files changed, 1081 insertions(+)
 create mode 100644 app/test-dma-perf/benchmark.c
 create mode 100644 app/test-dma-perf/benchmark.h
 create mode 100644 app/test-dma-perf/config.ini
 create mode 100644 app/test-dma-perf/main.c
 create mode 100644 app/test-dma-perf/main.h
 create mode 100644 app/test-dma-perf/meson.build

Excellent, thank you!

Is there any reason for making this a separate application, instead of part of the /app/test/ application?

NB: Someone could have asked the same question about test-compress-dev and similar applications... ;-)

#2 lore raw

Hi,

Replies are inline.

Quoted 47 lines

-----Original Message-----
From: Morten Brørup <[email protected]>
Sent: Friday, September 16, 2022 3:36 PM
To: Jiang, Cheng1 <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; Ding, Xuan <[email protected]>; Ma, WenwuX <[email protected]>; Wang, YuanX <[email protected]>; Yang, YvonneX <[email protected]>; He, Xingguang <[email protected]>
Subject: RE: [RFC] app/dma-perf: introduce dma-perf application

Quoted 4 lines

From: Cheng Jiang [mailto:[email protected]]
Sent: Thursday, 15 September 2022 17.48

There are many high-performance DMA devices supported in DPDK now,

and

Quoted 25 lines

these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are supported for now.

---
 app/meson.build               |   1 +
 app/test-dma-perf/benchmark.c | 537
++++++++++++++++++++++++++++++++++
 app/test-dma-perf/benchmark.h |  12 +  app/test-dma-perf/config.ini
|  61 ++++
 app/test-dma-perf/main.c      | 399 +++++++++++++++++++++++++
 app/test-dma-perf/main.h      |  55 ++++
 app/test-dma-perf/meson.build |  16 +
 7 files changed, 1081 insertions(+)
 create mode 100644 app/test-dma-perf/benchmark.c  create mode 100644
Quoted 5 lines

app/test-dma-perf/benchmark.h create mode 100644 app/test-dma-perf/config.ini create mode 100644 app/test-dma-perf/main.c create mode 100644 app/test-dma-perf/main.h create mode 100644 app/test-dma-perf/meson.build

Quoted 1 line

Excellent, thank you!

Sure, thanks!!

Quoted 7 lines

Is there any reason for making this a separate application, instead of part of the /app/test/ application?

NB: Someone could have asked the same question about test-compress-dev and similar applications... ;-)

First of all, this application is specifically used to test the performance of DMA device, and does not involve functional testing. So I'm not sure whether it is suitable for the app/test.
Secondly, the configuration and switching of many test scenarios are involved here, so we think it may be a more appropriate to be an independent application.

Quoted 2 lines

Thanks for your acknowledgement.
Cheng

#3 lore raw
Quoted 8 lines

From: Jiang, Cheng1 [mailto:[email protected]]
Sent: Monday, 19 September 2022 10.10

Quoted 5 lines

From: Morten Brørup <[email protected]>
Sent: Friday, September 16, 2022 3:36 PM

Quoted 2 lines

From: Cheng Jiang [mailto:[email protected]]
Sent: Thursday, 15 September 2022 17.48

[...]

Quoted 5 lines
Quoted 1 line

Is there any reason for making this a separate application, instead

of part of

Quoted 3 lines

the /app/test/ application?

Quoted 7 lines
Quoted 1 line

NB: Someone could have asked the same question about test-compress-

dev

Quoted 1 line

and similar applications... ;-)

First of all, this application is specifically used to test the performance of DMA device, and does not involve functional testing. So I'm not sure whether it is suitable for the app/test.

Good point.

Quoted 3 lines

Secondly, the configuration and switching of many test scenarios are involved here, so we think it may be a more appropriate to be an independent application.

Makes sense to me. The independent application might provide more flexibility.

Quoted 6 lines
Quoted 3 lines

Thanks for your acknowledgement.
Cheng

#4 lore raw

RFC v2 1/1 app/dma-perf: introduce dma-perf application

In reply to Cheng Jiang

There are many high-performance DMA devices supported in DPDK now, and these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are supported for now.

---
v2: fixed some CI issues.

 app/meson.build               |   1 +
 app/test-dma-perf/benchmark.c | 543 ++++++++++++++++++++++++++++++++++
 app/test-dma-perf/benchmark.h |  12 +
 app/test-dma-perf/config.ini  |  61 ++++
 app/test-dma-perf/main.c      | 404 +++++++++++++++++++++++++
 app/test-dma-perf/main.h      |  55 ++++
 app/test-dma-perf/meson.build |  16 +
 7 files changed, 1092 insertions(+)
 create mode 100644 app/test-dma-perf/benchmark.c
 create mode 100644 app/test-dma-perf/benchmark.h
 create mode 100644 app/test-dma-perf/config.ini
 create mode 100644 app/test-dma-perf/main.c
 create mode 100644 app/test-dma-perf/main.h
 create mode 100644 app/test-dma-perf/meson.build
app/meson.build +1 -0
index 93d8c15032..3826a10a27 100644
@@ -18,6 +18,7 @@ apps = [
         'test-pmd',
         'test-regex',
         'test-sad',
+        'test-dma-perf',
 ]
 
 default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
app/test-dma-perf/benchmark.c new file +543 -0

543 lines not on this page · raw message

app/test-dma-perf/benchmark.h new file +12 -0
new file mode 100644
index 0000000000..2809985dcc
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2022 Intel Corporation
+ */
+
+#ifndef _BENCHMARK_H_
+#define _BENCHMARK_H_
+
+void dma_copy_benchmark(struct test_configure *cfg);
+
+void cpu_copy_benchmark(struct test_configure *cfg);
+
+#endif /* _BENCHMARK_H_ */
app/test-dma-perf/config.ini new file +61 -0

61 lines not on this page · raw message

app/test-dma-perf/main.c new file +404 -0

404 lines not on this page · raw message

app/test-dma-perf/main.h new file +55 -0

55 lines not on this page · raw message

app/test-dma-perf/meson.build new file +16 -0
new file mode 100644
index 0000000000..931df6ed54
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019-2022 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+allow_experimental_apis = true
+
+deps += ['dmadev', 'mbuf', 'cfgfile']
+
+sources = files(
+        'main.c',
+        'benchmark.c',
+)

--
2.35.1

#5 lore raw

RFC v3 1/1 app/dma-perf: introduce dma-perf application

In reply to Cheng Jiang

There are many high-performance DMA devices supported in DPDK now, and these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are supported for now.

---
v3: improved nr_buf calculation and added support for getting subprocess exit status
v2: fixed some CI issues.

 app/meson.build               |   1 +
 app/test-dma-perf/benchmark.c | 538 ++++++++++++++++++++++++++++++++++
 app/test-dma-perf/benchmark.h |  12 +
 app/test-dma-perf/config.ini  |  61 ++++
 app/test-dma-perf/main.c      | 417 ++++++++++++++++++++++++++
 app/test-dma-perf/main.h      |  55 ++++
 app/test-dma-perf/meson.build |  16 +
 7 files changed, 1100 insertions(+)
 create mode 100644 app/test-dma-perf/benchmark.c
 create mode 100644 app/test-dma-perf/benchmark.h
 create mode 100644 app/test-dma-perf/config.ini
 create mode 100644 app/test-dma-perf/main.c
 create mode 100644 app/test-dma-perf/main.h
 create mode 100644 app/test-dma-perf/meson.build
app/meson.build +1 -0
index 93d8c15032..3826a10a27 100644
@@ -18,6 +18,7 @@ apps = [
         'test-pmd',
         'test-regex',
         'test-sad',
+        'test-dma-perf',
 ]
 
 default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
app/test-dma-perf/benchmark.c new file +538 -0

538 lines not on this page · raw message

app/test-dma-perf/benchmark.h new file +12 -0
new file mode 100644
index 0000000000..2809985dcc
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2022 Intel Corporation
+ */
+
+#ifndef _BENCHMARK_H_
+#define _BENCHMARK_H_
+
+void dma_copy_benchmark(struct test_configure *cfg);
+
+void cpu_copy_benchmark(struct test_configure *cfg);
+
+#endif /* _BENCHMARK_H_ */
app/test-dma-perf/config.ini new file +61 -0

61 lines not on this page · raw message

app/test-dma-perf/main.c new file +417 -0

417 lines not on this page · raw message

app/test-dma-perf/main.h new file +55 -0

55 lines not on this page · raw message

app/test-dma-perf/meson.build new file +16 -0
new file mode 100644
index 0000000000..931df6ed54
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019-2022 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+allow_experimental_apis = true
+
+deps += ['dmadev', 'mbuf', 'cfgfile']
+
+sources = files(
+        'main.c',
+        'benchmark.c',
+)

--
2.35.1

#6 lore raw
Quoted 12 lines · Cheng Jiang

There are many high-performance DMA devices supported in DPDK now, and these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are supported for now.

Quoted 7 lines

---
v3: improved nr_buf calculation and added support for getting subprocess exit status
v2: fixed some CI issues.

There is still at least one build issue.

Signature · 1 line
David Marchand
#7 lore raw

Sure, I'll take a look and fix them in the next version.

Thanks,
Cheng

Quoted 42 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, October 21, 2022 9:29 PM
To: Jiang, Cheng1 <[email protected]>
Cc: [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Hu, Jiayu <[email protected]>; Ding, Xuan <[email protected]>; Ma, WenwuX <[email protected]>; Wang, YuanX <[email protected]>; Yang, YvonneX <[email protected]>; He, Xingguang <[email protected]>
Subject: Re: [RFC v3] app/dma-perf: introduce dma-perf application

Quoted 2 lines · Cheng Jiang

There are many high-performance DMA devices supported in DPDK now,

and

Quoted 9 lines

these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are

supported for now.

Quoted 9 lines

---
v3: improved nr_buf calculation and added support for getting subprocess exit status
v2: fixed some CI issues.

There is still at least one build issue.

--
David Marchand

#8 lore raw

RFC v4 1/1 app/dma-perf: introduce dma-perf application

In reply to Cheng Jiang

There are many high-performance DMA devices supported in DPDK now, and these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are supported for now.

---
v4: fixed some building issues.
v3: improved nr_buf calculation and added support for getting subprocess exit status.
v2: fixed some CI issues.

 app/meson.build               |   1 +
 app/test-dma-perf/benchmark.c | 537 ++++++++++++++++++++++++++++++++++
 app/test-dma-perf/benchmark.h |  12 +
 app/test-dma-perf/config.ini  |  61 ++++
 app/test-dma-perf/main.c      | 416 ++++++++++++++++++++++++++
 app/test-dma-perf/main.h      |  55 ++++
 app/test-dma-perf/meson.build |  16 +
 7 files changed, 1098 insertions(+)
 create mode 100644 app/test-dma-perf/benchmark.c
 create mode 100644 app/test-dma-perf/benchmark.h
 create mode 100644 app/test-dma-perf/config.ini
 create mode 100644 app/test-dma-perf/main.c
 create mode 100644 app/test-dma-perf/main.h
 create mode 100644 app/test-dma-perf/meson.build
app/meson.build +1 -0
index 93d8c15032..3826a10a27 100644
@@ -18,6 +18,7 @@ apps = [
         'test-pmd',
         'test-regex',
         'test-sad',
+        'test-dma-perf',
 ]
 
 default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
app/test-dma-perf/benchmark.c new file +537 -0

537 lines not on this page · raw message

app/test-dma-perf/benchmark.h new file +12 -0
new file mode 100644
index 0000000000..2809985dcc
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2022 Intel Corporation
+ */
+
+#ifndef _BENCHMARK_H_
+#define _BENCHMARK_H_
+
+void dma_copy_benchmark(struct test_configure *cfg);
+
+void cpu_copy_benchmark(struct test_configure *cfg);
+
+#endif /* _BENCHMARK_H_ */
app/test-dma-perf/config.ini new file +61 -0

61 lines not on this page · raw message

app/test-dma-perf/main.c new file +416 -0

416 lines not on this page · raw message

app/test-dma-perf/main.h new file +55 -0

55 lines not on this page · raw message

app/test-dma-perf/meson.build new file +16 -0
new file mode 100644
index 0000000000..931df6ed54
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019-2022 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+allow_experimental_apis = true
+
+deps += ['dmadev', 'mbuf', 'cfgfile']
+
+sources = files(
+        'main.c',
+        'benchmark.c',
+)

--
2.35.1

#9 lore raw

RFC v5 1/1 app/dma-perf: introduce dma-perf application

In reply to Cheng Jiang

There are many high-performance DMA devices supported in DPDK now, and these DMA devices can also be integrated into other modules of DPDK as accelerators, such as Vhost. Before integrating DMA into applications, developers need to know the performance of these DMA devices in various scenarios and the performance of CPUs in the same scenario, such as different buffer lengths. Only in this way can we know the target performance of the application accelerated by using them. This patch introduces a high-performance testing tool, which supports comparing the performance of CPU and DMA in different scenarios automatically with a pre-set config file. Memory Copy performance test are supported for now.

---
v5: fixed some typos.
v4: fixed some building issues.
v3: improved nr_buf calculation and added support for getting subprocess exit status.
v2: fixed some CI issues.

 app/meson.build               |   1 +
 app/test-dma-perf/benchmark.c | 537 ++++++++++++++++++++++++++++++++++
 app/test-dma-perf/benchmark.h |  12 +
 app/test-dma-perf/config.ini  |  61 ++++
 app/test-dma-perf/main.c      | 416 ++++++++++++++++++++++++++
 app/test-dma-perf/main.h      |  55 ++++
 app/test-dma-perf/meson.build |  16 +
 7 files changed, 1098 insertions(+)
 create mode 100644 app/test-dma-perf/benchmark.c
 create mode 100644 app/test-dma-perf/benchmark.h
 create mode 100644 app/test-dma-perf/config.ini
 create mode 100644 app/test-dma-perf/main.c
 create mode 100644 app/test-dma-perf/main.h
 create mode 100644 app/test-dma-perf/meson.build
app/meson.build +1 -0
index 93d8c15032..3826a10a27 100644
@@ -18,6 +18,7 @@ apps = [
         'test-pmd',
         'test-regex',
         'test-sad',
+        'test-dma-perf',
 ]
 
 default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
app/test-dma-perf/benchmark.c new file +537 -0

537 lines not on this page · raw message

app/test-dma-perf/benchmark.h new file +12 -0
new file mode 100644
index 0000000000..f5ad8d6d99
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2022 Intel Corporation
+ */
+
+#ifndef _BENCHMARK_H_
+#define _BENCHMARK_H_
+
+void dma_mem_copy_benchmark(struct test_configure *cfg);
+
+void cpu_mem_copy_benchmark(struct test_configure *cfg);
+
+#endif /* _BENCHMARK_H_ */
app/test-dma-perf/config.ini new file +61 -0

61 lines not on this page · raw message

app/test-dma-perf/main.c new file +416 -0

416 lines not on this page · raw message

app/test-dma-perf/main.h new file +55 -0

55 lines not on this page · raw message

app/test-dma-perf/meson.build new file +16 -0
new file mode 100644
index 0000000000..931df6ed54
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019-2022 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+allow_experimental_apis = true
+
+deps += ['dmadev', 'mbuf', 'cfgfile']
+
+sources = files(
+        'main.c',
+        'benchmark.c',
+)

--
2.35.1