search for: rtnl_dereference

Displaying 20 results from an estimated 101 matches for "rtnl_dereference".

2018 Apr 06
2
[RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
...;+ >+static int virtnet_bypass_open(struct net_device *dev) >+{ >+ struct virtnet_bypass_info *vbi = netdev_priv(dev); >+ struct net_device *active_netdev, *backup_netdev; >+ int err; >+ >+ netif_carrier_off(dev); >+ netif_tx_wake_all_queues(dev); >+ >+ active_netdev = rtnl_dereference(vbi->active_netdev); >+ if (active_netdev) { >+ err = dev_open(active_netdev); >+ if (err) >+ goto err_active_open; >+ } >+ >+ backup_netdev = rtnl_dereference(vbi->backup_netdev); >+ if (backup_netdev) { >+ err = dev_open(backup_netdev); >+ if (err) >+...
2018 Apr 06
2
[RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
...;+ >+static int virtnet_bypass_open(struct net_device *dev) >+{ >+ struct virtnet_bypass_info *vbi = netdev_priv(dev); >+ struct net_device *active_netdev, *backup_netdev; >+ int err; >+ >+ netif_carrier_off(dev); >+ netif_tx_wake_all_queues(dev); >+ >+ active_netdev = rtnl_dereference(vbi->active_netdev); >+ if (active_netdev) { >+ err = dev_open(active_netdev); >+ if (err) >+ goto err_active_open; >+ } >+ >+ backup_netdev = rtnl_dereference(vbi->backup_netdev); >+ if (backup_netdev) { >+ err = dev_open(backup_netdev); >+ if (err) >+...
2018 Apr 06
0
[RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
...t; +static int >> +virtnet_bypass_ethtool_get_link_ksettings(struct net_device *dev, >> + struct ethtool_link_ksettings *cmd) >> +{ >> + struct virtnet_bypass_info *vbi = netdev_priv(dev); >> + struct net_device *child_netdev; >> + >> + child_netdev = rtnl_dereference(vbi->active_netdev); >> + if (!child_netdev || !virtnet_bypass_xmit_ready(child_netdev)) { >> + child_netdev = rtnl_dereference(vbi->backup_netdev); >> + if (!child_netdev || !virtnet_bypass_xmit_ready(child_netdev)) { >> + cmd->base.duplex = DUPLEX_UNKNOWN; &gt...
2018 Apr 05
0
[RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available
...ng stats */ + spinlock_t stats_lock; +}; + +static int virtnet_bypass_open(struct net_device *dev) +{ + struct virtnet_bypass_info *vbi = netdev_priv(dev); + struct net_device *active_netdev, *backup_netdev; + int err; + + netif_carrier_off(dev); + netif_tx_wake_all_queues(dev); + + active_netdev = rtnl_dereference(vbi->active_netdev); + if (active_netdev) { + err = dev_open(active_netdev); + if (err) + goto err_active_open; + } + + backup_netdev = rtnl_dereference(vbi->backup_netdev); + if (backup_netdev) { + err = dev_open(backup_netdev); + if (err) + goto err_backup_open; + } + + return 0; +...
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...gt;slave_pre_register) > + return -EINVAL; > + > + return failover_ops->slave_pre_register(slave_dev, > + failover_dev); > + } > + > + finfo = netdev_priv(failover_dev); > + standby = (slave_dev->dev.parent == failover_dev->dev.parent); > + if (standby ? rtnl_dereference(finfo->standby_dev) : > + rtnl_dereference(finfo->primary_dev)) { > + netdev_err(failover_dev, "%s attempting to register as slave dev when %s already present\n", > + slave_dev->name, standby ? "standby" : "primary"); > + return -EEXIST; &...
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...gt;slave_pre_register) > + return -EINVAL; > + > + return failover_ops->slave_pre_register(slave_dev, > + failover_dev); > + } > + > + finfo = netdev_priv(failover_dev); > + standby = (slave_dev->dev.parent == failover_dev->dev.parent); > + if (standby ? rtnl_dereference(finfo->standby_dev) : > + rtnl_dereference(finfo->primary_dev)) { > + netdev_err(failover_dev, "%s attempting to register as slave dev when %s already present\n", > + slave_dev->name, standby ? "standby" : "primary"); > + return -EEXIST; &...
2018 Feb 16
0
[RFC PATCH v3 2/3] virtio_net: Extend virtio to use VF datapath when available
...o open slave: %s: %d\n", + child_netdev->name, err); +} + +static int virtnet_bypass_open(struct net_device *dev) +{ + struct virtnet_bypass_info *vbi = netdev_priv(dev); + struct net_device *child_netdev; + + netif_carrier_off(dev); + netif_tx_wake_all_queues(dev); + + child_netdev = rtnl_dereference(vbi->active_netdev); + if (child_netdev) + virtnet_bypass_child_open(dev, child_netdev); + + child_netdev = rtnl_dereference(vbi->backup_netdev); + if (child_netdev) + virtnet_bypass_child_open(dev, child_netdev); + + return 0; +} + +static int virtnet_bypass_close(struct net_device *dev) +...
2018 May 07
2
[PATCH net-next v10 2/4] net: Introduce generic failover module
..._failover_get_bymac(u8 *mac, > + struct net_failover_ops **ops) > +{ > + struct net_device *failover_dev; > + struct net_failover *failover; > + > + spin_lock(&net_failover_lock); > + list_for_each_entry(failover, &net_failover_list, list) { > + failover_dev = rtnl_dereference(failover->failover_dev); > + if (ether_addr_equal(failover_dev->perm_addr, mac)) { > + *ops = rtnl_dereference(failover->ops); > + spin_unlock(&net_failover_lock); > + return failover_dev; > + } > + } > + spin_unlock(&net_failover_lock); > + return N...
2018 May 07
2
[PATCH net-next v10 2/4] net: Introduce generic failover module
..._failover_get_bymac(u8 *mac, > + struct net_failover_ops **ops) > +{ > + struct net_device *failover_dev; > + struct net_failover *failover; > + > + spin_lock(&net_failover_lock); > + list_for_each_entry(failover, &net_failover_list, list) { > + failover_dev = rtnl_dereference(failover->failover_dev); > + if (ether_addr_equal(failover_dev->perm_addr, mac)) { > + *ops = rtnl_dereference(failover->ops); > + spin_unlock(&net_failover_lock); > + return failover_dev; > + } > + } > + spin_unlock(&net_failover_lock); > + return N...
2018 Apr 20
0
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...+ if (failover_ops) { + if (!failover_ops->slave_pre_register) + return -EINVAL; + + return failover_ops->slave_pre_register(slave_dev, + failover_dev); + } + + finfo = netdev_priv(failover_dev); + standby = (slave_dev->dev.parent == failover_dev->dev.parent); + if (standby ? rtnl_dereference(finfo->standby_dev) : + rtnl_dereference(finfo->primary_dev)) { + netdev_err(failover_dev, "%s attempting to register as slave dev when %s already present\n", + slave_dev->name, standby ? "standby" : "primary"); + return -EEXIST; + } + + /* Avoid non...
2018 Apr 11
2
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...->slave_pre_register) >+ return -EINVAL; >+ >+ return bypass_ops->slave_pre_register(slave_netdev, >+ bypass_netdev); >+ } >+ >+ bi = netdev_priv(bypass_netdev); >+ backup = (slave_netdev->dev.parent == bypass_netdev->dev.parent); >+ if (backup ? rtnl_dereference(bi->backup_netdev) : >+ rtnl_dereference(bi->active_netdev)) { >+ netdev_err(bypass_netdev, "%s attempting to register as slave dev when %s already present\n", >+ slave_netdev->name, backup ? "backup" : "active"); >+ return -EEXIST; >+...
2018 Apr 11
2
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...->slave_pre_register) >+ return -EINVAL; >+ >+ return bypass_ops->slave_pre_register(slave_netdev, >+ bypass_netdev); >+ } >+ >+ bi = netdev_priv(bypass_netdev); >+ backup = (slave_netdev->dev.parent == bypass_netdev->dev.parent); >+ if (backup ? rtnl_dereference(bi->backup_netdev) : >+ rtnl_dereference(bi->active_netdev)) { >+ netdev_err(bypass_netdev, "%s attempting to register as slave dev when %s already present\n", >+ slave_netdev->name, backup ? "backup" : "active"); >+ return -EEXIST; >+...
2018 Feb 16
8
[RFC PATCH v3 0/3] Enable virtio_net to act as a backup for a passthru device
Patch 1 introduces a new feature bit VIRTIO_NET_F_BACKUP that can be used by hypervisor to indicate that virtio_net interface should act as a backup for another device with the same MAC address. Ppatch 2 is in response to the community request for a 3 netdev solution. However, it creates some issues we'll get into in a moment. It extends virtio_net to use alternate datapath when available
2018 Feb 16
8
[RFC PATCH v3 0/3] Enable virtio_net to act as a backup for a passthru device
Patch 1 introduces a new feature bit VIRTIO_NET_F_BACKUP that can be used by hypervisor to indicate that virtio_net interface should act as a backup for another device with the same MAC address. Ppatch 2 is in response to the community request for a 3 netdev solution. However, it creates some issues we'll get into in a moment. It extends virtio_net to use alternate datapath when available
2018 Apr 20
0
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...return -EINVAL; >> + >> + return failover_ops->slave_pre_register(slave_dev, >> + failover_dev); >> + } >> + >> + finfo = netdev_priv(failover_dev); >> + standby = (slave_dev->dev.parent == failover_dev->dev.parent); >> + if (standby ? rtnl_dereference(finfo->standby_dev) : >> + rtnl_dereference(finfo->primary_dev)) { >> + netdev_err(failover_dev, "%s attempting to register as slave dev when %s already present\n", >> + slave_dev->name, standby ? "standby" : "primary"); >> + r...
2018 Apr 10
0
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...if (bypass_ops) { + if (!bypass_ops->slave_pre_register) + return -EINVAL; + + return bypass_ops->slave_pre_register(slave_netdev, + bypass_netdev); + } + + bi = netdev_priv(bypass_netdev); + backup = (slave_netdev->dev.parent == bypass_netdev->dev.parent); + if (backup ? rtnl_dereference(bi->backup_netdev) : + rtnl_dereference(bi->active_netdev)) { + netdev_err(bypass_netdev, "%s attempting to register as slave dev when %s already present\n", + slave_netdev->name, backup ? "backup" : "active"); + return -EEXIST; + } + + /* Avoid non p...
2018 Apr 20
0
[PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework
...ruct net_device *vf_netdev) -{ - struct net_device *dev; - - ASSERT_RTNL(); - - for_each_netdev(&init_net, dev) { - struct net_device_context *net_device_ctx; - - if (dev->netdev_ops != &device_ops) - continue; /* not a netvsc device */ - - net_device_ctx = netdev_priv(dev); - if (!rtnl_dereference(net_device_ctx->nvdev)) - continue; /* device is removed */ - - if (rtnl_dereference(net_device_ctx->vf_netdev) == vf_netdev) - return dev; /* a match */ - } - - return NULL; -} - /* Called when VF is injecting data into network stack. * Change the associated network device from VF to...
2018 Apr 10
6
[RFC PATCH net-next v6 0/4] Enable virtio_net to act as a backup for a passthru device
The main motivation for this patch is to enable cloud service providers to provide an accelerated datapath to virtio-net enabled VMs in a transparent manner with no/minimal guest userspace changes. This also enables hypervisor controlled live migration to be supported with VMs that have direct attached SR-IOV VF devices. Patch 1 introduces a new feature bit VIRTIO_NET_F_BACKUP that can be used
2018 Apr 10
0
[RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework
...ruct net_device *vf_netdev) -{ - struct net_device *dev; - - ASSERT_RTNL(); - - for_each_netdev(&init_net, dev) { - struct net_device_context *net_device_ctx; - - if (dev->netdev_ops != &device_ops) - continue; /* not a netvsc device */ - - net_device_ctx = netdev_priv(dev); - if (!rtnl_dereference(net_device_ctx->nvdev)) - continue; /* device is removed */ - - if (rtnl_dereference(net_device_ctx->vf_netdev) == vf_netdev) - return dev; /* a match */ - } - - return NULL; -} - /* Called when VF is injecting data into network stack. * Change the associated network device from VF to...
2018 Sep 06
1
[PATCH net-next 01/11] net: sock: introduce SOCK_XDP
.../drivers/net/tun.c b/drivers/net/tun.c > index ebd07ad82431..2c548bd20393 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -869,6 +869,9 @@ static int tun_attach(struct tun_struct *tun, struct file *file, > tun_napi_init(tun, tfile, napi); > } > > + if (rtnl_dereference(tun->xdp_prog)) > + sock_set_flag(&tfile->sk, SOCK_XDP); > + > tun_set_real_num_queues(tun); > > /* device is allowed to go away first, so no need to hold extra > @@ -1241,13 +1244,29 @@ static int tun_xdp_set(struct net_device *dev, struct bpf_prog *prog, >...