.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2007-2012 Nicira, Inc. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or |
---|
5 | | - * modify it under the terms of version 2 of the GNU General Public |
---|
6 | | - * License as published by the Free Software Foundation. |
---|
7 | | - * |
---|
8 | | - * This program is distributed in the hope that it will be useful, but |
---|
9 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
11 | | - * General Public License for more details. |
---|
12 | | - * |
---|
13 | | - * You should have received a copy of the GNU General Public License |
---|
14 | | - * along with this program; if not, write to the Free Software |
---|
15 | | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
---|
16 | | - * 02110-1301, USA |
---|
17 | 4 | */ |
---|
18 | 5 | |
---|
19 | 6 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
84 | 71 | struct vport *local; |
---|
85 | 72 | |
---|
86 | 73 | local = ovs_vport_ovsl(dp, OVSP_LOCAL); |
---|
87 | | - BUG_ON(!local); |
---|
88 | 74 | return local->dev; |
---|
89 | 75 | } |
---|
90 | 76 | |
---|
.. | .. |
---|
170 | 156 | static void netdev_destroy(struct vport *vport) |
---|
171 | 157 | { |
---|
172 | 158 | rtnl_lock(); |
---|
173 | | - if (vport->dev->priv_flags & IFF_OVS_DATAPATH) |
---|
| 159 | + if (netif_is_ovs_port(vport->dev)) |
---|
174 | 160 | ovs_netdev_detach_dev(vport); |
---|
175 | 161 | rtnl_unlock(); |
---|
176 | 162 | |
---|
.. | .. |
---|
180 | 166 | void ovs_netdev_tunnel_destroy(struct vport *vport) |
---|
181 | 167 | { |
---|
182 | 168 | rtnl_lock(); |
---|
183 | | - if (vport->dev->priv_flags & IFF_OVS_DATAPATH) |
---|
| 169 | + if (netif_is_ovs_port(vport->dev)) |
---|
184 | 170 | ovs_netdev_detach_dev(vport); |
---|
185 | 171 | |
---|
186 | 172 | /* We can be invoked by both explicit vport deletion and |
---|
.. | .. |
---|
200 | 186 | /* Returns null if this device is not attached to a datapath. */ |
---|
201 | 187 | struct vport *ovs_netdev_get_vport(struct net_device *dev) |
---|
202 | 188 | { |
---|
203 | | - if (likely(dev->priv_flags & IFF_OVS_DATAPATH)) |
---|
| 189 | + if (likely(netif_is_ovs_port(dev))) |
---|
204 | 190 | return (struct vport *) |
---|
205 | 191 | rcu_dereference_rtnl(dev->rx_handler_data); |
---|
206 | 192 | else |
---|