diff options
Diffstat (limited to 'doc/book-enea-nfv-access-platform-guide/doc/dpdk.xml')
-rw-r--r-- | doc/book-enea-nfv-access-platform-guide/doc/dpdk.xml | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/doc/book-enea-nfv-access-platform-guide/doc/dpdk.xml b/doc/book-enea-nfv-access-platform-guide/doc/dpdk.xml new file mode 100644 index 0000000..91b36d3 --- /dev/null +++ b/doc/book-enea-nfv-access-platform-guide/doc/dpdk.xml | |||
@@ -0,0 +1,118 @@ | |||
1 | <?xml version="1.0" encoding="ISO-8859-1"?> | ||
2 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | ||
4 | <chapter id="dpdk"> | ||
5 | <title>Data Plane Development Kit</title> | ||
6 | |||
7 | <para>The Intel Data Plane Development Kit (DPDK) is a set of user-space | ||
8 | libraries and drivers that provides a programming framework for high-speed | ||
9 | packet processing applications. The DPDK includes a number of Poll Mode | ||
10 | Drivers that enable direct packet transfer between the physical NIC and | ||
11 | user-space without using interrupts, bypassing the Linux kernel network | ||
12 | stack entirely.</para> | ||
13 | |||
14 | <para>In order to take advantage of DPDK, Linux <ulink | ||
15 | url="https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt">huge | ||
16 | pages</ulink> must be enabled in the system. The allocation of huge pages | ||
17 | should preferably be done at boot time by passing parameters on the kernel | ||
18 | command line. Add the following to the kernel boot parameters:</para> | ||
19 | |||
20 | <programlisting>default_hugepagesz=1GB hugepagesz=1GB hugepages=8 hugepagesz=2M hugepages=2048</programlisting> | ||
21 | |||
22 | <para>For DPDK documentation, see <ulink | ||
23 | url="http://dpdk.org/doc/guides-17.02/index.html">http://dpdk.org/doc/guides-17.02/index.html</ulink></para> | ||
24 | |||
25 | <section id="pktgen"> | ||
26 | <title>Pktgen</title> | ||
27 | |||
28 | <para>In addition to DPDK, Enea NFV Access Platform includes Pktgen, a | ||
29 | software traffic generator that is powered by the DPDK packet processing | ||
30 | framework. Pktgen can act as a transmitter or receiver and is capable of | ||
31 | generating 10Gbit wire rate traffic with 64 byte frames.</para> | ||
32 | |||
33 | <para>Pktgen is installed in <literal>/usr/share/apps/pktgen/</literal> | ||
34 | and needs to be executed from this directory.</para> | ||
35 | |||
36 | <para>For Pktgen documentation, see <ulink | ||
37 | url="http://pktgen-dpdk.readthedocs.io">http://pktgen-dpdk.readthedocs.io</ulink></para> | ||
38 | </section> | ||
39 | |||
40 | <section id="dpdk-setup"> | ||
41 | <title>DPDK setup instructions</title> | ||
42 | |||
43 | <para>The following setup instructions apply to both host and | ||
44 | guest.</para> | ||
45 | |||
46 | <orderedlist> | ||
47 | <listitem> | ||
48 | <para>To make the hugepage memory available for DPDK, it must be | ||
49 | mounted:</para> | ||
50 | |||
51 | <programlisting>mkdir /mnt/huge | ||
52 | mount -t hugetlbfs nodev /mnt/huge</programlisting> | ||
53 | </listitem> | ||
54 | |||
55 | <listitem> | ||
56 | <para>Load the DPDK igb_uio kernel module:</para> | ||
57 | |||
58 | <programlisting>modprobe igb_uio</programlisting> | ||
59 | </listitem> | ||
60 | |||
61 | <listitem> | ||
62 | <para>Bind the device to the igb_uio driver:</para> | ||
63 | |||
64 | <para><programlisting>dpdk-devbind --bind=igb_uio <PCI device number></programlisting>The | ||
65 | DPDK provides the dpdk-devbind tool to help binding/unbinding devices | ||
66 | from specific drivers. See <ulink | ||
67 | url="http://dpdk.org/doc/guides-17.02/tools/devbind.html">http://dpdk.org/doc/guides-17.02/tools/devbind.html</ulink> | ||
68 | for more information.</para> | ||
69 | </listitem> | ||
70 | </orderedlist> | ||
71 | |||
72 | <para>To print the current status of all known network | ||
73 | interfaces:<programlisting>dpdk-devbind --status</programlisting></para> | ||
74 | |||
75 | <para>At this point the system is ready to run DPDK applications.</para> | ||
76 | </section> | ||
77 | |||
78 | <section id="dpdk-example-test-setup"> | ||
79 | <title>DPDK example test setup</title> | ||
80 | |||
81 | <para>This is a simple DPDK test setup using two boards connected | ||
82 | back-to-back. One board generates traffic using the Pktgen application, | ||
83 | and the other board runs the DPDK testpmd example to forward packets back | ||
84 | on the same interface.</para> | ||
85 | |||
86 | <programlisting>Pktgen [DPDK] - Board 1 PHY <--> Board 2 PHY - [DPDK] testpmd</programlisting> | ||
87 | |||
88 | <orderedlist> | ||
89 | <listitem> | ||
90 | <para>Setup DPDK on both boards, following the instructions in | ||
91 | [FIXME]:</para> | ||
92 | </listitem> | ||
93 | |||
94 | <listitem> | ||
95 | <para>On board 1, start the Pktgen application:</para> | ||
96 | |||
97 | <programlisting>cd /usr/share/apps/pktgen/./pktgen -c 0x7 -n 4 --socket-mem 1024 -- -P -m "[1:2].0"</programlisting> | ||
98 | |||
99 | <para>In the Pktgen console, run:</para> | ||
100 | |||
101 | <programlisting>start 0</programlisting> | ||
102 | |||
103 | <para>The Pktgen output will display the traffic configuration and | ||
104 | statistics.</para> | ||
105 | </listitem> | ||
106 | |||
107 | <listitem> | ||
108 | <para>On board 2, start the testpmd application:</para> | ||
109 | |||
110 | <programlisting>testpmd -c 0x7 -n 4 -- --txd=512 --rxd=512 --port-topology=chained</programlisting> | ||
111 | |||
112 | <para>For more information, refer to the testpmd application user | ||
113 | guide: <ulink | ||
114 | url="http://dpdk.org/doc/guides-17.02/testpmd_app_ug/index.html">http://dpdk.org/doc/guides-17.02/testpmd_app_ug/index.html</ulink>.</para> | ||
115 | </listitem> | ||
116 | </orderedlist> | ||
117 | </section> | ||
118 | </chapter> \ No newline at end of file | ||