Displaying 20 results from an estimated 71 matches for "dev_hold".
2018 Apr 20
0
[PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework
...delayed_work(&ndev_ctx->vf_takeover, VF_TAKEOVER_INT);
- call_netdevice_notifiers(NETDEV_JOIN, vf_netdev);
-
netdev_info(vf_netdev, "joined to %s\n", ndev->name);
- return 0;
-upper_link_failed:
- netdev_rx_handler_unregister(vf_netdev);
-rx_handler_failed:
- return ret;
+ dev_hold(vf_netdev);
+ rcu_assign_pointer(ndev_ctx->vf_netdev, vf_netdev);
+
+ return 0;
}
static void __netvsc_vf_setup(struct net_device *ndev,
@@ -1914,85 +1851,82 @@ static void netvsc_vf_setup(struct work_struct *w)
rtnl_unlock();
}
-static int netvsc_register_vf(struct net_device *vf_netde...
2018 Apr 10
0
[RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework
...delayed_work(&ndev_ctx->vf_takeover, VF_TAKEOVER_INT);
- call_netdevice_notifiers(NETDEV_JOIN, vf_netdev);
-
netdev_info(vf_netdev, "joined to %s\n", ndev->name);
- return 0;
-upper_link_failed:
- netdev_rx_handler_unregister(vf_netdev);
-rx_handler_failed:
- return ret;
+ dev_hold(vf_netdev);
+ rcu_assign_pointer(ndev_ctx->vf_netdev, vf_netdev);
+
+ return 0;
}
static void __netvsc_vf_setup(struct net_device *ndev,
@@ -1914,85 +1851,82 @@ static void netvsc_vf_setup(struct work_struct *w)
rtnl_unlock();
}
-static int netvsc_register_vf(struct net_device *vf_netde...
2009 Apr 16
1
[1/2] tun: Only free a netdev when all tun descriptors are closed
On Thu, Apr 16, 2009 at 01:08:18AM -0000, Herbert Xu wrote:
> On Wed, Apr 15, 2009 at 10:38:34PM +0800, Herbert Xu wrote:
> >
> > So how about this? We replace the dev destructor with our own that
> > doesn't immediately call free_netdev. We only call free_netdev once
> > all tun fd's attached to the device have been closed.
>
> Here's the patch.
2009 Apr 16
1
[1/2] tun: Only free a netdev when all tun descriptors are closed
On Thu, Apr 16, 2009 at 01:08:18AM -0000, Herbert Xu wrote:
> On Wed, Apr 15, 2009 at 10:38:34PM +0800, Herbert Xu wrote:
> >
> > So how about this? We replace the dev destructor with our own that
> > doesn't immediately call free_netdev. We only call free_netdev once
> > all tun fd's attached to the device have been closed.
>
> Here's the patch.
2007 Apr 18
0
[Bridge] [PATCH 2.4] (1/2) bridge - backport of API checking
...f ((p = dev->br_port) == NULL)
+ if ((p = dev->br_port) == NULL || p->br != br)
return -EINVAL;
br_stp_disable_port(p);
@@ -231,6 +232,9 @@
if (dev->hard_start_xmit == br_dev_xmit)
return -ELOOP;
+
+ if (!is_valid_ether_addr(dev->dev_addr))
+ return -EADDRNOTAVAIL;
dev_hold(dev);
write_lock_bh(&br->lock);
2007 Apr 18
1
[Bridge] A question about modify bridge source
...p(&br->dev);
br->lock = RW_LOCK_UNLOCKED;
br->hash_lock = RW_LOCK_UNLOCKED;
register_netdev(&br->dev);
// netif_start_queue(&br->dev);
ethdev = dev_get_by_name("eth0");
ethdev->br_port = (struct net_bridge_port *)br;
dev_set_promiscuity(ethdev,1);
dev_hold(ethdev);
return br;
}
static void Bridge_passup(struct sk_buff *skb)
{
skb->dev = &brg->dev;
skb->pkt_type = PACKET_HOST;
skb_push(skb,ETH_HLEN);
skb->protocol = eth_type_trans(skb,&brg->dev);
netif_rx(skb);
return;
}
void Bridge_dev_setup(struct net_device *dev)
{...
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 20
13
[PATCH net-next v7 0/4] Enable virtio_net to act as a standby 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_STANDBY that can be
used
2014 Jan 16
0
[PATCH net-next v3 4/5] net-sysfs: add support for device-specific rx queue sysfs attributes
...*kobj));
dev_put(queue->dev);
@@ -767,21 +763,27 @@ static int rx_queue_add_kobject(struct net_device *net, int index)
kobject_put(kobj);
return error;
}
+ if (net->sysfs_rx_queue_group)
+ sysfs_create_group(kobj, net->sysfs_rx_queue_group);
kobject_uevent(kobj, KOBJ_ADD);
dev_hold(queue->dev);
return error;
}
-#endif /* CONFIG_RPS */
+#endif /* CONFIG_SYFS */
int
net_rx_queue_update_kobjects(struct net_device *net, int old_num, int new_num)
{
-#ifdef CONFIG_RPS
+#ifdef CONFIG_SYSFS
int i;
int error = 0;
+#ifndef CONFIG_RPS
+ if (!net->sysfs_rx_queue_gro...
2014 Jan 16
0
[PATCH net-next v4 4/6] net-sysfs: add support for device-specific rx queue sysfs attributes
...*kobj));
dev_put(queue->dev);
@@ -767,21 +763,27 @@ static int rx_queue_add_kobject(struct net_device *net, int index)
kobject_put(kobj);
return error;
}
+ if (net->sysfs_rx_queue_group)
+ sysfs_create_group(kobj, net->sysfs_rx_queue_group);
kobject_uevent(kobj, KOBJ_ADD);
dev_hold(queue->dev);
return error;
}
-#endif /* CONFIG_RPS */
+#endif /* CONFIG_SYFS */
int
net_rx_queue_update_kobjects(struct net_device *net, int old_num, int new_num)
{
-#ifdef CONFIG_RPS
+#ifdef CONFIG_SYSFS
int i;
int error = 0;
+#ifndef CONFIG_RPS
+ if (!net->sysfs_rx_queue_gro...
2018 Apr 05
6
[RFC PATCH net-next v5 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
2009 Nov 04
0
[PATCHv8 1/3] tun: export underlying socket
...--git a/drivers/net/tun.c b/drivers/net/tun.c
index 4fdfa2a..18f8876 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
err = 0;
tfile->tun = tun;
tun->tfile = tfile;
+ tun->socket.file = file;
dev_hold(tun->dev);
sock_hold(tun->socket.sk);
atomic_inc(&tfile->count);
@@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun)
/* Detach from net device */
netif_tx_lock_bh(tun->dev);
tun->tfile = NULL;
+ tun->socket.file = NULL;
netif_tx_unlock_bh(tun->d...
2009 Nov 04
0
[PATCHv8 1/3] tun: export underlying socket
...--git a/drivers/net/tun.c b/drivers/net/tun.c
index 4fdfa2a..18f8876 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
err = 0;
tfile->tun = tun;
tun->tfile = tfile;
+ tun->socket.file = file;
dev_hold(tun->dev);
sock_hold(tun->socket.sk);
atomic_inc(&tfile->count);
@@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun)
/* Detach from net device */
netif_tx_lock_bh(tun->dev);
tun->tfile = NULL;
+ tun->socket.file = NULL;
netif_tx_unlock_bh(tun->d...
2009 Nov 03
1
[PATCHv7 1/3] tun: export underlying socket
...--git a/drivers/net/tun.c b/drivers/net/tun.c
index 4fdfa2a..18f8876 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
err = 0;
tfile->tun = tun;
tun->tfile = tfile;
+ tun->socket.file = file;
dev_hold(tun->dev);
sock_hold(tun->socket.sk);
atomic_inc(&tfile->count);
@@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun)
/* Detach from net device */
netif_tx_lock_bh(tun->dev);
tun->tfile = NULL;
+ tun->socket.file = NULL;
netif_tx_unlock_bh(tun->d...
2009 Nov 03
1
[PATCHv7 1/3] tun: export underlying socket
...--git a/drivers/net/tun.c b/drivers/net/tun.c
index 4fdfa2a..18f8876 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
err = 0;
tfile->tun = tun;
tun->tfile = tfile;
+ tun->socket.file = file;
dev_hold(tun->dev);
sock_hold(tun->socket.sk);
atomic_inc(&tfile->count);
@@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun)
/* Detach from net device */
netif_tx_lock_bh(tun->dev);
tun->tfile = NULL;
+ tun->socket.file = NULL;
netif_tx_unlock_bh(tun->d...
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...r_dev, "unable to change mtu of %s to %u register failed\n",
> + slave_dev->name, failover_dev->mtu);
> + goto err_set_mtu;
> + }
> +
> + finfo = netdev_priv(failover_dev);
> + standby = (slave_dev->dev.parent == failover_dev->dev.parent);
> +
> + dev_hold(slave_dev);
> +
> + if (standby) {
> + rcu_assign_pointer(finfo->standby_dev, slave_dev);
> + dev_get_stats(finfo->standby_dev, &finfo->standby_stats);
> + } else {
> + rcu_assign_pointer(finfo->primary_dev, slave_dev);
> + dev_get_stats(finfo->primary_de...
2018 Apr 20
2
[PATCH v7 net-next 2/4] net: Introduce generic failover module
...r_dev, "unable to change mtu of %s to %u register failed\n",
> + slave_dev->name, failover_dev->mtu);
> + goto err_set_mtu;
> + }
> +
> + finfo = netdev_priv(failover_dev);
> + standby = (slave_dev->dev.parent == failover_dev->dev.parent);
> +
> + dev_hold(slave_dev);
> +
> + if (standby) {
> + rcu_assign_pointer(finfo->standby_dev, slave_dev);
> + dev_get_stats(finfo->standby_dev, &finfo->standby_stats);
> + } else {
> + rcu_assign_pointer(finfo->primary_dev, slave_dev);
> + dev_get_stats(finfo->primary_de...
2018 Apr 11
2
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...if (bypass_ops) {
>+ if (!bypass_ops->slave_join)
>+ return -EINVAL;
>+
>+ return bypass_ops->slave_join(slave_netdev, bypass_netdev);
>+ }
>+
>+ bi = netdev_priv(bypass_netdev);
>+ backup = (slave_netdev->dev.parent == bypass_netdev->dev.parent);
>+
>+ dev_hold(slave_netdev);
>+
>+ if (backup) {
>+ rcu_assign_pointer(bi->backup_netdev, slave_netdev);
>+ dev_get_stats(bi->backup_netdev, &bi->backup_stats);
>+ } else {
>+ rcu_assign_pointer(bi->active_netdev, slave_netdev);
>+ dev_get_stats(bi->active_netdev, &...
2018 Apr 11
2
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...if (bypass_ops) {
>+ if (!bypass_ops->slave_join)
>+ return -EINVAL;
>+
>+ return bypass_ops->slave_join(slave_netdev, bypass_netdev);
>+ }
>+
>+ bi = netdev_priv(bypass_netdev);
>+ backup = (slave_netdev->dev.parent == bypass_netdev->dev.parent);
>+
>+ dev_hold(slave_netdev);
>+
>+ if (backup) {
>+ rcu_assign_pointer(bi->backup_netdev, slave_netdev);
>+ dev_get_stats(bi->backup_netdev, &bi->backup_stats);
>+ } else {
>+ rcu_assign_pointer(bi->active_netdev, slave_netdev);
>+ dev_get_stats(bi->active_netdev, &...
2018 Apr 10
0
[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module
...uct bypass_info *bi;
+ bool backup;
+
+ if (bypass_ops) {
+ if (!bypass_ops->slave_join)
+ return -EINVAL;
+
+ return bypass_ops->slave_join(slave_netdev, bypass_netdev);
+ }
+
+ bi = netdev_priv(bypass_netdev);
+ backup = (slave_netdev->dev.parent == bypass_netdev->dev.parent);
+
+ dev_hold(slave_netdev);
+
+ if (backup) {
+ rcu_assign_pointer(bi->backup_netdev, slave_netdev);
+ dev_get_stats(bi->backup_netdev, &bi->backup_stats);
+ } else {
+ rcu_assign_pointer(bi->active_netdev, slave_netdev);
+ dev_get_stats(bi->active_netdev, &bi->active_stats);
+ by...