Skip to content

Commit f5c3820

Browse files
nhormandavem330
authored andcommitted
netprio_cgroup: don't allocate prio table when a device is registered
So we delay the allocation till the priority is set through cgroup, and this makes skb_update_priority() faster when it's not set. This also eliminates an off-by-one bug similar with the one fixed in the previous patch. Origionally-authored-by: Li Zefan <[email protected]> Signed-off-by: Li Zefan <[email protected]> Signed-off-by: Neil Horman <[email protected]> CC: "David S. Miller" <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a87dfe1 commit f5c3820

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

net/core/netprio_cgroup.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,19 +271,13 @@ static int netprio_device_event(struct notifier_block *unused,
271271
{
272272
struct net_device *dev = ptr;
273273
struct netprio_map *old;
274-
u32 max_len = atomic_read(&max_prioidx);
275274

276275
/*
277276
* Note this is called with rtnl_lock held so we have update side
278277
* protection on our rcu assignments
279278
*/
280279

281280
switch (event) {
282-
283-
case NETDEV_REGISTER:
284-
if (max_len)
285-
extend_netdev_table(dev, max_len);
286-
break;
287281
case NETDEV_UNREGISTER:
288282
old = rtnl_dereference(dev->priomap);
289283
RCU_INIT_POINTER(dev->priomap, NULL);

0 commit comments

Comments
 (0)