Retain the PF-known MAC and allocated transmit and receive queue counts for each VF and expose them through the PF ifnet. Sum queues across all hardware functions rather than reporting only the first one. Publish and snapshot the VF cache under the existing hardware lock. Unpublish it before hardware teardown, and invalidate queue-allocation knowledge when error recovery releases the underlying VF resources. Initialize the cache, release it on failed initialization, and reject an out-of-range VF index instead of continuing into the array.
Details
Details
- Reviewers
zlei
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
This is a basic implementation, someone more familiar with the driver may look at the nvlist schema and https://reviews.freebsd.org/D58739 which demonstrates driver extensions.
Comment Actions
@kbowling I have the hardware ( QLogic FastLinQ QL41000 ) which is supported by this driver. Do you want me to test with this new feature ?
Comment Actions
The report looks good. Nice work !
For the configured interface ql1,
root@:~ # cat ql.iovctl.conf
PF {
device : "ql1";
num_vfs : 4;
}
DEFAULT {
passthrough : true;
}
VF-0 {
passthrough : false;
}
VF-1 {
passthrough : false;
}
root@:~ # iovctl -C -f ql.iovctl.conf
root@:~ # iovctl -L -d ql1
ql1:
identity: pci-location=pci0:8:0:1
sriov: enabled=yes vfs=4/96
vf 0:
identity: pci-location=pci0:8:0:112
host: attached=no passthrough=no
vf 1:
identity: pci-location=pci0:8:0:113
host: attached=no passthrough=no
vf 2:
identity: pci-location=pci0:8:0:114
host: attached=no passthrough=yes
vf 3:
identity: pci-location=pci0:8:0:115
host: attached=no passthrough=yes
root@:~ # ifconfig -v ql1
ql1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=8d07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,LINKSTATE,HWSTATS>
ether 34:80:0d:xx:xx:xx
media: Ethernet autoselect (25GBase-SR <full-duplex>)
status: active
nd6 options=829<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL,STABLEADDR>
VF-visible PF link: state=up speed=25000Mbps
virtual functions: 4
vf 0:
state: configured=yes
resources: tx-queues=16 rx-queues=16
vf 1:
state: configured=yes
resources: tx-queues=16 rx-queues=16
vf 2:
state: configured=yes
resources: tx-queues=16 rx-queues=16
vf 3:
state: configured=yes
resources: tx-queues=16 rx-queues=16
drivername: ql1
plugged: SFP/SFP+/SFP28 100G AOC (Active Optical Cable) (Optical pigtail)
vendor: FINISAR CORP PN: FCBG125SD1C05A SN: XXXXXXX DATE: 2020-06-25
module temperature: 59.57 C voltage: 3.33 Volts
lane 1: RX power: 1.51 mW (1.79 dBm) TX bias: 7.79 mAFor the unconfigured one ql0,
root@:~ # iovctl -L -d ql0 ql0: identity: pci-location=pci0:8:0:0 sriov: enabled=no vfs=0/96 root@:~ # ifconfig -v ql0 ql0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=8d07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,LINKSTATE,HWSTATS> ether 34:80:0d:xx:xx:xx media: Ethernet autoselect status: no carrier nd6 options=829<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL,STABLEADDR> VF-visible PF link: state=down speed=25000Mbps virtual functions: 0 drivername: ql0 plugged: SFP/SFP+/SFP28 25GBASE-CR CA-25G-N (Copper pigtail) vendor: OEM PN: SFP-H25G-CU2M SN: XXXXXXXXXXXXXXX DATE: 2024-09-28
Another card with the SR-IOV feature disabled,
root@:~ # iovctl -L -d ql0 iovctl: Could not open device '/dev/iov/ql0': No such file or directory root@:~ # ifconfig -v ql0 ql0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=8d07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,LINKSTATE,HWSTATS> ether f4:e9:d4:xx:xx:xx media: Ethernet autoselect (10Gbase-SR <full-duplex>) status: active nd6 options=829<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL,STABLEADDR> drivername: ql0 plugged: SFP/SFP+/SFP28 10G Base-SR (LC) vendor: OEM PN: GSS-MDO100-005C SN: XXXXXXXXXXXX DATE: 2020-08-07 module temperature: 52.14 C voltage: 3.30 Volts lane 1: RX power: 0.34 mW (-4.75 dBm) TX bias: 5.35 mA
| sys/dev/qlnx/qlnxe/qlnx_os.c | ||
|---|---|---|
| 8030 | Is this re-check to prevent concurrent configuration ( SR-IOV config ) on the interface ? | |
| 8068 | I'm not sure, but it appears not possible to have both ha->num_vfs != 0 and ha->vf_attr == NULL. | |
| 8078 | Should be safe to use memcpy() than bcopy() . | |