search for: netif_device_detach

Displaying 20 results from an estimated 110 matches for "netif_device_detach".

Did you mean: netif_device_attach
2012 Apr 04
2
[PATCH RFC] virtio-net: remove useless disable on freeze
...@@ -1182,11 +1182,6 @@ static int virtnet_freeze(struct virtio_device *vdev) { struct virtnet_info *vi = vdev->priv; - virtqueue_disable_cb(vi->rvq); - virtqueue_disable_cb(vi->svq); - if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) - virtqueue_disable_cb(vi->cvq); - netif_device_detach(vi->dev); cancel_delayed_work_sync(&vi->refill); -- 1.7.9.111.gf3fb0
2012 Apr 04
2
[PATCH RFC] virtio-net: remove useless disable on freeze
...@@ -1182,11 +1182,6 @@ static int virtnet_freeze(struct virtio_device *vdev) { struct virtnet_info *vi = vdev->priv; - virtqueue_disable_cb(vi->rvq); - virtqueue_disable_cb(vi->svq); - if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) - virtqueue_disable_cb(vi->cvq); - netif_device_detach(vi->dev); cancel_delayed_work_sync(&vi->refill); -- 1.7.9.111.gf3fb0
2014 Oct 06
1
[PATCH 08/16] virtio_net: drop config_enable
...er_hotcpu_notifier(&vi->nb); > > /* Prevent config work handler from accessing the device */ dito > - mutex_lock(&vi->config_lock); > - vi->config_enable = false; > - mutex_unlock(&vi->config_lock); > + flush_work(&vi->config_work); > > netif_device_detach(vi->dev); > cancel_delayed_work_sync(&vi->refill);
2014 Oct 06
1
[PATCH 08/16] virtio_net: drop config_enable
...er_hotcpu_notifier(&vi->nb); > > /* Prevent config work handler from accessing the device */ dito > - mutex_lock(&vi->config_lock); > - vi->config_enable = false; > - mutex_unlock(&vi->config_lock); > + flush_work(&vi->config_work); > > netif_device_detach(vi->dev); > cancel_delayed_work_sync(&vi->refill);
2011 Nov 15
1
[PATCH v2 09/11] virtio: net: Add freeze, restore handlers to support S4
...virtio_device *vdev) > > free_netdev(vi->dev); > > } > > > > +#ifdef CONFIG_PM > > +static int virtnet_freeze(struct virtio_device *vdev) > > +{ > > + struct virtnet_info *vi = vdev->priv; > > I'm guessing we need to do something like netif_device_detach here, > otherwise guest might be in the process of using the vq for transmit at > this point. Done. > I think we also must make sure NAPI RX handler is not in progress. How to do that? napi_disable() / napi_enable() doesn't seem right (and it doesn't work, too). pci_disable_de...
2011 Nov 15
1
[PATCH v2 09/11] virtio: net: Add freeze, restore handlers to support S4
...virtio_device *vdev) > > free_netdev(vi->dev); > > } > > > > +#ifdef CONFIG_PM > > +static int virtnet_freeze(struct virtio_device *vdev) > > +{ > > + struct virtnet_info *vi = vdev->priv; > > I'm guessing we need to do something like netif_device_detach here, > otherwise guest might be in the process of using the vq for transmit at > this point. Done. > I think we also must make sure NAPI RX handler is not in progress. How to do that? napi_disable() / napi_enable() doesn't seem right (and it doesn't work, too). pci_disable_de...
2015 Jun 24
2
[RFC] virtio_net: Adding tx_timeout function.
...} #endif +static void virtnet_reset_task(struct work_struct *work) +{ + struct virtnet_info *vi = + container_of(work, struct virtnet_info, reset_task); + struct net_device *dev = vi->dev; + struct virtio_device *vdev = vi->vdev; + int err, i; + + flush_work(&vi->config_work); + + netif_device_detach(vi->dev); + cancel_delayed_work_sync(&vi->refill); + + if (netif_running(vi->dev)) { + for (i = 0; i < vi->max_queue_pairs; i++) { + napi_disable(&vi->rq[i].napi); + napi_hash_del(&vi->rq[i].napi); + netif_napi_del(&vi->rq[i].napi); + } + } + + remove...
2015 Jun 24
2
[RFC] virtio_net: Adding tx_timeout function.
...} #endif +static void virtnet_reset_task(struct work_struct *work) +{ + struct virtnet_info *vi = + container_of(work, struct virtnet_info, reset_task); + struct net_device *dev = vi->dev; + struct virtio_device *vdev = vi->vdev; + int err, i; + + flush_work(&vi->config_work); + + netif_device_detach(vi->dev); + cancel_delayed_work_sync(&vi->refill); + + if (netif_running(vi->dev)) { + for (i = 0; i < vi->max_queue_pairs; i++) { + napi_disable(&vi->rq[i].napi); + napi_hash_del(&vi->rq[i].napi); + netif_napi_del(&vi->rq[i].napi); + } + } + + remove...
2015 Jun 25
3
[RFC] virtio_net: Adding tx_timeout function.
...+ container_of(work, struct virtnet_info, reset_task); > > + struct net_device *dev = vi->dev; > > + struct virtio_device *vdev = vi->vdev; > > + int err, i; > > + > > + flush_work(&vi->config_work); > > + > > + netif_device_detach(vi->dev); > > + cancel_delayed_work_sync(&vi->refill); > > + > > + if (netif_running(vi->dev)) { > > + for (i = 0; i < vi->max_queue_pairs; i++) { > > + napi_disable(&vi->rq[i].napi); > > +...
2015 Jun 25
3
[RFC] virtio_net: Adding tx_timeout function.
...+ container_of(work, struct virtnet_info, reset_task); > > + struct net_device *dev = vi->dev; > > + struct virtio_device *vdev = vi->vdev; > > + int err, i; > > + > > + flush_work(&vi->config_work); > > + > > + netif_device_detach(vi->dev); > > + cancel_delayed_work_sync(&vi->refill); > > + > > + if (netif_running(vi->dev)) { > > + for (i = 0; i < vi->max_queue_pairs; i++) { > > + napi_disable(&vi->rq[i].napi); > > +...
2012 Mar 13
1
[V4 PATCH] virtio-net: send gratuitous packet when needed
...tic int virtnet_freeze(struct virtio_device *vdev) virtqueue_disable_cb(vi->svq); if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) virtqueue_disable_cb(vi->cvq); + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE)) + cancel_work_sync(&vi->announce); netif_device_detach(vi->dev); cancel_delayed_work_sync(&vi->refill); @@ -1233,6 +1261,7 @@ static unsigned int features[] = { VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, + VIRTIO_NET_F...
2012 Mar 13
1
[V4 PATCH] virtio-net: send gratuitous packet when needed
...tic int virtnet_freeze(struct virtio_device *vdev) virtqueue_disable_cb(vi->svq); if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) virtqueue_disable_cb(vi->cvq); + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE)) + cancel_work_sync(&vi->announce); netif_device_detach(vi->dev); cancel_delayed_work_sync(&vi->refill); @@ -1233,6 +1261,7 @@ static unsigned int features[] = { VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, + VIRTIO_NET_F...
2017 Oct 13
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...ev, bool in_config) { struct virtnet_info *vi = vdev->priv; int i; - /* Make sure no work handler is accessing the device */ - flush_work(&vi->config_work); + /* Make sure no other work handler is accessing the device */ + if (!in_config) + flush_work(&vi->config_work); netif_device_detach(vi->dev); netif_tx_disable(vi->dev); @@ -1924,6 +1925,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev) } static int init_vqs(struct virtnet_info *vi); +static void remove_vq_common(struct virtnet_info *vi); static int virtnet_restore_up(struct virtio_device *vdev) {...
2017 Oct 13
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...ev, bool in_config) { struct virtnet_info *vi = vdev->priv; int i; - /* Make sure no work handler is accessing the device */ - flush_work(&vi->config_work); + /* Make sure no other work handler is accessing the device */ + if (!in_config) + flush_work(&vi->config_work); netif_device_detach(vi->dev); netif_tx_disable(vi->dev); @@ -1924,6 +1925,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev) } static int init_vqs(struct virtnet_info *vi); +static void remove_vq_common(struct virtnet_info *vi); static int virtnet_restore_up(struct virtio_device *vdev) {...
2023 May 24
1
[PATCH V3 net-next 1/2] virtio-net: convert rx mode setting to use workqueue
...o, u16 vid) { @@ -3181,6 +3222,8 @@ static void virtnet_freeze_down(struct virtio_device *vdev) /* Make sure no work handler is accessing the device */ flush_work(&vi->config_work); + disable_rx_mode_work(vi); + flush_work(&vi->rx_mode_work); netif_tx_lock_bh(vi->dev); netif_device_detach(vi->dev); @@ -3203,6 +3246,7 @@ static int virtnet_restore_up(struct virtio_device *vdev) virtio_device_ready(vdev); enable_delayed_refill(vi); + enable_rx_mode_work(vi); if (netif_running(vi->dev)) { err = virtnet_open(vi->dev); @@ -4002,6 +4046,7 @@ static int virtnet_probe(...
2012 Mar 28
2
[V6 PATCH] virtio-net: send gratuitous packets when needed
...(vi->tx_sg, ARRAY_SIZE(vi->tx_sg)); @@ -1187,6 +1215,7 @@ static int virtnet_freeze(struct virtio_device *vdev) virtqueue_disable_cb(vi->svq); if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) virtqueue_disable_cb(vi->cvq); + cancel_work_sync(&vi->announce); netif_device_detach(vi->dev); cancel_delayed_work_sync(&vi->refill); @@ -1233,6 +1262,7 @@ static unsigned int features[] = { VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, + VIRTIO_NET_F...
2012 Mar 28
2
[V6 PATCH] virtio-net: send gratuitous packets when needed
...(vi->tx_sg, ARRAY_SIZE(vi->tx_sg)); @@ -1187,6 +1215,7 @@ static int virtnet_freeze(struct virtio_device *vdev) virtqueue_disable_cb(vi->svq); if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) virtqueue_disable_cb(vi->cvq); + cancel_work_sync(&vi->announce); netif_device_detach(vi->dev); cancel_delayed_work_sync(&vi->refill); @@ -1233,6 +1262,7 @@ static unsigned int features[] = { VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, + VIRTIO_NET_F...
2015 Jul 02
1
[RFC] virtio_net: Adding tx_timeout function.
...t; > > > + struct net_device *dev = vi->dev; > > > > + struct virtio_device *vdev = vi->vdev; > > > > + int err, i; > > > > + > > > > + flush_work(&vi->config_work); > > > > + > > > > + netif_device_detach(vi->dev); > > > > + cancel_delayed_work_sync(&vi->refill); > > > > + > > > > + if (netif_running(vi->dev)) { > > > > + for (i = 0; i < vi->max_queue_pairs; i++) { > > > > + napi_di...
2015 Jul 02
1
[RFC] virtio_net: Adding tx_timeout function.
...t; > > > + struct net_device *dev = vi->dev; > > > > + struct virtio_device *vdev = vi->vdev; > > > > + int err, i; > > > > + > > > > + flush_work(&vi->config_work); > > > > + > > > > + netif_device_detach(vi->dev); > > > > + cancel_delayed_work_sync(&vi->refill); > > > > + > > > > + if (netif_running(vi->dev)) { > > > > + for (i = 0; i < vi->max_queue_pairs; i++) { > > > > + napi_di...
2016 Jun 02
1
[PATCH -next 2/2] virtio_net: Read the advised MTU
...reeze(struct virtio_device *vdev) 2004 { 2005 struct virtnet_info *vi = vdev->priv; 2006 int i; 2007 2008 unregister_hotcpu_notifier(&vi->nb); 2009 2010 /* Make sure no work handler is accessing the device */ 2011 flush_work(&vi->config_work); 2012 2013 netif_device_detach(vi->dev); 2014 cancel_delayed_work_sync(&vi->refill); 2015 2016 if (netif_running(vi->dev)) { 2017 for (i = 0; i < vi->max_queue_pairs; i++) 2018 napi_disable(&vi->rq[i].napi); 2019 } 2020 2021 remove_vq_common(vi); 2022 2023 return 0; 20...