> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NIC & SR-IOV — RT with KVM

## **Intel X550 NIC and SR-IOV Support**

Qualcomm has validated the Intel X550 NIC card with SR-IOV support on the following platforms:

| Device | Board Name |
| - | - |
| QCS9100 Ride-Sx | LeMans |
| IQ9075-EVK | QCS9075-EVK |

***

### Required Kernel Configurations

| Config | Description |
| - | - |
| `CONFIG_IXGBE=y` | Intel 10GbE PCI Express driver |
| `CONFIG_IXGBEVF=y` | Intel 10GbE Virtual Function driver (required for SR-IOV) |
| `CONFIG_VIRTIO_IOMMU=y` | Paravirtualized IOMMU device for guest VMs (required for SR-IOV passthrough) |

***

### Enabling Kernel Configs

#### Method 1 — BSP config fragment

Edit and append to:

```
<Workspace_Path>/meta-qcom/recipes-kernel/linux/linux-qcom-6.18/configs/bsp-additions.cfg
```

```
CONFIG_IXGBE=y
CONFIG_IXGBEVF=y
CONFIG_VIRTIO_IOMMU=y
```

#### Method 2 — Kernel patch

Copy patch file(s) to the kernel recipe directory and add to `SRC_URI` in `linux-qcom_6.18.bb`:

```
SRC_URI = " \
    git://github.com/qualcomm-linux/kernel.git;${SRCBRANCH};protocol=https \
    file://0001-arm64-boot-dts-qcom-Update-iommu-map-for-sriov-endpoints.patch \
"

SRC_URI += " \
    file://configs/bsp-additions.cfg \
"
```

***

### PCIe IOMMU-Map for Intel NIC SR-IOV

The PCIe IOMMU mappings for the NIC card must be added to the board `.dtsi` file to enumerate SR-IOV virtual functions. The approach used is **sparse point mapping** — one IOMMU entry per device (`count = 1`), which avoids SID exhaustion in the SMMUv2.

**How `iommu-map` works:**

```
iommu-map = <rid_base  &smmu_phandle  sid_base  count>;
```

With `count = 1`:

```
RID == rid_base  →  SID = sid_base
```

**RID formula:** `RID = (Bus << 8) | (Device << 3) | Function`

#### Example Patch — IQ-9075 EVK `pcie1` (13 SR-IOV entries)

This patch adds `iommu-map` entries for the Intel X550 SR-IOV virtual functions on `pcie1` of the IQ-9075 EVK:

```diff theme={null}
diff --git a/arch/arm64/boot/dts/qcom/lemans-evk.dts b/arch/arm64/boot/dts/qcom/lemans-evk.dts
--- a/arch/arm64/boot/dts/qcom/lemans-evk.dts
+++ b/arch/arm64/boot/dts/qcom/lemans-evk.dts
@@ -725,6 +725,19 @@ &pcie1 {
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";

+	iommu-map = <0x0 &pcie_smmu 0x80 0x1>,
+		    <0x100 &pcie_smmu 0x81 0x1>,
+		    <0x101 &pcie_smmu 0x82 0x1>,
+		    <0x280 &pcie_smmu 0x83 0x1>,
+		    <0x282 &pcie_smmu 0x84 0x1>,
+		    <0x284 &pcie_smmu 0x85 0x1>,
+		    <0x286 &pcie_smmu 0x86 0x1>,
+		    <0x288 &pcie_smmu 0x87 0x1>,
+		    <0x28a &pcie_smmu 0x88 0x1>,
+		    <0x28c &pcie_smmu 0x89 0x1>,
+		    <0x28e &pcie_smmu 0x90 0x1>,
+		    <0x290 &pcie_smmu 0x91 0x1>,
+		    <0x292 &pcie_smmu 0x92 0x1>;
 	status = "okay";
 };
```

This maps the RC (RID `0x0`) plus twelve SR-IOV endpoint RIDs to twelve consecutive SIDs (`0x80`–`0x92`) within `pcie1`'s SMMU subrange.

***

### Verification

```bash theme={null}
# Verify kernel configs are active
root@iq-9075-evk:/# zcat /proc/config.gz | grep -E "CONFIG_IXGBE=|CONFIG_IXGBEVF=|CONFIG_VIRTIO_IOMMU="
CONFIG_IXGBE=y
CONFIG_IXGBEVF=y
CONFIG_VIRTIO_IOMMU=y

# Verify NIC card detection
root@iq-9075-evk:~# lspci
0000:00:00.0 PCI bridge: Qualcomm Technologies, Inc Device 0115
0000:01:00.0 Network controller: Qualcomm Technologies, Inc QCNFA765 Wireless Network Adapter (rev 01)
0001:00:00.0 PCI bridge: Qualcomm Technologies, Inc Device 0115
0001:01:00.0 Ethernet controller: Intel Corporation Ethernet Controller X550 (rev 01)
0001:01:00.1 Ethernet controller: Intel Corporation Ethernet Controller X550 (rev 01)
```

***

### Diagnosing Missing `iommu-map` Entries

When a device's RID has no matching entry the kernel logs:

```
OF: /pci@1c10000: no iommu-map translation for id 0x281 on (null)
vfio-pci: probe of 0001:02:10.1 failed with error -22
```

Decode the RID:

```bash theme={null}
RID=0x281; printf "Bus=%d Dev=%d Fn=%d\n" \
    $(( (RID >> 8) & 0xFF )) \
    $(( (RID >> 3) & 0x1F )) \
    $(( RID & 0x07 ))
# Bus=2 Dev=16 Fn=1
```

Add the missing entry with `count = 1` and a free SID, then rebuild the DTB and verify with `dmesg`.

> [!NOTE]
>
> `lspci` reads PCI config space directly and will show a device regardless of IOMMU mapping. Use `dmesg` — not `lspci` — to confirm a missing entry is fixed.

***

> [card] [VM Management](https://dragonwingdocs-staging.qualcomm.com/Suites/Industrial-Edge-Suite/rt-with-kvm-vm-management.md)
>
> Virsh setup and sample domain XML files

> [card] [Build — RT with KVM](https://dragonwingdocs-staging.qualcomm.com/Suites/Industrial-Edge-Suite/rt-with-kvm-build.md)
>
> KAS build commands
