On Fri, 19 Apr 2019 07:25:01 +0200, Jiri Pirko wrote: > >Hm.. I'm getting lost, sorry, I'm probably confusing myself here.. > > > >Netdevsim is supposed to test real, existing kernel interfaces and core > >code. What we do today with linking based on netdevs is quite simple > >and works very well for the BPF offload tests. > > > >If you want to test some devlink code, that's also real, perfect. > > > >For BPF tests we want the ability to add and remove netdevs to a sdev > >during tests, yes. That ability cannot be lost. > > Yeah, but since the api is changing, the original approach of using > IFLA_LINK cannot be used anymore. Not to mention is is abuse of the API > from the very beginning. You want to add/del ports during lifetime, I'm > trying to find interface. Basically whe have two options: > 1) devlink extension I suggested above > 2) sysfs files to add/del ports. Similar to "new_device" and > "del_device". > > I like the idea of having 2) better, the reason is this is very speficic > to netdevsim and not really applicable on real devices.
Sure, if custom sysfs API is any better than the use of IFLA_LINK in a test mock up, go for it. Creating a custom devlink ABI for a test mockup netdev seems like a bad idea.