search for: ether_addr_equal

Displaying 20 results from an estimated 51 matches for "ether_addr_equal".

2018 May 07
2
[PATCH net-next v10 2/4] net: Introduce generic failover module
...over_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 NULL; > +} This is broken if non-ethernet devices such...
2018 May 07
2
[PATCH net-next v10 2/4] net: Introduce generic failover module
...over_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 NULL; > +} This is broken if non-ethernet devices such...
2018 Apr 06
1
[RFC PATCH net-next v5 2/4] net: Introduce generic bypass module
...>+ >+ list_for_each_entry(bypass, &bypass_list, list) { >+ mutex_lock(&bypass->lock); >+ list_for_each_entry(bypass_instance, &bypass->instance_list, >+ list) { >+ bypass_netdev = >+ rcu_dereference(bypass_instance->bypass_netdev); >+ if (ether_addr_equal(bypass_netdev->perm_addr, mac)) { >+ mutex_unlock(&bypass->lock); >+ goto out; >+ } >+ } >+ mutex_unlock(&bypass->lock); >+ } >+ >+ bypass_instance = NULL; >+out: >+ return bypass_instance; >+} >+ >+static int bypass_register_child(s...
2018 Apr 05
0
[RFC PATCH net-next v5 2/4] net: Introduce generic bypass module
...etdev; + struct bypass *bypass; + + list_for_each_entry(bypass, &bypass_list, list) { + mutex_lock(&bypass->lock); + list_for_each_entry(bypass_instance, &bypass->instance_list, + list) { + bypass_netdev = + rcu_dereference(bypass_instance->bypass_netdev); + if (ether_addr_equal(bypass_netdev->perm_addr, mac)) { + mutex_unlock(&bypass->lock); + goto out; + } + } + mutex_unlock(&bypass->lock); + } + + bypass_instance = NULL; +out: + return bypass_instance; +} + +static int bypass_register_child(struct net_device *child_netdev) +{ + struct bypass_i...
2018 May 08
0
[PATCH net-next v10 2/4] net: Introduce generic failover module
...> + 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 NULL; >> +} > This is...
2018 May 24
0
[PATCH net-next v12 1/5] net: Introduce generic failover module
...net_device *failover_get_bymac(u8 *mac, struct failover_ops **ops) +{ + struct net_device *failover_dev; + struct failover *failover; + + spin_lock(&failover_lock); + list_for_each_entry(failover, &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(&failover_lock); + return failover_dev; + } + } + spin_unlock(&failover_lock); + return NULL; +} + +/** + * failover_slave_register - Register a slave netdev + * + * @slave_dev: slave netde...
2018 Feb 17
1
[RFC PATCH v3 2/3] virtio_net: Extend virtio to use VF datapath when available
...ss device */ Is there anything inherently wrong with enslaving another virtio dev now? I was expecting something like a hash map to map MAC addr -> master and then one can check if dev is already enslaved to that master. Just a random thought, I'm probably missing something... > + if (ether_addr_equal(mac, dev->perm_addr)) > + return dev; > + } > + > + return NULL; > +} > + > +static struct net_device * > +get_virtnet_bypass_byref(struct net_device *child_netdev) > +{ > + struct net *net = dev_net(child_netdev); > + struct net_device *dev; > + > + ASSE...
2018 May 22
0
[PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework
...ink_change(struct work_struct *w) rtnl_unlock(); } -static struct net_device *get_netvsc_bymac(const u8 *mac) -{ - struct net_device *dev; - - ASSERT_RTNL(); - - for_each_netdev(&init_net, dev) { - if (dev->netdev_ops != &device_ops) - continue; /* not a netvsc device */ - - if (ether_addr_equal(mac, dev->perm_addr)) - return dev; - } - - return NULL; -} - -static struct net_device *get_netvsc_byref(struct 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->netde...
2018 Apr 25
0
[PATCH net-next v8 4/4] netvsc: refactor notifier/event handling code to use the failover framework
...ink_change(struct work_struct *w) rtnl_unlock(); } -static struct net_device *get_netvsc_bymac(const u8 *mac) -{ - struct net_device *dev; - - ASSERT_RTNL(); - - for_each_netdev(&init_net, dev) { - if (dev->netdev_ops != &device_ops) - continue; /* not a netvsc device */ - - if (ether_addr_equal(mac, dev->perm_addr)) - return dev; - } - - return NULL; -} - -static struct net_device *get_netvsc_byref(struct 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->netde...
2018 May 07
0
[PATCH net-next v10 4/4] netvsc: refactor notifier/event handling code to use the failover framework
...ink_change(struct work_struct *w) rtnl_unlock(); } -static struct net_device *get_netvsc_bymac(const u8 *mac) -{ - struct net_device *dev; - - ASSERT_RTNL(); - - for_each_netdev(&init_net, dev) { - if (dev->netdev_ops != &device_ops) - continue; /* not a netvsc device */ - - if (ether_addr_equal(mac, dev->perm_addr)) - return dev; - } - - return NULL; -} - -static struct net_device *get_netvsc_byref(struct 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->netde...
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...struct failover_ops **ops) > +{ > + struct net_device *failover_dev; > + struct failover *failover; > + > + spin_lock(&failover_lock); > + list_for_each_entry(failover, &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(&failover_lock); > + return failover_dev; > + } > + } > + spin_unlock(&failover_lock); > + return NULL; > +} > + > +static int failover_slave_register(stru...
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...struct failover_ops **ops) > +{ > + struct net_device *failover_dev; > + struct failover *failover; > + > + spin_lock(&failover_lock); > + list_for_each_entry(failover, &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(&failover_lock); > + return failover_dev; > + } > + } > + spin_unlock(&failover_lock); > + return NULL; > +} > + > +static int failover_slave_register(stru...
2018 Apr 11
2
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...{ As I wrote the last time, you don't need this list, spinlock. You can do just something like: for_each_net(net) { for_each_netdev(net, dev) { if (netif_is_bypass_master(dev)) { >+ bypass_netdev = rcu_dereference(bypass_master->bypass_netdev); >+ if (ether_addr_equal(bypass_netdev->perm_addr, mac)) { >+ *ops = rcu_dereference(bypass_master->ops); I don't see how rcu_dereference is ok here. 1) I don't see rcu_read_lock taken 2) Looks like bypass_master->ops has the same value across the whole existence. >+ spin_unlock(&bypass...
2018 Apr 11
2
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...{ As I wrote the last time, you don't need this list, spinlock. You can do just something like: for_each_net(net) { for_each_netdev(net, dev) { if (netif_is_bypass_master(dev)) { >+ bypass_netdev = rcu_dereference(bypass_master->bypass_netdev); >+ if (ether_addr_equal(bypass_netdev->perm_addr, mac)) { >+ *ops = rcu_dereference(bypass_master->ops); I don't see how rcu_dereference is ok here. 1) I don't see rcu_read_lock taken 2) Looks like bypass_master->ops has the same value across the whole existence. >+ spin_unlock(&bypass...
2018 Apr 10
0
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...u8 *mac, + struct bypass_ops **ops) +{ + struct bypass_master *bypass_master; + struct net_device *bypass_netdev; + + spin_lock(&bypass_lock); + list_for_each_entry(bypass_master, &bypass_master_list, list) { + bypass_netdev = rcu_dereference(bypass_master->bypass_netdev); + if (ether_addr_equal(bypass_netdev->perm_addr, mac)) { + *ops = rcu_dereference(bypass_master->ops); + spin_unlock(&bypass_lock); + return bypass_netdev; + } + } + spin_unlock(&bypass_lock); + return NULL; +} + +static int bypass_slave_register(struct net_device *slave_netdev) +{ + struct net_devic...
2018 Apr 20
0
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...net_device *failover_get_bymac(u8 *mac, struct failover_ops **ops) +{ + struct net_device *failover_dev; + struct failover *failover; + + spin_lock(&failover_lock); + list_for_each_entry(failover, &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(&failover_lock); + return failover_dev; + } + } + spin_unlock(&failover_lock); + return NULL; +} + +static int failover_slave_register(struct net_device *slave_dev) +{ + struct failover_ops...
2018 Apr 20
0
[PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework
...ink_change(struct work_struct *w) rtnl_unlock(); } -static struct net_device *get_netvsc_bymac(const u8 *mac) -{ - struct net_device *dev; - - ASSERT_RTNL(); - - for_each_netdev(&init_net, dev) { - if (dev->netdev_ops != &device_ops) - continue; /* not a netvsc device */ - - if (ether_addr_equal(mac, dev->perm_addr)) - return dev; - } - - return NULL; -} - -static struct net_device *get_netvsc_byref(struct 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->netde...
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
...ink_change(struct work_struct *w) rtnl_unlock(); } -static struct net_device *get_netvsc_bymac(const u8 *mac) -{ - struct net_device *dev; - - ASSERT_RTNL(); - - for_each_netdev(&init_net, dev) { - if (dev->netdev_ops != &device_ops) - continue; /* not a netvsc device */ - - if (ether_addr_equal(mac, dev->perm_addr)) - return dev; - } - - return NULL; -} - -static struct net_device *get_netvsc_byref(struct 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->netde...
2018 May 24
0
[PATCH net-next v12 2/5] netvsc: refactor notifier/event handling code to use the failover framework
...ink_change(struct work_struct *w) rtnl_unlock(); } -static struct net_device *get_netvsc_bymac(const u8 *mac) -{ - struct net_device *dev; - - ASSERT_RTNL(); - - for_each_netdev(&init_net, dev) { - if (dev->netdev_ops != &device_ops) - continue; /* not a netvsc device */ - - if (ether_addr_equal(mac, dev->perm_addr)) - return dev; - } - - return NULL; -} - -static struct net_device *get_netvsc_byref(struct 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->netde...