Skip to content

Commit fa5cc56

Browse files
authored
Merge pull request #250441 from mcgov/mcgov/troubleshoot
DPDK MANA: further comments for examples, assumptions, troubleshooting
2 parents 872df09 + d14fd77 commit fa5cc56

File tree

1 file changed

+94
-6
lines changed

1 file changed

+94
-6
lines changed

articles/virtual-network/setup-dpdk-mana.md

Lines changed: 94 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The setup procedure for MANA DPDK is outlined in the [example code.](#example-te
2323
Legacy Azure Linux VMs rely on the mlx4 or mlx5 drivers and the accompanying hardware for accelerated networking. Azure DPDK users would select specific interfaces to include or exclude by passing bus addresses to the DPDK EAL. The setup procedure for MANA DPDK differs slightly, since the assumption of one bus address per Accelerated Networking interface no longer holds true. Rather than using a PCI bus address, the MANA PMD uses the MAC address to determine which interface it should bind to.
2424

2525
## MANA DPDK EAL Arguments
26-
The MANA PMD probes all devices and ports on the system when no `--vdev` argument is present; the `--vdev` argument is not mandatory. In testing environments it's often desirable to leave one (primary) interface available for servicing the SSH connection to the VM. To use DPDK with a subset of the available VFs, users should pass both the bus address of the MANA device and the MAC address of the interfaces in the `--vdev` argument. For more detail, example code is available to demonstrate [DPDK EAL initialization on MANA](#example-testpmd-setup-and-netvsc-test).
26+
The MANA PMD probes all devices and ports on the system when no `--vdev` argument is present; the `--vdev` argument isn't mandatory. In testing environments, it's often desirable to leave one (primary) interface available for servicing the SSH connection to the VM. To use DPDK with a subset of the available VFs, users should pass both the bus address of the MANA device and the MAC address of the interfaces in the `--vdev` argument. For more detail, example code is available to demonstrate [DPDK EAL initialization on MANA](#example-testpmd-setup-and-netvsc-test).
2727

2828
For general information about the DPDK Environment Abstraction Layer (EAL):
2929
- [DPDK EAL Arguments for Linux](https://doc.dpdk.org/guides/prog_guide/env_abstraction_layer.html#eal-in-a-linux-userland-execution-environment)
@@ -39,6 +39,13 @@ MANA DPDK requires the following set of drivers:
3939
1. [DPDK MANA poll-mode driver](https://github.com/DPDK/dpdk/tree/main/drivers/net/mana) (DPDK 22.11 and later)
4040
1. [Libmana user-space drivers](https://github.com/linux-rdma/rdma-core/tree/master/providers/mana) (rdma-core v44 and later)
4141

42+
### Supported Marketplace Images
43+
A nonexhaustive list of images with backported patches for DPDK with MANA:
44+
- Red Hat Enterprise Linux 8.9
45+
- Red Hat Enterprise Linux 9.4
46+
- Canonical Ubuntu Server 20.04 (5.15.0-1045-azure)
47+
- Canonical Ubuntu Server 22.04 (5.15.0-1045-azure)
48+
4249
>[!NOTE]
4350
>MANA DPDK is not available for Windows; it will only work on Linux VMs.
4451
@@ -85,7 +92,8 @@ popd
8592
Note the following example code for running DPDK with MANA. The direct-to-vf 'netvsc' configuration on Azure is recommended for maximum performance with MANA.
8693

8794
>[!NOTE]
88-
>DPDK requires either 2MB or 1GB hugepages to be enabled
95+
>DPDK requires either 2MB or 1GB hugepages to be enabled.
96+
>Example assumes an Azure VM with 2 accelerated networking NICs attached.
8997
9098
```bash
9199
# Enable 2MB hugepages.
@@ -124,7 +132,7 @@ echo $DEV_UUID > /sys/bus/vmbus/drivers/uio_hv_generic/bind
124132
dpdk-testpmd -l 1-3 --vdev="$BUS_INFO,mac=$MANA_MAC" -- --forward-mode=txonly --auto-start --txd=128 --rxd=128 --stats 2
125133

126134
# MANA multiple queue test (example assumes > 9 cores)
127-
dpdk-testpmd -l 1-9 --vdev="$BUS_INFO,mac=$MANA_MAC" -- --forward-mode=txonly --auto-start --nb-cores=8 --txd=128 --rxd=128 --txq=8 --rxq=8 --stats 2
135+
dpdk-testpmd -l 1-6 --vdev="$BUS_INFO,mac=$MANA_MAC" -- --forward-mode=txonly --auto-start --nb-cores=4 --txd=128 --rxd=128 --txq=8 --rxq=8 --stats 2
128136

129137
```
130138

@@ -133,22 +141,102 @@ dpdk-testpmd -l 1-9 --vdev="$BUS_INFO,mac=$MANA_MAC" -- --forward-mode=txonly --
133141
### Fail to set interface down.
134142
Failure to set the MANA bound device to DOWN can result in low or zero packet throughput.
135143
The failure to release the device can result the EAL error message related to transmit queues.
136-
```
144+
```log
137145
mana_start_tx_queues(): Failed to create qp queue index 0
138146
mana_dev_start(): failed to start tx queues -19
139147
```
140148

141149
### Failure to enable huge pages.
142150

143151
Try enabling huge pages and ensuring the information is visible in meminfo.
144-
```
152+
```log
145153
EAL: No free 2048 kB hugepages reported on node 0
146154
EAL: FATAL: Cannot get hugepage information.
147155
EAL: Cannot get hugepage information.
148156
EAL: Error - exiting with code: 1
149157
Cause: Cannot init EAL: Permission denied
150158
```
151159

152-
### Low throughput with use of --vdev="net_vdev_netvsc0,iface=eth1"
160+
### Low throughput with use of `--vdev="net_vdev_netvsc0,iface=eth1"`
153161

154162
Failover configuration of either the `net_failsafe` or `net_vdev_netvsc` poll-mode-drivers isn't recommended for high performance on Azure. The netvsc configuration with DPDK version 20.11 or higher may give better results. For optimal performance, ensure your Linux kernel, rdma-core, and DPDK packages meet the listed requirements for DPDK and MANA.
163+
164+
### Version mismatch for rdma-core
165+
Mismatches in rdma-core and the linux kernel can occur anytime; often they occur when a user is building some combination of rdma-core, DPDK, and the linux kernel from source. This type of version mismatch can cause a failed probe of the MANA virtual function (VF).
166+
167+
```log
168+
EAL: Probe PCI driver: net_mana (1414:ba) device: 7870:00:00.0 (socket 0)
169+
mana_arg_parse_callback(): key=mac value=00:0d:3a:76:3b:d0 index=0
170+
mana_init_once(): MP INIT PRIMARY
171+
mana_pci_probe_mac(): Probe device name mana_0 dev_name uverbs0 ibdev_path /sys/class/infiniband/mana_0
172+
mana_probe_port(): device located port 2 address 00:0D:3A:76:3B:D0
173+
mana_probe_port(): ibv_alloc_parent_domain failed port 2
174+
mana_pci_probe_mac(): Probe on IB port 2 failed -12
175+
EAL: Requested device 7870:00:00.0 cannot be used
176+
EAL: Bus (pci) probe failed.
177+
hn_vf_attach(): Couldn't find port for VF
178+
hn_vf_add(): RNDIS reports VF but device not found, retrying
179+
180+
```
181+
This likely results from using a kernel with backported patches for mana_ib with a newer version of rdma-core. The root cause is an interaction between the kernel RDMA drivers and user space rdma-core libraries.
182+
183+
The Linux kernel uapi for RDMA has a list of RDMA provider IDs, in backported versions of the kernel this ID value can differ from the version in the rdma-core libraries.
184+
> {!NOTE}
185+
> Example snippets are from [Ubuntu 5.150-1045 linux-azure](https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-azure/+git/focal/tree/include/uapi/rdma/ib_user_ioctl_verbs.h?h=azure-5.15-next) and [rdma-core v46.0](https://github.com/linux-rdma/rdma-core/blob/4cce53f5be035137c9d31d28e204502231a56382/kernel-headers/rdma/ib_user_ioctl_verbs.h#L220)
186+
```c
187+
// Linux kernel header
188+
// include/uapi/rdma/ib_user_ioctl_verbs.h
189+
enum rdma_driver_id {
190+
RDMA_DRIVER_UNKNOWN,
191+
RDMA_DRIVER_MLX5,
192+
RDMA_DRIVER_MLX4,
193+
RDMA_DRIVER_CXGB3,
194+
RDMA_DRIVER_CXGB4,
195+
RDMA_DRIVER_MTHCA,
196+
RDMA_DRIVER_BNXT_RE,
197+
RDMA_DRIVER_OCRDMA,
198+
RDMA_DRIVER_NES,
199+
RDMA_DRIVER_I40IW,
200+
RDMA_DRIVER_IRDMA = RDMA_DRIVER_I40IW,
201+
RDMA_DRIVER_VMW_PVRDMA,
202+
RDMA_DRIVER_QEDR,
203+
RDMA_DRIVER_HNS,
204+
RDMA_DRIVER_USNIC,
205+
RDMA_DRIVER_RXE,
206+
RDMA_DRIVER_HFI1,
207+
RDMA_DRIVER_QIB,
208+
RDMA_DRIVER_EFA,
209+
RDMA_DRIVER_SIW,
210+
RDMA_DRIVER_MANA, //<- MANA added as last member of enum after backporting
211+
};
212+
213+
// Example mismatched rdma-core ioctl verbs header
214+
// on github: kernel-headers/rdma/ib_user_ioctl_verbs.h
215+
// or in release tar.gz: include/rdma/ib_user_ioctl_verbs.h
216+
enum rdma_driver_id {
217+
RDMA_DRIVER_UNKNOWN,
218+
RDMA_DRIVER_MLX5,
219+
RDMA_DRIVER_MLX4,
220+
RDMA_DRIVER_CXGB3,
221+
RDMA_DRIVER_CXGB4,
222+
RDMA_DRIVER_MTHCA,
223+
RDMA_DRIVER_BNXT_RE,
224+
RDMA_DRIVER_OCRDMA,
225+
RDMA_DRIVER_NES,
226+
RDMA_DRIVER_I40IW,
227+
RDMA_DRIVER_IRDMA = RDMA_DRIVER_I40IW,
228+
RDMA_DRIVER_VMW_PVRDMA,
229+
RDMA_DRIVER_QEDR,
230+
RDMA_DRIVER_HNS,
231+
RDMA_DRIVER_USNIC,
232+
RDMA_DRIVER_RXE,
233+
RDMA_DRIVER_HFI1,
234+
RDMA_DRIVER_QIB,
235+
RDMA_DRIVER_EFA,
236+
RDMA_DRIVER_SIW,
237+
RDMA_DRIVER_ERDMA, // <- This upstream has two additional providers
238+
RDMA_DRIVER_MANA, // <- So MANA's ID in the enum does not match
239+
};
240+
```
241+
242+
This mismatch results in the MANA provider code failing to load. Use `gdb` to trace the execution of `dpdk-testpmd` to confirm the ERDMA provider is loaded instead of the MANA provider. The MANA driver_id must be consistent for both the kernel and rdma-core. The MANA PMD loads correctly when those IDs match.

0 commit comments

Comments
 (0)