1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2020 Dmitry Kozlyuk
4 Running DPDK Applications
5 =========================
7 Grant *Lock pages in memory* Privilege
8 --------------------------------------
10 Use of hugepages ("large pages" in Windows terminology) requires
11 ``SeLockMemoryPrivilege`` for the user running an application.
13 1. Open *Local Security Policy* snap-in, either:
15 * Control Panel / Computer Management / Local Security Policy;
16 * or Win+R, type ``secpol``, press Enter.
18 2. Open *Local Policies / User Rights Assignment / Lock pages in memory.*
20 3. Add desired users or groups to the list of grantees.
22 4. 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.
25 See `Large-Page Support`_ in MSDN for details.
27 .. _Large-Page Support: https://docs.microsoft.com/en-us/windows/win32/memory/large-page-support
33 Access to physical addresses is provided by a kernel-mode driver, virt2phys.
34 It is mandatory at least for using hardware PMDs, but may also be required
37 Refer to documentation in ``dpdk-kmods`` repository for details on system
38 setup, driver build and installation. This driver is not signed, so signature
39 checking must be disabled to load it.
43 Disabling driver signature enforcement weakens OS security.
44 It is discouraged in production environments.
46 Compiled package consists of ``virt2phys.inf``, ``virt2phys.cat``,
47 and ``virt2phys.sys``. It can be installed as follows
48 from Elevated Command Prompt:
50 .. code-block:: console
52 pnputil /add-driver Z:\path\to\virt2phys.inf /install
54 On Windows Server additional steps are required:
56 1. From Device Manager, Action menu, select "Add legacy hardware".
57 2. It will launch the "Add Hardware Wizard". Click "Next".
58 3. Select second option "Install the hardware that I manually select
59 from a list (Advanced)".
60 4. On the next screen, "Kernel bypass" will be shown as a device class.
61 5. Select it, and click "Next".
62 6. The previously installed drivers will now be installed for the
63 "Virtual to physical address translator" device.
65 When loaded successfully, the driver is shown in *Device Manager* as *Virtual
66 to physical address translator* device under *Kernel bypass* category.
67 Installed driver persists across reboots.
69 If DPDK is unable to communicate with the driver, a warning is printed
70 on initialization (debug-level logs provide more details):
74 EAL: Cannot open virt2phys driver interface
78 Run the ``helloworld`` Example
79 ------------------------------
81 Navigate to the examples in the build directory and run `dpdk-helloworld.exe`.
83 .. code-block:: console
85 cd C:\Users\me\dpdk\build\examples
86 dpdk-helloworld.exe -l 0-3