Commit 1f4a5983 authored by Ziyang Xuan's avatar Ziyang Xuan Committed by David S. Miller

net: macvlan: add net device refcount tracker

Add net device refcount tracker to macvlan.
Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 291ac684
......@@ -912,7 +912,7 @@ static int macvlan_init(struct net_device *dev)
port->count += 1;
/* Get macvlan's reference to lowerdev */
dev_hold(lowerdev);
dev_hold_track(lowerdev, &vlan->dev_tracker, GFP_KERNEL);
return 0;
}
......@@ -1181,7 +1181,7 @@ static void macvlan_dev_free(struct net_device *dev)
struct macvlan_dev *vlan = netdev_priv(dev);
/* Get rid of the macvlan's reference to lowerdev */
dev_put(vlan->lowerdev);
dev_put_track(vlan->lowerdev, &vlan->dev_tracker);
}
void macvlan_common_setup(struct net_device *dev)
......
......@@ -21,6 +21,7 @@ struct macvlan_dev {
struct hlist_node hlist;
struct macvlan_port *port;
struct net_device *lowerdev;
netdevice_tracker dev_tracker;
void *accel_priv;
struct vlan_pcpu_stats __percpu *pcpu_stats;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment