Skip to content

Commit cf0ad78

Browse files
authored
Merge pull request #52830 from rjagiewich/virtual-network-setup
edit pass - Virtual network setup
2 parents 7eb775e + 8e936bf commit cf0ad78

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

articles/virtual-network/setup-dpdk.md

+29-27
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ ms.date: 07/27/2018
1717
ms.author: labattul
1818

1919
---
20-
# Setup DPDK in a Linux virtual machine
20+
# Set up DPDK in a Linux virtual machine
2121

22-
Data Plane Development Kit (DPDK) on Azure offers a faster user space packet processing framework for performance intensive 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.
2323

24-
Typical packet processing using the kernel network stack is interrupt driven. 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 interrupt driven method in favor of a user space 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.
2525

26-
DPDK consists of set of user space 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.
2727

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.
2929

3030
## Benefit
3131

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.
3333

3434

3535
## Supported operating systems
3636

3737
The following distributions from the Azure Gallery are supported:
3838

39-
| Linux OS | Kernel Version |
39+
| Linux OS | Kernel version |
4040
|--------------|---------------- |
4141
| Ubuntu 16.04 | 4.15.0-1015-azure |
4242
| Ubuntu 18.04 | 4.15.0-1015-azure |
@@ -46,7 +46,7 @@ The following distributions from the Azure Gallery are supported:
4646

4747
**Custom kernel support**
4848

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).
5050

5151
## Region support
5252

@@ -101,17 +101,17 @@ zypper \
101101
--gpg-auto-import-keys install kernel-default-devel gcc make libnuma-devel numactl librdmacm1 rdma-core-devel
102102
```
103103

104-
## Setup virtual machine environment (once)
104+
## Set up the virtual machine environment (once)
105105

106106
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`.
108108
3. Enable Mellanox PMDs in the generated config with `sed -ri 's,(MLX._PMD=)n,\1y,' build/.config`.
109109
4. Compile with `make`.
110110
5. Install with `make install DESTDIR=<output folder>`.
111111

112-
# Configure runtime environment
112+
## Configure the runtime environment
113113

114-
Run the following commands once, after rebooting:
114+
After restarting, run the following commands once:
115115

116116
1. Hugepages
117117

@@ -124,27 +124,29 @@ Run the following commands once, after rebooting:
124124

125125
* Create a directory for mounting with `mkdir /mnt/huge`.
126126
* 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`.
128128

129129
> [!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) for DPDK. The instruction is at the bottom of the page. When running in 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) for the 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.
131131
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.
133133
134134
3. PCI addresses
135135
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 kill DPDK 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.
138138
139139
4. Load *ibuverbs* on each reboot with `modprobe -a ib_uverbs`. For SLES 15 only, also load *mlx4_ib* with `modprobe -a mlx4_ib`.
140140
141141
## Failsafe PMD
142142
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).
144146

145147
## Run testpmd
146148

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.
148150

149151
### Basic: Sanity check, failsafe adapter initialization
150152

@@ -167,12 +169,12 @@ Use `sudo` before the *testpmd* command to run in root mode.
167169
-- -i
168170
```
169171

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>`.
171173
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*).
173175
4. Use `start <port> /stop <port>` to start traffic.
174176

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 recommended for trying out testpmd commands.
176178

177179
### Basic: Single sender/single receiver
178180

@@ -184,7 +186,7 @@ The following commands periodically print the packets per second statistics:
184186
testpmd \
185187
-l <core-list> \
186188
-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> \
188190
--vdev="net_vdev_netvsc<id>,iface=<the iface to attach to>" \
189191
-- --port-topology=chained \
190192
--nb-cores <number of cores to use for test pmd> \
@@ -199,7 +201,7 @@ The following commands periodically print the packets per second statistics:
199201
testpmd \
200202
-l <core-list> \
201203
-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> \
203205
--vdev="net_vdev_netvsc<id>,iface=<the iface to attach to>" \
204206
-- --port-topology=chained \
205207
--nb-cores <number of cores to use for test pmd> \
@@ -208,7 +210,7 @@ The following commands periodically print the packets per second statistics:
208210
--stats-period <display interval in seconds>
209211
```
210212

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.
212214
213215
### Advanced: Single sender/single forwarder
214216
The following commands periodically print the packets per second statistics:
@@ -219,7 +221,7 @@ The following commands periodically print the packets per second statistics:
219221
testpmd \
220222
-l <core-list> \
221223
-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> \
223225
--vdev="net_vdev_netvsc<id>,iface=<the iface to attach to>" \
224226
-- --port-topology=chained \
225227
--nb-cores <number of cores to use for test pmd> \
@@ -244,7 +246,7 @@ The following commands periodically print the packets per second statistics:
244246
--stats-period <display interval in seconds>
245247
```
246248
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 layer 3 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.
248250

249251
## References
250252

0 commit comments

Comments
 (0)