aregm / nff-go

NFF-Go -Network Function Framework for GO (former YANFF)
BSD 3-Clause "New" or "Revised" License
1.38k stars 156 forks source link

fix get PCI device ID #648

Closed guesslin closed 4 years ago

guesslin commented 5 years ago

For some NIC the readlink /sys/class/net/<nic_name> would get several PCI address and the correct one would be the second one, e.g.

$ readlink -f /sys/class/net/ens224
/sys/devices/pci0000:00/0000:00:17.0/0000:13:00.0/net/ens224

To get the correct device ID, we have to check if the second one 0000:13:00.0 is a PCI address, return the second one, else return the first one 0000:00:17.0

Signed-off-by: Yu-Han Lin guesslin@glasnostic.com

gshimansky commented 5 years ago

Hello @guesslin . Can you please retarget your change to develop branch? Master is for releases and brief changes to README. I tried to change the target branch for your pull request, but I got conflicts, so it is better if you do it yourself.

guesslin commented 4 years ago

@gshimansky ok, I update the target from master to develop, please have a look :)