{"action":"opened","issue":{"url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/587","labels_url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/587/labels{/name}","comments_url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/587/comments","events_url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/587/events","html_url":"https://github.com/SnabbCo/snabbswitch/issues/587","id":99631121,"number":587,"title":"Better way to select PCI devices?","user":{"login":"lukego","id":13791,"avatar_url":"https://avatars.githubusercontent.com/u/13791?v=3","gravatar_id":"","url":"https://api.github.com/users/lukego","html_url":"https://github.com/lukego","followers_url":"https://api.github.com/users/lukego/followers","following_url":"https://api.github.com/users/lukego/following{/other_user}","gists_url":"https://api.github.com/users/lukego/gists{/gist_id}","starred_url":"https://api.github.com/users/lukego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukego/subscriptions","organizations_url":"https://api.github.com/users/lukego/orgs","repos_url":"https://api.github.com/users/lukego/repos","events_url":"https://api.github.com/users/lukego/events{/privacy}","received_events_url":"https://api.github.com/users/lukego/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SnabbCo/snabbswitch/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/SnabbCo/snabbswitch/labels/idea","name":"idea","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-07T11:23:10Z","updated_at":"2015-08-07T11:23:10Z","closed_at":null,"body":"Currently we are expecting users to specify their PCI devices with long specific strings like `0000:01:00.0`. This is inconvenient in many situations. Let us capture the interesting use cases and come up with a better scheme to support them. I will invent an ad-hoc syntax as a starting point: pretend it is the command-line syntax of a program based on Snabb Switch.\r\n\r\nYou could write `-d 01:00.0` to refer to a specific device. (That is the same syntax as now but allowing with an abbreviated form.)\r\n\r\nYou could write `-d :intel10g` to refer to any available device that suits the `intel10g` app/driver. This would be fine for a test application that can use any available port.\r\n\r\nYou could write `-d $a.0:intel10g -d $a.1` to specify a pair of ports with a common prefix i.e. the first two ports (`.0` and `.1`) on the same PCI card. This would be handy when running the `intel_app` selftest that can use any two ports provided that they are cabled directly together.\r\n\r\nCould also be that it would be worth creating a convention for naming and grouping ports. This could become complex in a containerized environment if there are many programs accessing the same devices via `/sys/` but without a common filesystem."}}