mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
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>
This commit is contained in:
parent
f714ecc9cf
commit
44e3725943
2 changed files with 4 additions and 4 deletions
|
@ -48,7 +48,7 @@ void ovs_dp_notify_wq(struct work_struct *work)
|
||||||
if (vport->ops->type == OVS_VPORT_TYPE_INTERNAL)
|
if (vport->ops->type == OVS_VPORT_TYPE_INTERNAL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(vport->dev->priv_flags & IFF_OVS_DATAPATH))
|
if (!(netif_is_ovs_port(vport->dev)))
|
||||||
dp_detach_port_notify(vport);
|
dp_detach_port_notify(vport);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ void ovs_netdev_detach_dev(struct vport *vport)
|
||||||
static void netdev_destroy(struct vport *vport)
|
static void netdev_destroy(struct vport *vport)
|
||||||
{
|
{
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
if (vport->dev->priv_flags & IFF_OVS_DATAPATH)
|
if (netif_is_ovs_port(vport->dev))
|
||||||
ovs_netdev_detach_dev(vport);
|
ovs_netdev_detach_dev(vport);
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ static void netdev_destroy(struct vport *vport)
|
||||||
void ovs_netdev_tunnel_destroy(struct vport *vport)
|
void ovs_netdev_tunnel_destroy(struct vport *vport)
|
||||||
{
|
{
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
if (vport->dev->priv_flags & IFF_OVS_DATAPATH)
|
if (netif_is_ovs_port(vport->dev))
|
||||||
ovs_netdev_detach_dev(vport);
|
ovs_netdev_detach_dev(vport);
|
||||||
|
|
||||||
/* We can be invoked by both explicit vport deletion and
|
/* We can be invoked by both explicit vport deletion and
|
||||||
|
@ -186,7 +186,7 @@ EXPORT_SYMBOL_GPL(ovs_netdev_tunnel_destroy);
|
||||||
/* Returns null if this device is not attached to a datapath. */
|
/* Returns null if this device is not attached to a datapath. */
|
||||||
struct vport *ovs_netdev_get_vport(struct net_device *dev)
|
struct vport *ovs_netdev_get_vport(struct net_device *dev)
|
||||||
{
|
{
|
||||||
if (likely(dev->priv_flags & IFF_OVS_DATAPATH))
|
if (likely(netif_is_ovs_port(dev)))
|
||||||
return (struct vport *)
|
return (struct vport *)
|
||||||
rcu_dereference_rtnl(dev->rx_handler_data);
|
rcu_dereference_rtnl(dev->rx_handler_data);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue