xref: /dpdk/doc/guides/windows_gsg/run_apps.rst (revision 443b949e17953a1094f80532d600a1ee540f2ba4)
1..  SPDX-License-Identifier: BSD-3-Clause
2    Copyright(c) 2020 Dmitry Kozlyuk
3
4Running DPDK Applications
5=========================
6
7Grant *Lock pages in memory* Privilege
8--------------------------------------
9
10Use of hugepages ("large pages" in Windows terminology) requires
11``SeLockMemoryPrivilege`` for the user running an application.
12
13#. Open *Local Security Policy* snap-in, either:
14
15   * Control Panel / Computer Management / Local Security Policy;
16   * or Win+R, type ``secpol``, press Enter.
17
18#. Open *Local Policies / User Rights Assignment / Lock pages in memory.*
19
20#. Add desired users or groups to the list of grantees.
21
22#. Privilege is applied upon next logon. In particular, if privilege has been
23   granted to current user, a logoff is required before it is available.
24
25See `Large-Page Support`_ in MSDN for details.
26
27.. _Large-Page Support: https://docs.microsoft.com/en-us/windows/win32/memory/large-page-support
28
29
30Install Drivers
31---------------
32
33Certain kernel-mode drivers are required to run DPDK applications.
34Refer to `Windows documentation <https://git.dpdk.org/dpdk-kmods/tree/windows>`_
35in ``dpdk-kmods`` repository for common instructions on system setup,
36driver build and installation.
37The drivers are not signed, so signature enforcement has to be disabled.
38
39.. warning::
40
41    Disabling driver signature enforcement weakens OS security.
42    It is discouraged in production environments.
43
44
45virt2phys
46~~~~~~~~~
47
48Access to physical addresses is provided by a kernel-mode driver, virt2phys.
49It is mandatory for allocating physically-contiguous memory which is required
50by hardware PMDs.
51
52When loaded successfully, the driver is shown in *Device Manager* as *Virtual
53to physical address translator* device under *Kernel bypass* category.
54Installed driver persists across reboots.
55
56If DPDK is unable to communicate with the driver, a warning is printed
57on initialization (debug-level logs provide more details):
58
59.. code-block:: text
60
61    EAL: Cannot open virt2phys driver interface
62
63
64NetUIO
65~~~~~~
66
67NetUIO kernel-mode driver provides access to the device hardware resources.
68It is mandatory for all hardware PMDs, except for mlx5 PMD.
69
70Refer to `NetUIO documentation <https://git.dpdk.org/dpdk-kmods/tree/windows/netuio/README.rst>`_
71in ``dpdk-kmods`` repository for instructions to build and set up the driver.
72Devices supported by NetUIO are listed in ``netuio.inf``.
73The list can be extended in order to try running DPDK with new devices.
74
75
76Run the ``helloworld`` Example
77------------------------------
78
79Navigate to the examples in the build directory and run `dpdk-helloworld.exe`.
80
81.. code-block:: console
82
83    cd C:\Users\me\dpdk\build\examples
84    dpdk-helloworld.exe -l 0-3
85    hello from core 1
86    hello from core 3
87    hello from core 0
88    hello from core 2
89