hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/net/openvswitch/vport-netdev.c
....@@ -1,19 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * 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
174 */
185
196 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -84,7 +71,6 @@
8471 struct vport *local;
8572
8673 local = ovs_vport_ovsl(dp, OVSP_LOCAL);
87
- BUG_ON(!local);
8874 return local->dev;
8975 }
9076
....@@ -170,7 +156,7 @@
170156 static void netdev_destroy(struct vport *vport)
171157 {
172158 rtnl_lock();
173
- if (vport->dev->priv_flags & IFF_OVS_DATAPATH)
159
+ if (netif_is_ovs_port(vport->dev))
174160 ovs_netdev_detach_dev(vport);
175161 rtnl_unlock();
176162
....@@ -180,7 +166,7 @@
180166 void ovs_netdev_tunnel_destroy(struct vport *vport)
181167 {
182168 rtnl_lock();
183
- if (vport->dev->priv_flags & IFF_OVS_DATAPATH)
169
+ if (netif_is_ovs_port(vport->dev))
184170 ovs_netdev_detach_dev(vport);
185171
186172 /* We can be invoked by both explicit vport deletion and
....@@ -200,7 +186,7 @@
200186 /* Returns null if this device is not attached to a datapath. */
201187 struct vport *ovs_netdev_get_vport(struct net_device *dev)
202188 {
203
- if (likely(dev->priv_flags & IFF_OVS_DATAPATH))
189
+ if (likely(netif_is_ovs_port(dev)))
204190 return (struct vport *)
205191 rcu_dereference_rtnl(dev->rx_handler_data);
206192 else