# 查看CPU core的numa
lscpu -a -p=cpu,node
查询PCIe设备所属numa
cat /sys/class/net/eth2/device/numa_node
1. PF和VF互转
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. 网卡名字与BDF互转
bdf -> name
ls /sys/bus/pci/devices/$i/net
name->bdf
ll /sys/class/net/eth5/device
3. 网卡绑定驱动
当前使用的驱动
# 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