Skip to content

Commit 44e3725

Browse files
TaeheeYoodavem330
authored andcommitted
net: openvswitch: use netif_ovs_is_port() instead of opencode
Use netif_ovs_is_port() function instead of open code. This patch doesn't change logic. Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f714ecc commit 44e3725

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎net/openvswitch/dp_notify.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void ovs_dp_notify_wq(struct work_struct *work)
4848
if (vport->ops->type == OVS_VPORT_TYPE_INTERNAL)
4949
continue;
5050

51-
if (!(vport->dev->priv_flags & IFF_OVS_DATAPATH))
51+
if (!(netif_is_ovs_port(vport->dev)))
5252
dp_detach_port_notify(vport);
5353
}
5454
}

‎net/openvswitch/vport-netdev.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void ovs_netdev_detach_dev(struct vport *vport)
156156
static void netdev_destroy(struct vport *vport)
157157
{
158158
rtnl_lock();
159-
if (vport->dev->priv_flags & IFF_OVS_DATAPATH)
159+
if (netif_is_ovs_port(vport->dev))
160160
ovs_netdev_detach_dev(vport);
161161
rtnl_unlock();
162162

@@ -166,7 +166,7 @@ static void netdev_destroy(struct vport *vport)
166166
void ovs_netdev_tunnel_destroy(struct vport *vport)
167167
{
168168
rtnl_lock();
169-
if (vport->dev->priv_flags & IFF_OVS_DATAPATH)
169+
if (netif_is_ovs_port(vport->dev))
170170
ovs_netdev_detach_dev(vport);
171171

172172
/* We can be invoked by both explicit vport deletion and
@@ -186,7 +186,7 @@ EXPORT_SYMBOL_GPL(ovs_netdev_tunnel_destroy);
186186
/* Returns null if this device is not attached to a datapath. */
187187
struct vport *ovs_netdev_get_vport(struct net_device *dev)
188188
{
189-
if (likely(dev->priv_flags & IFF_OVS_DATAPATH))
189+
if (likely(netif_is_ovs_port(dev)))
190190
return (struct vport *)
191191
rcu_dereference_rtnl(dev->rx_handler_data);
192192
else

0 commit comments

Comments
 (0)