Let's summarize and resume this thread. We need a generic syntax to describe a device. This syntax can be used - before initializing the device (i.e. whitelist/blacklist) - or after the initialization (e.g. user config)
We need to answer 4 questions: 1/ what are the separators (comma, colon, etc)? 2/ how to distinguish a device identification from a configuration? 3/ what are the mandatory parts? 4/ what can be the optional properties? 30/11/2017 08:35, Yuanhan Liu: > What this patch proposes is to use "name[,mac]" syntax. "name" is the > PCI id for pci device. For vdev, it's the vdev name given by user. The > reason "mac" is needed is for some devices (say ConnectX-3), 2 ports > (in a single NIC) have the same PCI id. Based on the feedbacks we had, I suggest a syntax where everything is optional key/value pairs, and split in 3 categories: - bus (pci, vdev, vmbus, fslmc, etc) - class (eth, crypto) - driver (i40e, mlx5, virtio, etc) Between categories, the separator is a slash. Inside a category, the separator is a comma. Inside a key/value pair, the separator is an equal sign. It may look like this: bus=BUS_NAME,id=BUS_ID/class=CLASS_NAME,dev_port=PORT_NUM,mac=MAC_ADDRESS/driver=DRIVER_NAME,driverspecificproperty=VALUE A device is identified when every properties are matched. Before device is probed, only the bus category is relevant. For the simple PCI whitelist, it means moving from -w 0000:01:00.0 to -w bus=pci,id=0000:01:00.0 It is possible to mix some settings in these devargs syntax if the keys are differents. Example: mac= is for identification by MAC, whereas newmac= would be for specifying a MAC address to set. Agreement?