Lines Matching refs:peer

74 	struct net_device __rcu	*peer;  member
200 struct net_device *peer = rtnl_dereference(priv->peer); in veth_get_ethtool_stats() local
203 data[0] = peer ? peer->ifindex : 0; in veth_get_ethtool_stats()
222 if (!peer) in veth_get_ethtool_stats()
225 rcv_priv = netdev_priv(peer); in veth_get_ethtool_stats()
226 for (i = 0; i < peer->real_num_rx_queues; i++) { in veth_get_ethtool_stats()
355 rcv = rcu_dereference(priv->peer); in veth_xmit()
426 struct net_device *peer; in veth_get_stats64() local
439 peer = rcu_dereference(priv->peer); in veth_get_stats64()
440 if (peer) { in veth_get_stats64()
443 dev_fetch_sw_netstats(&tot_peer, peer->tstats); in veth_get_stats64()
447 veth_stats_rx(&rx, peer); in veth_get_stats64()
471 return rcu_dereference(priv->peer); in veth_peer_dev()
488 rcv = rcu_dereference(priv->peer); in veth_xdp_xmit()
578 rcv = rcu_dereference(priv->peer); in veth_xdp_flush()
1241 struct net_device *peer; in veth_set_xdp_features() local
1243 peer = rtnl_dereference(priv->peer); in veth_set_xdp_features()
1244 if (peer && peer->real_num_tx_queues <= dev->real_num_rx_queues) { in veth_set_xdp_features()
1245 struct veth_priv *priv_peer = netdev_priv(peer); in veth_set_xdp_features()
1250 if (priv_peer->_xdp_prog || veth_gro_requested(peer)) in veth_set_xdp_features()
1265 struct net_device *peer; in veth_set_channels() local
1273 peer = rtnl_dereference(priv->peer); in veth_set_channels()
1274 peer_priv = peer ? netdev_priv(peer) : NULL; in veth_set_channels()
1275 if (priv->_xdp_prog && peer && ch->rx_count < peer->real_num_tx_queues) in veth_set_channels()
1278 if (peer && peer_priv && peer_priv->_xdp_prog && ch->tx_count > peer->real_num_rx_queues) in veth_set_channels()
1286 if (peer) in veth_set_channels()
1287 netif_carrier_off(peer); in veth_set_channels()
1322 if (peer) in veth_set_channels()
1323 netif_carrier_on(peer); in veth_set_channels()
1328 if (peer) in veth_set_channels()
1329 veth_set_xdp_features(peer); in veth_set_channels()
1342 struct net_device *peer = rtnl_dereference(priv->peer); in veth_open() local
1345 if (!peer) in veth_open()
1358 if (peer->flags & IFF_UP) { in veth_open()
1360 netif_carrier_on(peer); in veth_open()
1371 struct net_device *peer = rtnl_dereference(priv->peer); in veth_close() local
1374 if (peer) in veth_close()
1375 netif_carrier_off(peer); in veth_close()
1444 struct net_device *peer; in veth_get_iflink() local
1448 peer = rcu_dereference(priv->peer); in veth_get_iflink()
1449 iflink = peer ? READ_ONCE(peer->ifindex) : 0; in veth_get_iflink()
1459 struct net_device *peer; in veth_fix_features() local
1461 peer = rtnl_dereference(priv->peer); in veth_fix_features()
1462 if (peer) { in veth_fix_features()
1463 struct veth_priv *peer_priv = netdev_priv(peer); in veth_fix_features()
1477 struct net_device *peer; in veth_set_features() local
1483 peer = rtnl_dereference(priv->peer); in veth_set_features()
1489 if (peer) in veth_set_features()
1490 xdp_features_set_redirect_target(peer, true); in veth_set_features()
1492 if (peer) in veth_set_features()
1493 xdp_features_clear_redirect_target(peer); in veth_set_features()
1502 struct net_device *peer; in veth_set_rx_headroom() local
1508 peer = rcu_dereference(priv->peer); in veth_set_rx_headroom()
1509 if (unlikely(!peer)) in veth_set_rx_headroom()
1512 peer_priv = netdev_priv(peer); in veth_set_rx_headroom()
1516 peer->needed_headroom = new_hr; in veth_set_rx_headroom()
1527 struct net_device *peer; in veth_xdp_set() local
1533 peer = rtnl_dereference(priv->peer); in veth_xdp_set()
1536 if (!peer) { in veth_xdp_set()
1543 peer->hard_header_len; in veth_xdp_set()
1550 if (peer->mtu > max_mtu) { in veth_xdp_set()
1556 if (dev->real_num_rx_queues < peer->real_num_tx_queues) { in veth_xdp_set()
1571 peer->hw_features &= ~NETIF_F_GSO_SOFTWARE; in veth_xdp_set()
1572 peer->max_mtu = max_mtu; in veth_xdp_set()
1575 xdp_features_set_redirect_target(peer, true); in veth_xdp_set()
1580 if (peer && !veth_gro_requested(dev)) in veth_xdp_set()
1581 xdp_features_clear_redirect_target(peer); in veth_xdp_set()
1586 if (peer) { in veth_xdp_set()
1587 peer->hw_features |= NETIF_F_GSO_SOFTWARE; in veth_xdp_set()
1588 peer->max_mtu = ETH_MAX_MTU; in veth_xdp_set()
1594 if ((!!old_prog ^ !!prog) && peer) in veth_xdp_set()
1595 netdev_update_features(peer); in veth_xdp_set()
1773 struct net_device *peer; in veth_newlink() local
1815 peer = rtnl_create_link(net, ifname, name_assign_type, in veth_newlink()
1817 if (IS_ERR(peer)) { in veth_newlink()
1819 return PTR_ERR(peer); in veth_newlink()
1823 eth_hw_addr_random(peer); in veth_newlink()
1826 peer->ifindex = ifmp->ifi_index; in veth_newlink()
1828 netif_inherit_tso_max(peer, dev); in veth_newlink()
1830 err = register_netdevice(peer); in veth_newlink()
1839 veth_disable_gro(peer); in veth_newlink()
1840 netif_carrier_off(peer); in veth_newlink()
1842 err = rtnl_configure_link(peer, ifmp, 0, NULL); in veth_newlink()
1872 rcu_assign_pointer(priv->peer, peer); in veth_newlink()
1877 priv = netdev_priv(peer); in veth_newlink()
1878 rcu_assign_pointer(priv->peer, dev); in veth_newlink()
1879 err = veth_init_queues(peer, tb); in veth_newlink()
1886 veth_set_xdp_features(peer); in veth_newlink()
1895 unregister_netdevice(peer); in veth_newlink()
1899 free_netdev(peer); in veth_newlink()
1906 struct net_device *peer; in veth_dellink() local
1909 peer = rtnl_dereference(priv->peer); in veth_dellink()
1915 RCU_INIT_POINTER(priv->peer, NULL); in veth_dellink()
1918 if (peer) { in veth_dellink()
1919 priv = netdev_priv(peer); in veth_dellink()
1920 RCU_INIT_POINTER(priv->peer, NULL); in veth_dellink()
1921 unregister_netdevice_queue(peer, head); in veth_dellink()
1932 struct net_device *peer = rtnl_dereference(priv->peer); in veth_get_link_net() local
1934 return peer ? dev_net(peer) : dev_net(dev); in veth_get_link_net()