You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-network/setup-dpdk.md
+29-27
Original file line number
Diff line number
Diff line change
@@ -17,26 +17,26 @@ ms.date: 07/27/2018
17
17
ms.author: labattul
18
18
19
19
---
20
-
# Setup DPDK in a Linux virtual machine
20
+
# Set up DPDK in a Linux virtual machine
21
21
22
-
Data Plane Development Kit (DPDK) on Azure offers a faster userspace packet processing framework for performanceintensive applications that bypass the virtual machine’s kernel network stack.
22
+
Data Plane Development Kit (DPDK) on Azure offers a faster user-space packet processing framework for performance-intensive applications. This framework bypasses the virtual machine’s kernel network stack.
23
23
24
-
Typical packet processing using the kernel network stackis interruptdriven. Each time the network interface receives incoming packets, there is a kernel interrupt to process the packet and context switch from kernel space to user space. DPDK eliminates context switching and the interruptdriven method in favor of a userspace implementation using poll mode drivers for fast packet processing.
24
+
In typical packet processing that uses the kernel network stack, the process is interrupt-driven. When the network interface receives incoming packets, there is a kernel interrupt to process the packet and a context switch from the kernel space to the user space. DPDK eliminates context switching and the interrupt-driven method in favor of a user-space implementation that uses poll mode drivers for fast packet processing.
25
25
26
-
DPDK consists of set of userspace libraries providing access to lower-level resources such as hardware, logical cores, memory management, and poll mode drivers for network interface cards.
26
+
DPDK consists of sets of user-space libraries that provide access to lower-level resources. These resources can include hardware, logical cores, memory management, and poll mode drivers for network interface cards.
27
27
28
-
DPDK can run in Azure virtual machines, supporting multiple operating system distributions. DPDK provides a key performance differentiation in driving network function virtualization implementations, in the form of network virtual appliances (NVA) such as a virtual router, firewall, VPN, load balancer, evolved packet core, and denial-of-service (DDoS) applications.
28
+
DPDK can run on Azure virtual machines that are supporting multiple operating system distributions. DPDK provides key performance differentiation in driving network function virtualization implementations. These implementations can take the form of network virtual appliances (NVAs), such as virtual routers, firewalls, VPNs, load balancers, evolved packet cores, and denial-of-service (DDoS) applications.
29
29
30
30
## Benefit
31
31
32
-
**Higher packets per second (PPS)**: Bypassing the kernel and taking control of packets in user space reduces the cycle count by eliminating context switch and improves the rate of packets processed per second in Azure Linux virtual machines.
32
+
**Higher packets per second (PPS)**: Bypassing the kernel and taking control of packets in the user space reduces the cycle count by eliminating context switches. It also improves the rate of packets that are processed per second in Azure Linux virtual machines.
33
33
34
34
35
35
## Supported operating systems
36
36
37
37
The following distributions from the Azure Gallery are supported:
38
38
39
-
| Linux OS | Kernel Version|
39
+
| Linux OS | Kernel version|
40
40
|--------------|---------------- |
41
41
| Ubuntu 16.04 | 4.15.0-1015-azure |
42
42
| Ubuntu 18.04 | 4.15.0-1015-azure |
@@ -46,7 +46,7 @@ The following distributions from the Azure Gallery are supported:
46
46
47
47
**Custom kernel support**
48
48
49
-
Refer to [Patches for building an Azure-tuned Linux kernel](https://github.com/microsoft/azure-linux-kernel) for any Linux kernel version not listed, or for further information, contact [azuredpdk@microsoft.com](mailto:azuredpdk@microsoft.com).
49
+
For any Linux kernel version that's not listed, see [Patches for building an Azure-tuned Linux kernel](https://github.com/microsoft/azure-linux-kernel). For more information, you can also contact [azuredpdk@microsoft.com](mailto:azuredpdk@microsoft.com).
50
50
51
51
## Region support
52
52
@@ -101,17 +101,17 @@ zypper \
101
101
--gpg-auto-import-keys install kernel-default-devel gcc make libnuma-devel numactl librdmacm1 rdma-core-devel
102
102
```
103
103
104
-
## Setup virtual machine environment (once)
104
+
## Set up the virtual machine environment (once)
105
105
106
106
1.[Download the latest DPDK](https://core.dpdk.org/download). Version 18.02 or higher is required for Azure.
107
-
2.First build the default config with `make config T=x86_64-native-linuxapp-gcc`.
107
+
2.Build the default config with `make config T=x86_64-native-linuxapp-gcc`.
108
108
3. Enable Mellanox PMDs in the generated config with `sed -ri 's,(MLX._PMD=)n,\1y,' build/.config`.
109
109
4. Compile with `make`.
110
110
5. Install with `make install DESTDIR=<output folder>`.
111
111
112
-
# Configure runtime environment
112
+
##Configure the runtime environment
113
113
114
-
Run the following commands once, after rebooting:
114
+
After restarting, run the following commands once:
115
115
116
116
1. Hugepages
117
117
@@ -124,27 +124,29 @@ Run the following commands once, after rebooting:
124
124
125
125
* Create a directory for mounting with `mkdir /mnt/huge`.
126
126
* Mount hugepages with `mount -t hugetlbfs nodev /mnt/huge`.
127
-
* Check hugepages are reserved with `grep Huge /proc/meminfo`.
127
+
* Check that hugepages are reserved with `grep Huge /proc/meminfo`.
128
128
129
129
> [!NOTE]
130
-
> There is a way to modify the grub file so that huge pages are reserved on boot by following the [instructions](http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html#use-of-hugepages-in-the-linux-environment) forDPDK. The instruction is at the bottom of the page. When runningin an Azure Linux virtual machine, modify files under /etc/config/grub.d instead, to reserve hugepages across reboots.
130
+
> There is a way to modify the grub file so that hugepages are reserved on boot by following the [instructions](http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html#use-of-hugepages-in-the-linux-environment) forthe DPDK. The instructions are at the bottom of the page. When you're using an Azure Linux virtual machine, modify files under **/etc/config/grub.d** instead, to reserve hugepages across reboots.
131
131
132
-
2. MAC & IP addresses: Use `ifconfig –a` to view the MAC and IP address of the network interfaces. The *VF* network interface and *NETVSC* network interface have the same MAC address, but only the *NETVSC* network interface has an IP address. VF interfaces are running as slave interfaces of NETVSC interfaces.
132
+
2. MAC & IP addresses: Use `ifconfig –a` to view the MAC and IP address of the network interfaces. The *VF* network interface and *NETVSC* network interface have the same MAC address, but only the *NETVSC* network interface has an IP address. VF interfaces are running as subordinate interfaces of NETVSC interfaces.
133
133
134
134
3. PCI addresses
135
135
136
-
*Find out which PCI address to use for*VF* with `ethtool -i <vf interface name>`.
137
-
*Ensure that testpmd doesn’t accidentally take over the VF pci device for*eth0*, if*eth0* has accelerated networking enabled. If DPDK application has accidentally taken over the management network interface and causes loss of your SSH connection, use the serial console to killDPDK application, or to stop or start the virtual machine.
136
+
* Use `ethtool -i <vf interface name>` to find out which PCI address to use for *VF*.
137
+
* If *eth0* has accelerated networking enabled, make sure that testpmd doesn’t accidentally take over the VF pci device for *eth0*. If the DPDK application accidentally takes over the management network interface and causes you to lose your SSH connection, use the serial console to stop the DPDK application. You can also use the serial console to stop or start the virtual machine.
138
138
139
139
4. Load *ibuverbs* on each reboot with `modprobe -a ib_uverbs`. For SLES 15 only, also load *mlx4_ib* with `modprobe -a mlx4_ib`.
140
140
141
141
## Failsafe PMD
142
142
143
-
DPDK applications must run over the failsafe PMD that is exposed in Azure. If the application runs directly over the VF PMD, it will not receive **all** packets destined to the VM, since some packets will show up over the synthetic interface. Running over the failsafe PMD guarantees that the application receives all packets destined to it and also ensures the application will continue to run in DPDK mode, even if the VF is revoked when the host is being serviced. For more information on failsafe PMD, refer to [Fail-safe poll mode driver library](http://doc.dpdk.org/guides/nics/fail_safe.html).
143
+
DPDK applications must run over the failsafe PMD that is exposed in Azure. If the application runs directly over the VF PMD, it doesn't receive **all** packets that are destined to the VM, since some packets show up over the synthetic interface.
144
+
145
+
If you run a DPDK application over the failsafe PMD, it guarantees that the application receives all packets that are destined to it. It also makes sure that the application keeps running in DPDK mode, even if the VF is revoked when the host is being serviced. For more information about failsafe PMD, see [Fail-safe poll mode driver library](http://doc.dpdk.org/guides/nics/fail_safe.html).
144
146
145
147
## Run testpmd
146
148
147
-
Use `sudo` before the *testpmd*command to run in root mode.
149
+
To run testpmd in root mode, use `sudo` before the *testpmd* command.
@@ -167,12 +169,12 @@ Use `sudo` before the *testpmd* command to run in root mode.
167
169
-- -i
168
170
```
169
171
170
-
If running with more than 2 NICs, the `--vdev` argument follows this pattern: `net_vdev_netvsc<id>,iface=<vf’s pairing eth>`.
172
+
If you're running testpmd with more than two NICs, the `--vdev` argument follows this pattern: `net_vdev_netvsc<id>,iface=<vf’s pairing eth>`.
171
173
172
-
3. Once started, run `show port info all` to check port information. You should see one or two DPDK ports that are net_failsafe (not *net_mlx4*).
174
+
3. After it's started, run `show port info all` to check port information. You should see one or two DPDK ports that are net_failsafe (not *net_mlx4*).
173
175
4. Use `start <port> /stop <port>` to start traffic.
174
176
175
-
The previous commands start *testpmd*in interactive mode, which is recommended, to try out some testpmd commands.
177
+
The previous commands start *testpmd*in interactive mode, which is recommendedfor trying out testpmd commands.
176
178
177
179
### Basic: Single sender/single receiver
178
180
@@ -184,7 +186,7 @@ The following commands periodically print the packets per second statistics:
184
186
testpmd \
185
187
-l <core-list> \
186
188
-n <num of mem channels> \
187
-
-w <pci address of the device intended to use> \
189
+
-w <pci address of the device you plan to use> \
188
190
--vdev="net_vdev_netvsc<id>,iface=<the iface to attach to>" \
189
191
-- --port-topology=chained \
190
192
--nb-cores <number of cores to use fortest pmd> \
@@ -199,7 +201,7 @@ The following commands periodically print the packets per second statistics:
199
201
testpmd \
200
202
-l <core-list> \
201
203
-n <num of mem channels> \
202
-
-w <pci address of the device intended to use> \
204
+
-w <pci address of the device you plan to use> \
203
205
--vdev="net_vdev_netvsc<id>,iface=<the iface to attach to>" \
204
206
-- --port-topology=chained \
205
207
--nb-cores <number of cores to use fortest pmd> \
@@ -208,7 +210,7 @@ The following commands periodically print the packets per second statistics:
208
210
--stats-period <display interval in seconds>
209
211
```
210
212
211
-
When running the previous commands on a virtual machine, change *IP_SRC_ADDR* and *IP_DST_ADDR*in`app/test-pmd/txonly.c` to match the actual IP address of the virtual machines before you compile. Otherwise, the packets are dropped before reaching the receiver.
213
+
When you're running the previous commands on a virtual machine, change *IP_SRC_ADDR* and *IP_DST_ADDR* in `app/test-pmd/txonly.c` to match the actual IP address of the virtual machines before you compile. Otherwise, the packets are dropped before reaching the receiver.
212
214
213
215
### Advanced: Single sender/single forwarder
214
216
The following commands periodically print the packets per second statistics:
@@ -219,7 +221,7 @@ The following commands periodically print the packets per second statistics:
219
221
testpmd \
220
222
-l <core-list> \
221
223
-n <num of mem channels> \
222
-
-w <pci address of the device intended to use> \
224
+
-w <pci address of the device you plan to use> \
223
225
--vdev="net_vdev_netvsc<id>,iface=<the iface to attach to>" \
224
226
-- --port-topology=chained \
225
227
--nb-cores <number of cores to use for test pmd> \
@@ -244,7 +246,7 @@ The following commands periodically print the packets per second statistics:
244
246
--stats-period <display interval in seconds>
245
247
```
246
248
247
-
When running the previous commands on a virtual machine, change *IP_SRC_ADDR* and *IP_DST_ADDR*in`app/test-pmd/txonly.c` to match the actual IP address of the virtual machines before you compile. Otherwise, the packets are dropped before reaching the forwarder. You won’t be able to have a third machine receive forwarded traffic, because the *testpmd* forwarder doesn’t modify the layer3 addresses, unless you make some code changes.
249
+
When you're running the previous commands on a virtual machine, change *IP_SRC_ADDR* and *IP_DST_ADDR*in`app/test-pmd/txonly.c` to match the actual IP address of the virtual machines before you compile. Otherwise, the packets are dropped before reaching the forwarder. You won’t be able to have a third machine receive forwarded traffic, because the *testpmd* forwarder doesn’t modify the layer-3 addresses, unless you make some code changes.
0 commit comments