Skip to content

Commit bb4141d

Browse files
kevin-laatz-inteltmonjalo
authored andcommitted
examples/dma: rename ioat application example
Since the APIs have been updated from rawdev to dmadev, the application should also be renamed to match. This patch also includes the documentation updates for the renaming. Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Reviewed-by: Conor Walsh <conor.walsh@intel.com>
1 parent 7fa68f5 commit bb4141d

File tree

8 files changed

+62
-60
lines changed

8 files changed

+62
-60
lines changed

MAINTAINERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ F: lib/dmadev/
462462
F: drivers/dma/skeleton/
463463
F: app/test/test_dmadev*
464464
F: doc/guides/prog_guide/dmadev.rst
465+
M: Kevin Laatz <kevin.laatz@intel.com>
466+
M: Bruce Richardson <bruce.richardson@intel.com>
467+
F: examples/dma/
468+
F: doc/guides/sample_app_ug/dma.rst
465469

466470
Eventdev API
467471
M: Jerin Jacob <jerinj@marvell.com>
@@ -1323,8 +1327,6 @@ IOAT Rawdev - DEPRECATED
13231327
M: Bruce Richardson <bruce.richardson@intel.com>
13241328
F: drivers/raw/ioat/
13251329
F: doc/guides/rawdevs/ioat.rst
1326-
F: examples/ioat/
1327-
F: doc/guides/sample_app_ug/ioat.rst
13281330

13291331
Marvell CNXK BPHY
13301332
M: Jakub Palider <jpalider@marvell.com>

doc/guides/sample_app_ug/ioat.rst renamed to doc/guides/sample_app_ug/dma.rst

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
.. SPDX-License-Identifier: BSD-3-Clause
2-
Copyright(c) 2019 Intel Corporation.
2+
Copyright(c) 2019-2021 Intel Corporation.
33
44
.. include:: <isonum.txt>
55

6-
Packet copying using Intel\ |reg| QuickData Technology
7-
======================================================
6+
Packet copying using DMAdev library
7+
===================================
88

99
Overview
1010
--------
1111

1212
This sample is intended as a demonstration of the basic components of a DPDK
13-
forwarding application and example of how to use IOAT driver API to make
14-
packets copies.
13+
forwarding application and example of how to use the DMAdev API to make a packet
14+
copy application.
1515

1616
Also while forwarding, the MAC addresses are affected as follows:
1717

@@ -29,7 +29,7 @@ Compiling the Application
2929

3030
To compile the sample application see :doc:`compiling`.
3131

32-
The application is located in the ``ioat`` sub-directory.
32+
The application is located in the ``dma`` sub-directory.
3333

3434

3535
Running the Application
@@ -38,8 +38,8 @@ Running the Application
3838
In order to run the hardware copy application, the copying device
3939
needs to be bound to user-space IO driver.
4040

41-
Refer to the "IOAT Rawdev Driver" chapter in the "Rawdev Drivers" document
42-
for information on using the driver.
41+
Refer to the "DMAdev library" chapter in the "Programmers guide" for information
42+
on using the library.
4343

4444
The application requires a number of command line options:
4545

@@ -52,13 +52,13 @@ where,
5252

5353
* p MASK: A hexadecimal bitmask of the ports to configure (default is all)
5454

55-
* q NQ: Number of Rx queues used per port equivalent to CBDMA channels
55+
* q NQ: Number of Rx queues used per port equivalent to DMA channels
5656
per port (default is 1)
5757

5858
* c CT: Performed packet copy type: software (sw) or hardware using
5959
DMA (hw) (default is hw)
6060

61-
* s RS: Size of IOAT rawdev ring for hardware copy mode or rte_ring for
61+
* s RS: Size of dmadev descriptor ring for hardware copy mode or rte_ring for
6262
software copy mode (default is 2048)
6363

6464
* --[no-]mac-updating: Whether MAC address of packets should be changed
@@ -87,15 +87,15 @@ updating issue the command:
8787

8888
.. code-block:: console
8989
90-
$ ./<build_dir>/examples/dpdk-ioat -l 0-2 -n 2 -- -p 0x1 --mac-updating -c sw
90+
$ ./<build_dir>/examples/dpdk-dma -l 0-2 -n 2 -- -p 0x1 --mac-updating -c sw
9191
9292
To run the application in a Linux environment with 2 lcores (the main lcore,
9393
plus one forwarding core), 2 ports (ports 0 and 1), hardware copying and no MAC
9494
updating issue the command:
9595

9696
.. code-block:: console
9797
98-
$ ./<build_dir>/examples/dpdk-ioat -l 0-1 -n 1 -- -p 0x3 --no-mac-updating -c hw
98+
$ ./<build_dir>/examples/dpdk-dma -l 0-1 -n 1 -- -p 0x3 --no-mac-updating -c hw
9999
100100
Refer to the *DPDK Getting Started Guide* for general information on
101101
running applications and the Environment Abstraction Layer (EAL) options.
@@ -120,7 +120,7 @@ The first task is to initialize the Environment Abstraction Layer (EAL).
120120
The ``argc`` and ``argv`` arguments are provided to the ``rte_eal_init()``
121121
function. The value returned is the number of parsed arguments:
122122

123-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
123+
.. literalinclude:: ../../../examples/dma/dmafwd.c
124124
:language: c
125125
:start-after: Init EAL. 8<
126126
:end-before: >8 End of init EAL.
@@ -130,7 +130,7 @@ function. The value returned is the number of parsed arguments:
130130
The ``main()`` also allocates a mempool to hold the mbufs (Message Buffers)
131131
used by the application:
132132

133-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
133+
.. literalinclude:: ../../../examples/dma/dmafwd.c
134134
:language: c
135135
:start-after: Allocates mempool to hold the mbufs. 8<
136136
:end-before: >8 End of allocates mempool to hold the mbufs.
@@ -141,7 +141,7 @@ detail in the "Mbuf Library" section of the *DPDK Programmer's Guide*.
141141

142142
The ``main()`` function also initializes the ports:
143143

144-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
144+
.. literalinclude:: ../../../examples/dma/dmafwd.c
145145
:language: c
146146
:start-after: Initialize each port. 8<
147147
:end-before: >8 End of initializing each port.
@@ -151,9 +151,9 @@ Each port is configured using ``port_init()`` function. The Ethernet
151151
ports are configured with local settings using the ``rte_eth_dev_configure()``
152152
function and the ``port_conf`` struct. The RSS is enabled so that
153153
multiple Rx queues could be used for packet receiving and copying by
154-
multiple CBDMA channels per port:
154+
multiple DMA channels per port:
155155

156-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
156+
.. literalinclude:: ../../../examples/dma/dmafwd.c
157157
:language: c
158158
:start-after: Configuring port to use RSS for multiple RX queues. 8<
159159
:end-before: >8 End of configuring port to use RSS for multiple RX queues.
@@ -165,7 +165,7 @@ and ``rte_eth_tx_queue_setup()`` functions.
165165

166166
The Ethernet port is then started:
167167

168-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
168+
.. literalinclude:: ../../../examples/dma/dmafwd.c
169169
:language: c
170170
:start-after: Start device. 8<
171171
:end-before: >8 End of starting device.
@@ -174,7 +174,7 @@ The Ethernet port is then started:
174174

175175
Finally the Rx port is set in promiscuous mode:
176176

177-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
177+
.. literalinclude:: ../../../examples/dma/dmafwd.c
178178
:language: c
179179
:start-after: RX port is set in promiscuous mode. 8<
180180
:end-before: >8 End of RX port is set in promiscuous mode.
@@ -183,7 +183,7 @@ Finally the Rx port is set in promiscuous mode:
183183

184184
After that each port application assigns resources needed.
185185

186-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
186+
.. literalinclude:: ../../../examples/dma/dmafwd.c
187187
:language: c
188188
:start-after: Assigning each port resources. 8<
189189
:end-before: >8 End of assigning each port resources.
@@ -192,30 +192,30 @@ After that each port application assigns resources needed.
192192
Ring structures are assigned for exchanging packets between lcores for both SW
193193
and HW copy modes.
194194

195-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
195+
.. literalinclude:: ../../../examples/dma/dmafwd.c
196196
:language: c
197197
:start-after: Assign ring structures for packet exchanging. 8<
198198
:end-before: >8 End of assigning ring structures for packet exchanging.
199199
:dedent: 0
200200

201201

202-
When using hardware copy each Rx queue of the port is assigned an
203-
IOAT device (``assign_rawdevs()``) using IOAT Rawdev Driver API
204-
functions:
202+
When using hardware copy each Rx queue of the port is assigned a DMA device
203+
(``assign_dmadevs()``) using DMAdev library API functions:
205204

