Re: [PATCH net-next v5] rtnetlink: Support fine-grained netdevice bulk deletion
flat view
From: David Ahern <hidden>
Date: 2021-12-09 00:18:57
On 12/8/21 5:04 PM, Jakub Kicinski wrote:
On Wed, 8 Dec 2021 16:43:28 -0700 David Ahern wrote:quoted
On 12/8/21 2:47 PM, Lahav Schlesinger wrote:quoted
No visible changes from what I saw, this API is as fast as group deletion. Maybe a few tens of milliseconds slower, but it's lost in the noise. I'll run more thorough benchmarks to get to a more conclusive conclusion. Also just pointing out that the sort will be needed even if we pass an array (IFLA_IFINDEX_LIST) instead. Feels like CS 101, but do you have a better approach for detecting duplicates in an array? I imagine a hash table will be slower as it will need to allocate a node object for each device (assuming we don't want to add a new hlist_node to 'struct net_device' just for this)I think marking the dev's and then using a delete loop is going to be the better approach - avoid the sort and duplicate problem. I use that approach for nexthop deletes: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/net/ipv4/nexthop.c#n1849 Find a hole in net_device struct in an area used only for control path and add 'bool grp_delete' (or a 1-bit hole). Mark the devices on pass and delete them on another.If we want to keep state in the netdev itself we can probably piggy back on dev->unreg_list. It should be initialized to empty and not touched unless device goes thru unregister.
isn't that used when the delink function calls unregister_netdevice_queue?