Comments (10)
Interesting use case. One question: If you are unsure if the Vendor:Device
device lives at the supplied domain address, why not parse the whole PCIe tree first to find it, and use the result to bind it with the current algorithm?
from vfio-pci-bind.
The difficulty is if you have two pieces of the same hardware, they will share the Vendor:Device
code.
For instance, my motherboard has two Intel nics:
#lspci -n -d 8086:1533
02:00.0 0200: 8086:1533 (rev 03)
03:00.0 0200: 8086:1533 (rev 03)
(each with their own IOMMU group) so I need the pci address to distinguish them.
I thought about switching it and making the Vendor:Device
be the required field and Domain:Bus:Device.Function
be optional, but that would be a pretty invasive change and I didn't want to break backward compatibility.
Hmm... I suppose we don't have to break backward compatibility since we have regexes that can distinguish which parameter is which. It wouldn't be that invasive either... if you pass in just a Vendor:Device
code we could use lcpci to determine the Domain:Bus:Device.Function
and then the script can continue.
I'll take a crack at that.
The question is what should happen if you just pass a Vendor:Device
code and there are multiple results:
- bind the first one
- loop through and bind them all
- throw an error and require you to specify a pci address too
I think I'll go with option 3.
from vfio-pci-bind.
Hmm... I suppose we don't have to break backward compatibility since we have regexes that can distinguish which parameter is which. It wouldn't be that invasive either... if you pass in just a
Vendor:Device
code we could use lcpci to determine theDomain:Bus:Device.Function
and then the script can continue.
Should work. B:D.F and Vendor:Device can be distinguished fast through the ".
" character.
I'll take a crack at that.
The question is what should happen if you just pass a
Vendor:Device
code and there are multiple results:1. bind the first one 2. loop through and bind them all 3. throw an error and require you to specify a pci address too
I think I'll go with option 3.
Agree with 3.
By the way, are you planning on keeping the Ruby script in sync too?
from vfio-pci-bind.
I like this!
- If the user has a single
Vendor:Device
, they can provide that and it will be bound regardless of how the PCI address might change - If they have multiple
Vendor:Device
s, they can provide theDomain:Bus:Device.Function
for the one they want to bind - For backwards compatibility, they can also provide a
Domain:Bus:Device.Function
to bind
What do you think, do you see any issues?
I'm sorry that I have no experience with Ruby, are you up for syncing the changes there?
from vfio-pci-bind.
Actually, I think the ruby user base for this script would be very minimal. We can just delete it for now and see if someone complains.
Would be great if you can add that to your PR please?
from vfio-pci-bind.
Sure thing. I also added more detail to the readme
from vfio-pci-bind.
Awesome, thanks, is this complete and tested from your side now? I wonβt have time to test it myself the next few days. But if you say itβs good to go Iβll just merge it π
from vfio-pci-bind.
I believe this is good to go. But I have limited hardware to test on, I don't mind waiting until you've had a chance to smoke test it.
from vfio-pci-bind.
Thanks for all your work! Merged it π
from vfio-pci-bind.
Great! Thanks!
from vfio-pci-bind.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vfio-pci-bind.