Skip to content

Commit 2980726

Browse files
Dimon-Zhaoshemminger
authored andcommitted
net/nbl: add IOVA mode check in Coexistence
Add IOVA mode check in Coexistence. Update MAINTAINERS. Refresh feature list and Coexistence Usage Instructions. Signed-off-by: Dimon Zhao <[email protected]>
1 parent cf0c409 commit 2980726

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

.mailmap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Allen Hubbe <[email protected]>
7979
Alok Makhariya <[email protected]>
8080
Alok Prasad <[email protected]>
8181
Alvaro Karsz <[email protected]>
82+
Alvin Wang <[email protected]>
8283
Alvin Zhang <[email protected]>
8384
Aman Singh <[email protected]>
8485
Amaranath Somalapuram <[email protected]>
@@ -870,7 +871,6 @@ Kumar Amber <[email protected]>
870871
Kumar Sanghvi <[email protected]>
871872
Kumara Parameshwaran <[email protected]> <[email protected]>
872873
Kyle Larose <[email protected]>
873-
874874
Lance Richardson <[email protected]>
875875
Laszlo Ersek <[email protected]>
876876
Laura Stroe <[email protected]>

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,8 @@ F: doc/guides/nics/rnp.rst
10231023
F: doc/guides/nics/features/rnp.ini
10241024

10251025
Nebulamatrix nbl
1026+
M: Alvin Wang <[email protected]>
10261027
M: Dimon Zhao <[email protected]>
1027-
M: Kyo Liu <[email protected]>
10281028
M: Leon Yu <[email protected]>
10291029
M: Sam Chen <[email protected]>
10301030
F: drivers/net/nbl/

doc/guides/nics/features/nbl.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Unicast MAC filter = Y
1212
Basic stats = Y
1313
Extended stats = Y
1414
Stats per queue = Y
15+
VLAN offload = P
1516
Linux = Y
1617
ARMv8 = Y
1718
x86-64 = Y

doc/guides/nics/nbl.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ Anolis community:
7070
Alternatively, you can contact us to obtain the `nbl_core` code and installation package.
7171

7272

73+
Coexistence Between DPDK And Kernel Driver
74+
------------------------------------------
75+
When this device is bound to the nbl_core driver and IOMMU is in passthrough mode,
76+
it is necessary to force I/O virtual address (IOVA) to be mapped to physical address (PA)
77+
with the EAL command line option ``--iova-mode=pa``.
78+
79+
7380
Prerequisites
7481
-------------
7582

drivers/net/nbl/nbl_common/nbl_userdev.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,11 +679,20 @@ int nbl_pci_map_device(struct nbl_adapter *adapter)
679679

680680
NBL_USERDEV_INIT_COMMON(common);
681681
iova_mode = rte_eal_iova_mode();
682+
683+
snprintf(pathname, sizeof(pathname), "/dev/nbl_userdev/" PCI_PRI_FMT, loc->domain,
684+
loc->bus, loc->devid, loc->function);
685+
686+
/* check iommu passthrough mode */
687+
if (!access(pathname, F_OK) && iova_mode != RTE_IOVA_PA) {
688+
NBL_LOG(ERR, "%s IOMMU is in passthrough mode, must select IOVA as PA"
689+
" with --iova-mode=pa", pci_dev->device.name);
690+
ret = -1;
691+
return ret;
692+
}
693+
682694
if (iova_mode == RTE_IOVA_PA) {
683695
/* check iommu disable */
684-
snprintf(pathname, sizeof(pathname),
685-
"/dev/nbl_userdev/" PCI_PRI_FMT, loc->domain,
686-
loc->bus, loc->devid, loc->function);
687696
common->devfd = open(pathname, O_RDWR);
688697
if (common->devfd >= 0)
689698
goto mmap;

0 commit comments

Comments
 (0)