diff options
Diffstat (limited to 'net/openvswitch/vport-netdev.c')
-rw-r--r-- | net/openvswitch/vport-netdev.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c index 3c1e58ba714b..a9327e2e48ce 100644 --- a/net/openvswitch/vport-netdev.c +++ b/net/openvswitch/vport-netdev.c | |||
@@ -114,6 +114,15 @@ error: | |||
114 | return ERR_PTR(err); | 114 | return ERR_PTR(err); |
115 | } | 115 | } |
116 | 116 | ||
117 | static void free_port_rcu(struct rcu_head *rcu) | ||
118 | { | ||
119 | struct netdev_vport *netdev_vport = container_of(rcu, | ||
120 | struct netdev_vport, rcu); | ||
121 | |||
122 | dev_put(netdev_vport->dev); | ||
123 | ovs_vport_free(vport_from_priv(netdev_vport)); | ||
124 | } | ||
125 | |||
117 | static void netdev_destroy(struct vport *vport) | 126 | static void netdev_destroy(struct vport *vport) |
118 | { | 127 | { |
119 | struct netdev_vport *netdev_vport = netdev_vport_priv(vport); | 128 | struct netdev_vport *netdev_vport = netdev_vport_priv(vport); |
@@ -122,10 +131,7 @@ static void netdev_destroy(struct vport *vport) | |||
122 | netdev_rx_handler_unregister(netdev_vport->dev); | 131 | netdev_rx_handler_unregister(netdev_vport->dev); |
123 | dev_set_promiscuity(netdev_vport->dev, -1); | 132 | dev_set_promiscuity(netdev_vport->dev, -1); |
124 | 133 | ||
125 | synchronize_rcu(); | 134 | call_rcu(&netdev_vport->rcu, free_port_rcu); |
126 | |||
127 | dev_put(netdev_vport->dev); | ||
128 | ovs_vport_free(vport); | ||
129 | } | 135 | } |
130 | 136 | ||
131 | const char *ovs_netdev_get_name(const struct vport *vport) | 137 | const char *ovs_netdev_get_name(const struct vport *vport) |
@@ -158,7 +164,7 @@ static int netdev_send(struct vport *vport, struct sk_buff *skb) | |||
158 | 164 | ||
159 | if (unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) { | 165 | if (unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) { |
160 | net_warn_ratelimited("%s: dropped over-mtu packet: %d > %d\n", | 166 | net_warn_ratelimited("%s: dropped over-mtu packet: %d > %d\n", |
161 | ovs_dp_name(vport->dp), | 167 | netdev_vport->dev->name, |
162 | packet_length(skb), mtu); | 168 | packet_length(skb), mtu); |
163 | goto error; | 169 | goto error; |
164 | } | 170 | } |