206-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
205+
.. literalinclude:: ../../../examples/dma/dmafwd.c
207206
:language: c
208-
:start-after: Using IOAT rawdev API functions. 8<
209-
:end-before: >8 End of using IOAT rawdev API functions.
207+
:start-after: Using dmadev API functions. 8<
208+
:end-before: >8 End of using dmadev API functions.
210209
:dedent: 0
211210

212211

213-
The initialization of hardware device is done by ``rte_rawdev_configure()``
214-
function using ``rte_rawdev_info`` struct. After configuration the device is
215-
started using ``rte_rawdev_start()`` function. Each of the above operations
216-
is done in ``configure_rawdev_queue()``.
212+
The initialization of hardware device is done by ``rte_dma_configure()`` and
213+
``rte_dma_vchan_setup()`` functions using the ``rte_dma_conf`` and
214+
``rte_dma_vchan_conf`` structs. After configuration the device is started
215+
using ``rte_dma_start()`` function. Each of the above operations is done in
216+
``configure_dmadev_queue()``.
217217

218-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
218+
.. literalinclude:: ../../../examples/dma/dmafwd.c
219219
:language: c
220220
:start-after: Configuration of device. 8<
221221
:end-before: >8 End of configuration of device.
@@ -237,7 +237,7 @@ The Lcores Launching Functions
237237
As described above, ``main()`` function invokes ``start_forwarding_cores()``
238238
function in order to start processing for each lcore:
239239

240-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
240+
.. literalinclude:: ../../../examples/dma/dmafwd.c
241241
:language: c
242242
:start-after: Start processing for each lcore. 8<
243243
:end-before: >8 End of starting to processfor each lcore.
@@ -248,7 +248,7 @@ using ``rte_eal_remote_launch()``. The configured ports, their number
248248
and number of assigned lcores are stored in user-defined
249249
``rxtx_transmission_config`` struct:
250250

251-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
251+
.. literalinclude:: ../../../examples/dma/dmafwd.c
252252
:language: c
253253
:start-after: Configuring ports and number of assigned lcores in struct. 8<
254254
:end-before: >8 End of configuration of ports and number of assigned lcores.
@@ -260,48 +260,48 @@ corresponding to ports and lcores configuration provided by the user.
260260
The Lcores Processing Functions
261261
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
262262

263-
For receiving packets on each port, the ``ioat_rx_port()`` function is used.
263+
For receiving packets on each port, the ``dma_rx_port()`` function is used.
264264
The function receives packets on each configured Rx queue. Depending on the
265-
mode the user chose, it will enqueue packets to IOAT rawdev channels and
265+
mode the user chose, it will enqueue packets to DMA channels and
266266
then invoke copy process (hardware copy), or perform software copy of each
267267
packet using ``pktmbuf_sw_copy()`` function and enqueue them to an rte_ring:
268268

269-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
269+
.. literalinclude:: ../../../examples/dma/dmafwd.c
270270
:language: c
271-
:start-after: Receive packets on one port and enqueue to IOAT rawdev or rte_ring. 8<
272-
:end-before: >8 End of receive packets on one port and enqueue to IOAT rawdev or rte_ring.
271+
:start-after: Receive packets on one port and enqueue to dmadev or rte_ring. 8<
272+
:end-before: >8 End of receive packets on one port and enqueue to dmadev or rte_ring.
273273
:dedent: 0
274274

275275
The packets are received in burst mode using ``rte_eth_rx_burst()``
276276
function. When using hardware copy mode the packets are enqueued in
277-
copying device's buffer using ``ioat_enqueue_packets()`` which calls
278-
``rte_ioat_enqueue_copy()``. When all received packets are in the
279-
buffer the copy operations are started by calling ``rte_ioat_perform_ops()``.
280-
Function ``rte_ioat_enqueue_copy()`` operates on physical address of
277+
copying device's buffer using ``dma_enqueue_packets()`` which calls
278+
``rte_dma_copy()``. When all received packets are in the
279+
buffer the copy operations are started by calling ``rte_dma_submit()``.
280+
Function ``rte_dma_copy()`` operates on physical address of
281281
the packet. Structure ``rte_mbuf`` contains only physical address to
282282
start of the data buffer (``buf_iova``). Thus the ``rte_pktmbuf_iova()`` API is
283283
used to get the address of the start of the data within the mbuf.
284284

285-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
285+
.. literalinclude:: ../../../examples/dma/dmafwd.c
286286
:language: c
287-
:start-after: Receive packets on one port and enqueue to IOAT rawdev or rte_ring. 8<
288-
:end-before: >8 End of receive packets on one port and enqueue to IOAT rawdev or rte_ring.
287+
:start-after: Receive packets on one port and enqueue to dmadev or rte_ring. 8<
288+
:end-before: >8 End of receive packets on one port and enqueue to dmadev or rte_ring.
289289
:dedent: 0
290290

291291

292292
Once the copies have been completed (this includes gathering the completions in
293293
HW copy mode), the copied packets are enqueued to the ``rx_to_tx_ring``, which
294294
is used to pass the packets to the TX function.
295295

296-
All completed copies are processed by ``ioat_tx_port()`` function. This function
296+
All completed copies are processed by ``dma_tx_port()`` function. This function
297297
dequeues copied packets from the ``rx_to_tx_ring``. Then each packet MAC address is changed
298298
if it was enabled. After that copies are sent in burst mode using ``rte_eth_tx_burst()``.
299299

300300

301-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
301+
.. literalinclude:: ../../../examples/dma/dmafwd.c
302302
:language: c
303-
:start-after: Transmit packets from IOAT rawdev/rte_ring for one port. 8<
304-
:end-before: >8 End of transmitting packets from IOAT.
303+
:start-after: Transmit packets from dmadev/rte_ring for one port. 8<
304+
:end-before: >8 End of transmitting packets from dmadev.
305305
:dedent: 0
306306

307307
The Packet Copying Functions
@@ -311,7 +311,7 @@ In order to perform SW packet copy, there are user-defined functions to first co
311311
the packet metadata (``pktmbuf_metadata_copy()``) and then the packet data
312312
(``pktmbuf_sw_copy()``):
313313

314-
.. literalinclude:: ../../../examples/ioat/ioatfwd.c
314+
.. literalinclude:: ../../../examples/dma/dmafwd.c
315315
:language: c
316316
:start-after: Perform packet copy there is a user-defined function. 8<
317317
:end-before: >8 End of perform packet copy there is a user-defined function.

doc/guides/sample_app_ug/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Sample Applications User Guides
2222
ip_reassembly
2323
kernel_nic_interface
2424
keep_alive
25-
ioat
25+
dma
2626
l2_forward_crypto
2727
l2_forward_job_stats
2828
l2_forward_real_virtual

doc/guides/sample_app_ug/intro.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ examples are highlighted below.
5858
forwarding Graph, or ``l3fwd_graph`` application does forwarding based on IPv4
5959
like a simple router with DPDK Graph framework.
6060

61-
* :doc:`Hardware packet copying<ioat>`: The Hardware packet copying,
62-
or ``ioatfwd`` application demonstrates how to use IOAT rawdev driver for
61+
* :doc:`Hardware packet copying<dma>`: The Hardware packet copying,
62+
or ``dmafwd`` application demonstrates how to use DMAdev library for
6363
copying packets between two threads.
6464

6565
* :doc:`Packet Distributor<dist_app>`: The Packet Distributor

examples/ioat/Makefile renamed to examples/dma/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Copyright(c) 2019 Intel Corporation
33

44
# binary name
5-
APP = ioatfwd
5+
APP = dmafwd
66

77
# all source are stored in SRCS-y
8-
SRCS-y := ioatfwd.c
8+
SRCS-y := dmafwd.c
99

1010
PKGCONF ?= pkg-config
1111

File renamed without changes.

examples/ioat/meson.build renamed to examples/dma/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ allow_experimental_apis = true
1111
deps += ['dmadev']
1212

1313
sources = files(
14-
'ioatfwd.c',
14+
'dmafwd.c',
1515
)

examples/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ all_examples = [
1212
'bond',
1313
'cmdline',
1414
'distributor',
15+
'dma',
1516
'ethtool',
1617
'eventdev_pipeline',
1718
'fips_validation',
1819
'flow_classify',
1920
'flow_filtering',
2021
'helloworld',
21-
'ioat',
2222
'ip_fragmentation',
2323
'ip_pipeline',
2424
'ip_reassembly',

0 commit comments

Comments
 (0)