# 查看CPU core的numa
lscpu -a -p=cpu,node
查詢PCIe設(shè)備所屬numa
cat /sys/class/net/eth2/device/numa_node
1. PF和VF互轉(zhuǎn)
pf-vf:
echo "physfn is $1"
echo "pf info:"
ls /sys/class/net/$1 -l
echo "vf info:"
eth_dev=`ls /sys/class/net/$1/device/virtfn* -l | cut -d ">" -f 2 |cut -d "/" -f 2`
for i in $eth_dev; do echo "`ls /sys/bus/pci/devices/$i/net` --> $i"; done
vf-pf:
echo "vf info:"
ls /sys/class/net/$1 -l
NAME=`ls /sys/class/net/$1/device/physfn/net/`
echo "pf info:"
echo "physfn is $NAME"
ls /sys/class/net/$NAME -l
2.?網(wǎng)卡名字與BDF互轉(zhuǎn)
bdf -> name
ls /sys/bus/pci/devices/$i/net
name->bdf
ll /sys/class/net/eth5/device
3.?網(wǎng)卡綁定驅(qū)動
當前使用的驅(qū)動
# ll /sys/bus/pci/devices/0000:af:00.2/driver
lrwxrwxrwx 1 root root 0 Aug 15 22:03 /sys/bus/pci/devices/0000:af:00.2/driver -> ../../../../bus/pci/drivers/mlx5_core