QLogic HBA network card init firmware fail - linux

After starting the server, the HBA network card cannot initialize the firmware.
[root#compute8 ~]# dmesg | grep qla2xxx
[ 2.919912] qla2xxx [0000:00:00.0]-0005: : QLogic Fibre Channel HBA Driver: 10.02.06.200-k.
[ 2.922762] Warning: Deprecated Hardware is detected: qla2xxx:2031:1077 # 0000:3b:00.0 will not be maintained in a future major release and may be disabled
[ 2.928626] qla2xxx [0000:00:00.0]-011c: : MSI-X vector count: 32.
[ 2.931519] qla2xxx [0000:00:00.0]-001d: : Found an ISP2031 irq 83 iobase 0x0000000036a45c68.
[ 3.057038] qla2xxx [0000:3b:00.0]-0075:8: ZIO mode 6 enabled; timer delay (200 us).
[ 3.060203] qla2xxx [0000:3b:00.0]-ffff:8: FC4 priority set to NVMe
[ 4.971121] qla2xxx [0000:3b:00.0]-00d2:8: Init Firmware **** FAILED ****.
[ 4.974362] qla2xxx [0000:3b:00.0]-00d6:8: Failed to initialize adapter - Adapter flags 2.
[ 4.983547] Warning: Deprecated Hardware is detected: qla2xxx:2031:1077 # 0000:3b:00.1 will not be maintained in a future major release and may be disabled
[ 4.989622] qla2xxx [0000:00:00.0]-011c: : MSI-X vector count: 32.
[ 4.992605] qla2xxx [0000:00:00.0]-001d: : Found an ISP2031 irq 83 iobase 0x000000009c44281d.
[ 5.056118] qla2xxx [0000:3b:00.1]-0075:8: ZIO mode 6 enabled; timer delay (200 us).
[ 5.059061] qla2xxx [0000:3b:00.1]-ffff:8: FC4 priority set to NVMe
[ 6.770143] qla2xxx [0000:3b:00.1]-00d2:8: Init Firmware **** FAILED ****.
[ 6.773060] qla2xxx [0000:3b:00.1]-00d6:8: Failed to initialize adapter - Adapter flags 2.
[root#compute8 ~]# ls /lib/firmware/ | grep '_fw.bin'
ql2100_fw.bin
ql2200_fw.bin
ql2300_fw.bin
ql2322_fw.bin
ql2400_fw.bin
ql2500_fw.bin
[root#compute8 ~]# lspci -vvv |grep -i -e fib -e hba
Capabilities: [a8] SATA HBA v1.0 BAR4 Offset=00000004
Capabilities: [a8] SATA HBA v1.0 BAR4 Offset=00000004
0000:3b:00.0 Fibre Channel: QLogic Corp. ISP8324-based 16Gb Fibre Channel to PCI Express Adapter (rev 02)
Product Name: QLE2672 QLogic 2-port 16Gb Fibre Channel Adapter
0000:3b:00.1 Fibre Channel: QLogic Corp. ISP8324-based 16Gb Fibre Channel to PCI Express Adapter (rev 02)
Product Name: QLE2672 QLogic 2-port 16Gb Fibre Channel Adapter
[root#compute8 ~]# lspci -v -s 3b:00.0
0000:3b:00.0 Fibre Channel: QLogic Corp. ISP8324-based 16Gb Fibre Channel to PCI Express Adapter (rev 02)
Subsystem: QLogic Corp. Device fb02
Physical Slot: 7-1
Flags: fast devsel, IRQ 83, NUMA node 0
Memory at 382ffff0a000 (64-bit, prefetchable) [size=8K]
Memory at 382ffff04000 (64-bit, prefetchable) [size=16K]
Memory at 382fffe00000 (64-bit, prefetchable) [size=1M]
Expansion ROM at e0640000 [disabled] [size=256K]
Capabilities: [44] Power Management version 3
Capabilities: [4c] Express Endpoint, MSI 00
Capabilities: [88] Vital Product Data
Capabilities: [90] MSI-X: Enable- Count=32 Masked-
Capabilities: [100] Advanced Error Reporting
Capabilities: [154] Alternative Routing-ID Interpretation (ARI)
Capabilities: [1b0] Secondary PCI Express
Kernel modules: qla2xxx
[root#compute8 ~]# lsmod | grep qla2xxx
qla2xxx 974848 0
nvme_fc 53248 1 qla2xxx
scsi_transport_fc 81920 1 qla2xxx
[root#compute8 ~]# modinfo -a qla2xxx
QLogic Corporation
[root#compute8 ~]# modinfo -d qla2xxx
QLogic Fibre Channel HBA Driver
[root#compute8 ~]# modinfo -l qla2xxx
GPL
[root#compute8 ~]# modinfo -d qla2xxx
QLogic Fibre Channel HBA Driver
[root#compute8 ~]# modinfo qla2xxx | grep version
version: 10.02.06.200-k
[root#compute8 ~]# modinfo -k `uname -r` -n qla2xxx
/lib/modules/4.18.0-372.26.1.el8_6.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko.xz
[root#compute8 ~]# modprobe --show-depends qla2xxx
insmod /lib/modules/4.18.0-372.26.1.el8_6.x86_64/kernel/drivers/scsi/scsi_transport_fc.ko.xz
insmod /lib/modules/4.18.0-372.26.1.el8_6.x86_64/kernel/block/t10-pi.ko.xz
insmod /lib/modules/4.18.0-372.26.1.el8_6.x86_64/kernel/drivers/nvme/host/nvme-core.ko.xz
insmod /lib/modules/4.18.0-372.26.1.el8_6.x86_64/kernel/drivers/nvme/host/nvme-fabrics.ko.xz
insmod /lib/modules/4.18.0-372.26.1.el8_6.x86_64/kernel/drivers/nvme/host/nvme-fc.ko.xz
insmod /lib/modules/4.18.0-372.26.1.el8_6.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko.xz
Installed the recommended utility QConvergeConsole CLI - Version 2.4.0 to see information about the card and ports (Menu item 1 is selected). There is no information on the card.
QConvergeConsole
CLI - Version 2.4.0 (Build 20)
Main Menu
1: Adapter Information
2: Adapter Configuration
3: Adapter Updates
4: Adapter Diagnostics
5: Monitoring
6: Refresh
7: Help
8: Exit
Please Enter Selection: 1
QConvergeConsole
CLI - Version 2.4.0 (Build 20)
Adapter Type Selection
(p or 0: Previous Menu; m or 98: Main Menu; ex or 99: Quit)
Please Enter Selection:
I found the following table:
ISP 21XX — ql2100_fw.bin
ISP 22XX — ql2200_fw.bin
ISP 2300 — ql2300_fw.bin
ISP 2322 — ql2322_fw.bin
ISP 24XX — ql2400_fw.bin
ISP 25XX — ql2500_fw.bin
ISP 2031 — ql2600_fw.bin
ISP 27XX — ql2700_fw.bin
As I understood, for my card with the ISP 2031 chip I need ql2600_fw.bin. In the support section of the site https://www.marvell.com/support/downloads.html looked through all the archives for QLE2672 cards, I found nothing.
Tried systems RHEL 8.4, AlmaLinux 8.4/8.6, Centos 7.9/8.3 the result is the same.

A solution to my problem:
Download kernel-firmware-qlogic and unpack. Copy the firmware file and restart the qla2xxx module.
# wget https://rpmfind.net/linux/opensuse/tumbleweed/repo/oss/noarch/kernel-firmware-qlogic-20220902-1.1.noarch.rpm
# rpm2cpio kernel-firmware-qlogic-20220902-1.1.noarch.rpm | cpio -idmv
# unxz ./usr/lib/firmware/ql2600_fw.bin.xz
# cp ./usr/lib/firmware/ql2600_fw.bin /lib/firmware/
# modprobe -r qla2xxx
# vi /etc/modprobe.d/qla2xxx.conf
options qla2xxx ql2xfwloadbin=2
# modprobe qla2xxx
# dmesg | grep qla2xxx
[ 3651.498294] qla2xxx [0000:3b:00.1]-0075:18: ZIO mode 6 enabled; timer delay (200 us).
[ 3651.498826] qla2xxx [0000:3b:00.1]-ffff:18: FC4 priority set to NVMe
[ 3652.628291] qla2xxx [0000:3b:00.1]-500a:18: LOOP UP detected (16 Gbps).
[ 3652.797555] scsi host18: qla2xxx
[ 3652.845337] qla2xxx [0000:3b:00.1]-00fb:18: QLogic QLE2672 - QLE2672 QLogic 2-port 16Gb Fibre Channel Adapter.
[ 3652.845959] qla2xxx [0000:3b:00.1]-00fc:18: ISP2031: PCIe (8.0GT/s x8) # 0000:3b:00.1 hdma+ host#=18 fw=8.04.00 (d0d5).
Check:
# qaucli
QConvergeConsole
FC Adapter Information
1: FC Adapter Information
2: FC Port Information
3: FC VPD Information
4: FC Target/LUN Information
5: FC Flash Information
(p or 0: Previous Menu; m or 98: Main Menu; ex or 99: Quit)
Please Enter Selection: 1
QConvergeConsole
CLI - Version 2.4.0 (Build 20)
Adapter Information
1: HBA Model: QLE2672 SN: BFE1501K49172
Port 1 WWPN: 21-00-00-0E-1E-C2-65-E8 Online
Port 2 WWPN: 21-00-00-0E-1E-C2-65-E9 Online

Related

DPDK l2fwd and pktgen inside VMware virtual machine

I am just playing with DPDK here to get some hands on experience of tools to generate packets for that i have setup tow VMs on VMware ESXi.
VM-A and VM-B are connected back to back with Internal_vSwitch
I have compiled DPDK and l2fwd on VM-B and pktgen on VM-A but when i run pktgen do start all doesn't showing generating any packets. because of my limited knowledge i am not able to debug what could be wrong.
Grub (i did configure hugepage from command line not grub)
root#VM-A:~/pktgen-dpdk-pktgen-20.11.3/usr/local/bin# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-5.4.0-91-generic root=/dev/mapper/vg0-root ro
HugePage
root#VM-A:~/pktgen-dpdk-pktgen-20.11.3/usr/local/bin# hugeadm --pool-list
Size Minimum Current Maximum Default
2097152 2048 2048 2048 *
1073741824 0 0 0
binding port
root#VM-B:~/pktgen-dpdk-pktgen-20.11.3/usr/local/bin# dpdk-devbind.py -s
Network devices using DPDK-compatible driver
============================================
0000:0b:00.0 'VMXNET3 Ethernet Controller 07b0' drv=uio_pci_generic unused=vmxnet3,vfio-pci
Network devices using kernel driver
===================================
0000:03:00.0 'VMXNET3 Ethernet Controller 07b0' if=ens160 drv=vmxnet3 unused=vfio-pci,uio_pci_generic *Active*
Pktgen not generating any packet. all the counters are zero.
root#VM-A:~/pktgen-dpdk-pktgen-20.11.3/usr/local/bin# ./pktgen -l 1-2 -n 1 -- -P -N -T -m "3.0"
Copyright (c) <2010-2020>, Intel Corporation. All rights reserved. Powered by DPDK
EAL: Detected 4 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Probe PCI driver: net_vmxnet3 (15ad:7b0) device: 0000:0b:00.0 (socket 0)
EAL: No legacy callbacks, legacy socket not created
*** Copyright (c) <2010-2020>, Intel Corporation. All rights reserved.
*** Pktgen created by: Keith Wiles -- >>> Powered by DPDK <<<
Port: Name IfIndex Alias NUMA PCI
0: net_vmxnet3 0 0 15ad:07b0/0b:00.0
Initialize Port 0 -- TxQ 1, RxQ 1
Src MAC 00:0c:29:ae:70:dc
<Promiscuous mode Enabled>
WARNING: Nothing to do on lcore 2: exiting
- Ports 0-0 of 1 <Main Page> Copyright (c) <2010-2020>, Intel Corporation
Flags:Port : P------Single :0
|ink State : <UP-10000-FD> ---Total Rate---
-kts/s Max/Rx : P------Single :0 0/0
| Ports 0-0 of 1 <Main Page> Copyright (c) <2010-2020>, Intel Corporation
/ Flags:Port : P------Single :0 3/1
Link State : P------Single :0 ---Total Rate---
Pkts/s Max/Rx : <UP-10000-FD> 3/0
Max/Tx : 3/0 3/0
MBits/s Rx/Tx : 0/0 0/0
Broadcast : 0/0 0/0
Multicast : 0
Sizes 64 : 0
65-127 : 0
128-255 : 0
256-511 : 0
512-1023 : 0
1024-1518 : 0
Runts/Jumbos : 0
ARP/ICMP Pkts : 0/0
Errors Rx/Tx : 0/0
Total Rx Pkts : 0/0
Tx Pkts : 10
Rx MBs : 0
Tx MBs : 0
TTL/Port Src/Dest : 0
Pattern Type : abcd...
Tx Count/% Rate : Forever /100%
Pkt Size/Tx Burst : 64 / 32
TTL/Port Src/Dest : 4/ 1234/ 5678
Pkt Type:VLAN ID : IPv4 / TCP:0001
802.1p CoS/DSCP/IPP : 0/ 0/ 0
VxLAN Flg/Grp/vid : 0000/ 0/ 0
IP Destination : 192.168.1.1y DPDK (pid:1957) -----------------
Source : 192.168.0.1/24rface without timers
MAC Destination : 00:00:00:00:00:00
Source : 00:0c:29:ae:70:dc
-- Pktgen 20.11.3 (D: 15ad:07b0/0b:00.0y DPDK (pid:1957) -----------------
Pktgen:/> start all
Pktgen:/>
The issue is related to the incorrect command-line configuration set for DPDK-PKTGEN.
Current: ./pktgen -l 1-2 -n 1 -- -P -N -T -m "3.0"
Correct: ./pktgen -l 1-2 -n 1 -- -P -N -T -m "2.0"
reason: pktgen option -m "3.0" stands for do RX and TX on CPU core 3. But as per DPDK lcore arguments, only core 1 and core 2 is passed as dpdk arguments. Hence rectifying the same to -m "2.0" solves the same.

BeagleBone Pocket CAN0 and CAN1 doesn't work

I have an issue with my beaglebone pocket and I need help. I try to setup can0 with an MCP2551 transceiver. I load BB-CAN0-00A0.dtbo and BB-CAN1-00A0.DTBO but i have no can device in /sys/class/net and device can0 and can1 doesn't exist.
This is my version.sh log
git:/opt/scripts/:[73593ebe3b7d3cc381eeb502d45ccb33a6ec5e78]
eeprom:[A335PBGL00A21748EPB00201]
model:[TI_AM335x_PocketBeagle]
dogtag:[BeagleBoard.org Debian Image 2018-08-30]
bootloader:[microSD]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
kernel:[4.14.67-ti-r73]
nodejs:[v6.14.4]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/BB-CAN0-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/BB-CAN1-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.4.20180803.0-0rcnee0~stretch+20180804]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[librobotcontrol]:[1.0.2-git20180829.0-0rcnee0~stretch+20180830]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.148050] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 1.241720] pinctrl-single 44e10800.pinmux: pin PIN95 already requested by ocp:P1_28_pinmux; cannot claim for 481cc000.can
[ 1.253051] pinctrl-single 44e10800.pinmux: pin-95 (481cc000.can) status -22
[ 1.260180] pinctrl-single 44e10800.pinmux: could not request pin 95 (PIN95) from group pinmux_dcan0_pins on device pinctrl-single
[ 1.280383] pinctrl-single 44e10800.pinmux: pin PIN97 already requested by ocp:P2_09_pinmux; cannot claim for 481d0000.can
[ 1.291556] pinctrl-single 44e10800.pinmux: pin-97 (481d0000.can) status -22
[ 1.298668] pinctrl-single 44e10800.pinmux: could not request pin 97 (PIN97) from group pinmux_dcan1_pins on device pinctrl-single
dmesg | grep gpio-of-helper
[ 1.156291] gpio-of-helper ocp:cape-universal: ready
END
And my /boot/uEnv.txt:
uname_r=4.14.67-ti-r73
#uuid=
#dtb=
###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/.dtbo
#uboot_overlay_addr1=/lib/firmware/.dtbo
#uboot_overlay_addr2=/lib/firmware/.dtbo
#uboot_overlay_addr3=/lib/firmware/.dtbo
###
###Additional custom capes
uboot_overlay_addr4=/lib/firmware/BB-CAN0-00A0.dtbo
uboot_overlay_addr5=/lib/firmware/BB-CAN1-00A0.dtbo
#uboot_overlay_addr6=/lib/firmware/.dtbo
#uboot_overlay_addr7=/lib/firmware/.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_rproc (4.14.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_uio (4.4.x-ti, 4.14.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###
cmdline=coherent_pool=1M net.ifnames=0 quiet
#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 quiet video=HDMI-A-1:1024x768#60e
#Use an overlayfs on top of a read-only root filesystem:
#cmdline=coherent_pool=1M net.ifnames=0 quiet overlayroot=tmpfs
##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
If you have any suggestion, I don't understand what's wrong in my configuration.
Thanks
cape-universal can conflict with overlays that you're trying to load. Such as in this case.
A possible route is to disable cape-universal. Another option might be to try set things up at run-time. For a static hardware setup that won't change the former is much preferable though.
Please note that the default images for the BBB keep evolving and thus this is not an universal answer.

Check if VT-D / IOMMU has been enabled in the BIOS/UEFI

To check if Intel's VT-X or AMD's AMD-V is enabled in the BIOS/UEFI, I use:
if systool -m kvm_amd -v &> /dev/null || systool -m kvm_intel -v &> /dev/null ; then
echo "AMD-V / VT-X is enabled in the BIOS/UEFI."
else
echo "AMD-V / VT-X is not enabled in the BIOS/UEFI"
fi
I couldn't find a way to check if Intel's VT-D or AMD's IOMMU are enabled in the BIOS/UEFI.
I need a way to detect if it is enabled or not without having the iommu kernel parameters set (iommu=1, amd_iommu=on, intel_iommu=on).
One idea I had was to use rdmsr, but I'm not sure if that would work. Instead of systool I initially wanted to use sudo rdmsr 0x3A, but it didn't work for me. It always reports:
rdmsr: CPU 0 cannot read MSR 0x0000003a
rdmsr is part of msr-tools btw. And to be used requires the msr kenel module to be loaded (sudo modprobe msr) first.
Allegedly sudo rdmsr 0x3A should have returned 3 or 5 to indicate that VT-X/AMD-V is enabled...
If VT-d is enabled, Linux will configure DMA Remapping at boot time. The easiest way to find this is to look in dmesg for DMAR entries. If you don't see errors, then VT-d is enabled.
For example:
[root#localhost ~]# dmesg | grep DMAR
[ 0.000000] ACPI: DMAR 0x00000000BBECB000 0000A8 (v01 LENOVO TP-R0D 00000930 PTEC 00000002)
[ 0.001000] DMAR: Host address width 39
[ 0.001000] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[ 0.001000] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 19e2ff0505e
[ 0.001000] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[ 0.001000] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[ 0.001000] DMAR: RMRR base: 0x000000bbdd8000 end: 0x000000bbdf7fff
[ 0.001000] DMAR: RMRR base: 0x000000bd000000 end: 0x000000bf7fffff
[ 0.001000] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1
[ 0.001000] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[ 0.001000] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.002000] DMAR-IR: Enabled IRQ remapping in x2apic mode
Another example with x2apic opt out:
[root#localhost ~]# dmesg | grep DMAR
[ 0.000000] ACPI: DMAR 0000000079a20300 000C4 (v01 SUPERM SMCI--MB 00000001 INTL 20091013)
[ 0.106389] DMAR: Host address width 46
[ 0.106392] DMAR: DRHD base: 0x000000fbffc000 flags: 0x1
[ 0.106400] DMAR: dmar0: reg_base_addr fbffc000 ver 1:0 cap 8d2078c106f0466 ecap f020de
[ 0.106402] DMAR: RMRR base: 0x0000007bb24000 end: 0x0000007bb32fff
[ 0.106404] DMAR: ATSR flags: 0x0
[ 0.106407] DMAR: RHSA base: 0x000000fbffc000 proximity domain: 0x0
[ 0.106409] DMAR-IR: IOAPIC id 8 under DRHD base 0xfbffc000 IOMMU 0
[ 0.106411] DMAR-IR: HPET id 0 under DRHD base 0xfbffc000
[ 0.106413] DMAR-IR: x2apic is disabled because BIOS sets x2apic opt out bit.
[ 0.106414] DMAR-IR: Use 'intremap=no_x2apic_optout' to override the BIOS setting.
[ 0.106591] DMAR-IR: Enabled IRQ remapping in xapic mode
Either way, you're looking for that last line, DMAR-IR: Enabled IRQ remapping in <whichever> mode.
On a system with VT-d disabled, you will either see an error message, or nothing at all.
[root#localhost ~]# dmesg | grep DMAR
[root#localhost ~]#
I just found another way that seems to work even if the iommu kernel parameters have not been set:
if compgen -G "/sys/kernel/iommu_groups/*/devices/*" > /dev/null; then
echo "AMD's IOMMU / Intel's VT-D is enabled in the BIOS/UEFI."
else
echo "AMD's IOMMU / Intel's VT-D is not enabled in the BIOS/UEFI"
fi
Building on Jo-Erlend Schinstad's answer:
Install cpu-checker
$ sudo apt-get update
$ sudo apt-get install cpu-checker
Then check:
$ kvm-ok
If the CPU is enabled, you should see something like:
INFO: /dev/kvm exists
KVM acceleration can be used
Otherwise, you might see something like:
INFO: /dev/kvm does not exist
HINT: sudo modprobe kvm_intel
INFO: Your CPU supports KVM extensions
INFO: KVM (vmx) is disabled by your BIOS
HINT: Enter your BIOS setup and enable Virtualization Technology (VT),
and then hard poweroff/poweron your system
KVM acceleration can NOT be used

writing in /sys/bus/pci/... fails

Attempt to run the following command with root privilege on kernel 2.6.35 results in error:
% echo 0000:00:03.0 > /sys/bus/pci/drivers/foo/bind
-bash: echo: write error: No such device
UPDATE
The device does exist in /sys/bus/pci/devices/ the output of lspci is as follows:
% lspci -v -s 0000:00:03.0
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter
Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 10
Memory at f0000000 (32-bit, non-prefetchable) [size=128K]
I/O ports at d010 [size=8]
Capabilities: <access denied>
Kernel driver in use: e1000
I think I resolved the issue. It appears that the driver requires to unbind device at first.
It also appears that the shell processes redirection (echo .. > /sys/bus/..) with user permission, and 'sudo' handles only the command, i.e. 'echo' but not the whole command line that follows it, therefore it has to be executed this way:
% sudo sh -c "echo 0000:00:03.0 > /sys/bus/pci/drivers/foo/unbind"
% sudo sh -c "echo 0000:00:03.0 > /sys/bus/pci/drivers/foo_new/bind"

BASH find which port a USB drive is attached to by the PCI ID

Basically I need to verify that a USB Drive is connected to a certain USB Port. I have the following:
USB Drives are labeled virtually:
White, Green, Red
I have 3 USB Ports that are also labeled physically:
White, Green, Red
Using BLKID I can receive information from the drives such as
BLKID Example
/dec/sdb1: SEC_TYPE="msdos" LABEL="WHTIE" UUID="78FE-870D" TYPE="vfat"
Therefore I know a lot about the drive itself by only knowing the label. Now I using LSPCI I can get the information about the USB port as I know the ID's of each bridge. For example:
LSPCI Example
0a.00.0 USB Controller: some info 4d88
So that last part 4d88 is the PCI ID.
So I know the PCI ID's of each port and need to match them up to the USB Drive itself such as:
4d88 = WHITE
4dC0 = GREEN
4d84 = RED
I don't know how to match / check that relationship. Any help will be appreciated.
ANSWER: Thanks for all the help.
#!/bin/bash
#variables
error="ERROR : Incorrect Command use 'usb_pci.sh'"
pci="USB PCI Check Successful"
errorstatus_white_pci="ERROR : USB PCI FAILED : WHITE Drive"
errorstatus_green_pci="ERROR : USB PCI FAILED : GREEN Drive"
errorstatus_red_pci="ERROR : USB PCI FAILED : RED Drive"
pci_check_white=4dc9
pci_check_green=4d81
pci_check_red=4dc5
#Takes USB label and gets /sys/block/sd?
echo "checking path for USB Label"
path_white=$(blkid | grep WHITE | cut -d : -f 1 | sed 's|[0-9]*$||; s|^/dev/|/sys/block/|')
echo "white: "$path_white
path_green=$(blkid | grep GREEN | cut -d : -f 1 | sed 's|[0-9]*$||; s|^/dev/|/sys/block/|')
echo "green: "$path_green
path_red=$(blkid | grep RED | cut -d : -f 1 | sed 's|[0-9]*$||; s|^/dev/|/sys/block/|')
echo "red: "$path_red
#Takes /sys/block/sd? and gets PCI Path xx:xx.x
echo "checking path to PCI path"
pci_path_white=$(ls -l ${path_white} | xargs | cut -d / -f 8 | cut -b 6-13)
echo "white: "$pci_path_white
pci_path_green=$(ls -l ${path_green} | xargs | cut -d / -f 8 | cut -b 6-13)
echo "green: "$pci_path_green
pci_path_red=$(ls -l ${path_red} | xargs | cut -d / -f 8 | cut -b 6-13)
echo "red: "$pci_path_red
#Takes xx:xx.x and gets the PCI Device ID xxxx
echo "checking PCI path to PCI Device ID"
pci_device_id_white=$(lspci -s ${pci_path_white} | tail -c -5)
echo "white: "$pci_device_id_white
pci_device_id_green=$(lspci -s ${pci_path_green} | tail -c -5)
echo "green: "$pci_device_id_green
pci_device_id_red=$(lspci -s ${pci_path_red} | tail -c -5)
echo "red: "$pci_device_id_red
#check if pci_device_id_xxxx = pci_check_xxxx
echo "checking PCI Device ID equals what it should"
if [ $pci_device_id_white = $pci_check_white ] ; then
echo "WHITE USB PCI Check Successful"
else
echo $errorstatus_white_pci
exit 1
fi
if [ $pci_device_id_green = $pci_check_green ] ; then
echo "GREEN USB PCI Check Successful"
else
echo $errorstatus_green_pci
exit 1
fi
if [ $pci_device_id_red = $pci_check_red ] ; then
echo "RED USB PCI Check Successful"
else
echo $errorstatus_red_pci
exit 1
fi
echo $pci
exit 0
Edit:
As requested dumps of lspci, lsusb, blkid.
lspci
00:00.0 Host bridge: Intel Corporation Unknown device 0104 (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Unknown device 0126 (rev 09)
00:16.0 Communication controller: Intel Corporation Unknown device 1c3a (rev 04)
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)
00:1a.0 USB Controller: Intel Corporation Unknown device 1c2d (rev 04)
00:1b.0 Audio device: Intel Corporation Unknown device 1c20 (rev 04)
00:1c.0 PCI bridge: Intel Corporation Unknown device 1c10 (rev b4)
00:1c.2 PCI bridge: Intel Corporation Unknown device 1c14 (rev b4)
00:1c.3 PCI bridge: Intel Corporation Unknown device 1c16 (rev b4)
00:1c.5 PCI bridge: Intel Corporation Unknown device 1c1a (rev b4)
00:1d.0 USB Controller: Intel Corporation Unknown device 1c26 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Unknown device 1c4f (rev 04)
00:1f.2 RAID bus controller: Intel Corporation Mobile 82801 SATA RAID Controller (rev 04)
00:1f.3 SMBus: Intel Corporation Unknown device 1c22 (rev 04)
08:00.0 PCI bridge: Integrated Device Technology, Inc. PES4T4 PCI Express Switch (rev 0e)
09:02.0 PCI bridge: Integrated Device Technology, Inc. PES4T4 PCI Express Switch (rev 0e)
09:03.0 PCI bridge: Integrated Device Technology, Inc. PES4T4 PCI Express Switch (rev 0e)
09:04.0 PCI bridge: Integrated Device Technology, Inc. PES4T4 PCI Express Switch (rev 0e)
0a:00.0 USB Controller: Unknown device 4d88
0a:00.1 USB Controller: Unknown device 4dc9
0a:00.2 System peripheral: Unknown device 4dca
0a:00.3 Communication controller: Unknown device 4d8b
0b:00.0 USB Controller: Unknown device 4dc0
0b:00.1 USB Controller: Unknown device 4d81
0b:00.2 System peripheral: Unknown device 4d8e
0b:00.3 Serial controller: Unknown device 4dcf
0c:00.0 USB Controller: Unknown device 4d84
0c:00.1 USB Controller: Unknown device 4dc5
0c:00.2 System peripheral: Unknown device 4dc6
0c:00.3 Communication controller: Unknown device 4d87
0d:00.0 SD Host controller: O2 Micro, Inc. Unknown device 8221 (rev 05)
0d:00.1 Mass storage controller: O2 Micro, Inc. Unknown device 8231 (rev 03)
lsusb
Bus 004 Device 001: ID 0000:0000
Bus 006 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 001 Device 002: ID 8087:0024
Bus 001 Device 001: ID 0000:0000
Bus 007 Device 001: ID 0000:0000
Bus 008 Device 001: ID 0000:0000
Bus 003 Device 003: ID 0718:063d Imation Corp.
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 002: ID 8087:0024
Bus 002 Device 004: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor
Bus 002 Device 001: ID 0000:0000
Bus 002 Device 003: ID 413c:3012 Dell Computer Corp. Optical Wheel Mouse
blkid
/dev/mapper/VolGroup00-LogVol01: TYPE="swap" UUID="6b361baf-08ae-4f2c-933b-5028c15b6fb5"
/dev/mapper/VolGroup00-LogVol00: UUID="d15840ac-0073-483d-b630-7d2a497eaac9" TYPE="ext3"
/dev/sda1: LABEL="/boot" UUID="39331b93-a08d-45b5-b1ea-fcc6586be7bd" TYPE="ext3"
/dev/VolGroup00/LogVol00: UUID="d15840ac-0073-483d-b630-7d2a497eaac9" TYPE="ext3"
/dev/VolGroup00/LogVol01: TYPE="swap" UUID="6b361baf-08ae-4f2c-933b-5028c15b6fb5"
/dev/sdb1: SEC_TYPE="msdos" LABEL="WHITE" UUID="78FE-870D" TYPE="vfat"
/dev/sdc1: SEC_TYPE="msdos" LABEL="GREEN" UUID="61FE-B32E" TYPE="vfat"
/dev/sdd1: SEC_TYPE="msdos" LABEL="RED" UUID="E5DB-4A1A" TYPE="vfat"
This is how I would do it on my system:
Step 1: Find the device node:
# blkid | grep MyDisk
/dev/sdj1: LABEL="MyDisk-0" UUID="4876-5945" TYPE="vfat"
The device node is /dev/sdj1.
Step 2: /sys is your friend:
# ll /sys/block/sdj
lrwxrwxrwx 1 root root 0 Feb 3 00:40 /sys/block/sdj -> ../devices/pci0000:00/0000:00:1a.7/usb1/1-2/1-2:1.0/host15/target15:0:0/15:0:0:0/block/sdj/
The symbolic link target above contains a lot of useful information, including the path from your flash drive back to the PCI bridge via the SCSI and USB subsystems.
Step 3: From the link target above isolate the PCI bus ID (00:1a.7 in this case) and check with lspci:
# lspci | grep 00:1a.7
00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
If in doubt, inspect the lspci output visually...
EDIT:
Here is an extremely crude and extremely fragile way to automate the process above:
blkid |
grep Label |
cut -d : -f 1 |
sed 's|[0-9]*$||; s|^/dev/|/sys/block/|' |
xargs readlink |
cut -d / -f 4 |
xargs -n 1 lspci -s
NOTE: This works on my system, but it is by no means safe (or recommended):
It will break if a kernel update changes the layout of the /sys filesystem.
It can break if you have a different device layout, although you should be able to adjust for that.

Resources