Displaying 20 results from an estimated 159 matches for "remove_vq_common".
2017 Oct 13
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...s 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)
{
@@ -1952,6 +1954,40 @@ static int virtnet_restore_up(struct virtio_device *vdev)
return err;
}
+static int virtnet_reset(struct virtnet_info *vi)
+{
+ struct virtio_device *dev = vi->vdev;
+ int ret;
+...
2017 Oct 13
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...s 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)
{
@@ -1952,6 +1954,40 @@ static int virtnet_restore_up(struct virtio_device *vdev)
return err;
}
+static int virtnet_reset(struct virtnet_info *vi)
+{
+ struct virtio_device *dev = vi->vdev;
+ int ret;
+...
2016 Jun 02
1
[PATCH -next 2/2] virtio_net: Read the advised MTU
..._netdev(dev);
1960 free_vqs:
1961 cancel_delayed_work_sync(&vi->refill);
1962 free_receive_page_frags(vi);
1963 virtnet_del_vqs(vi);
1964 free_stats:
1965 free_percpu(vi->stats);
1966 free:
1967 free_netdev(dev);
1968 return err;
1969 }
1970
1971 static void remove_vq_common(struct virtnet_info *vi)
1972 {
1973 vi->vdev->config->reset(vi->vdev);
1974
1975 /* Free unused buffers in both send and recv, if any. */
1976 free_unused_bufs(vi);
1977
1978 free_receive_bufs(vi);
1979
1980 free_receive_page_frags(vi);
1981
1982 virtnet...
2016 Jun 02
1
[PATCH -next 2/2] virtio_net: Read the advised MTU
..._netdev(dev);
1960 free_vqs:
1961 cancel_delayed_work_sync(&vi->refill);
1962 free_receive_page_frags(vi);
1963 virtnet_del_vqs(vi);
1964 free_stats:
1965 free_percpu(vi->stats);
1966 free:
1967 free_netdev(dev);
1968 return err;
1969 }
1970
1971 static void remove_vq_common(struct virtnet_info *vi)
1972 {
1973 vi->vdev->config->reset(vi->vdev);
1974
1975 /* Free unused buffers in both send and recv, if any. */
1976 free_unused_bufs(vi);
1977
1978 free_receive_bufs(vi);
1979
1980 free_receive_page_frags(vi);
1981
1982 virtnet...
2017 Oct 15
0
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...gt; + 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)
> {
> @@ -1952,6 +1954,40 @@ static int virtnet_restore_up(struct virtio_device *vdev)
> return err;
> }
>
> +static int virtnet_reset(struct virtnet_info *vi)
> +{
> + str...
2017 Oct 05
0
[PATCH RFC 1/2] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
..._work);
>>
>> netif_device_detach(vi->dev);
>> netif_tx_disable(vi->dev);
>> @@ -1878,6 +1880,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)
>> {
>> @@ -1906,6 +1909,45 @@ static int virtnet_restore_up(struct virtio_device *vdev)
>> return err;
>> }
>>
>> +static int virtnet_reset(struct virt...
2017 Oct 05
0
[PATCH RFC 1/2] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
..._work);
>>
>> netif_device_detach(vi->dev);
>> netif_tx_disable(vi->dev);
>> @@ -1878,6 +1880,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)
>> {
>> @@ -1906,6 +1909,45 @@ static int virtnet_restore_up(struct virtio_device *vdev)
>> return err;
>> }
>>
>> +static int virtnet_reset(struct virt...
2012 Jan 04
2
[PATCH 1/2] virtio: net: Move vq initialization into separate function
From: Amit Shah <amit.shah at redhat.com>
The probe and PM restore functions will share this code.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
---
drivers/net/virtio_net.c | 47 ++++++++++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 19 deletions(-)
diff --git a/drivers/net/virtio_net.c
2012 Jan 04
2
[PATCH 1/2] virtio: net: Move vq initialization into separate function
From: Amit Shah <amit.shah at redhat.com>
The probe and PM restore functions will share this code.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
---
drivers/net/virtio_net.c | 47 ++++++++++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 19 deletions(-)
diff --git a/drivers/net/virtio_net.c
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...gt; +{
>> + struct virtio_device *dev = vi->vdev;
>> + int ret;
>> +
>> + virtio_config_disable(dev);
>> + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED;
>> + virtnet_freeze_down(dev, true);
>> + remove_vq_common(vi);
>> +
>> + virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
>> + virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER);
>> +
>> + ret = virtio_finalize_features(dev);
>> + if (ret)
>> + goto err;
>> +
>> + ret =...
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...gt; +{
>> + struct virtio_device *dev = vi->vdev;
>> + int ret;
>> +
>> + virtio_config_disable(dev);
>> + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED;
>> + virtnet_freeze_down(dev, true);
>> + remove_vq_common(vi);
>> +
>> + virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
>> + virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER);
>> +
>> + ret = virtio_finalize_features(dev);
>> + if (ret)
>> + goto err;
>> +
>> + ret =...
2017 Mar 29
1
[PATCH net-next] virtio_net: don't reset twice on XDP on/off
We already do a reset once in remove_vq_common -
there appears to be no point in doing another one
when we add/remove XDP.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/net/virtio_net.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index de42e9a..ed8f548 100644...
2017 Mar 29
1
[PATCH net-next] virtio_net: don't reset twice on XDP on/off
We already do a reset once in remove_vq_common -
there appears to be no point in doing another one
when we add/remove XDP.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/net/virtio_net.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index de42e9a..ed8f548 100644...
2014 Oct 05
0
[PATCH 08/16] virtio_net: drop config_enable
...unregister_hotcpu_notifier(&vi->nb);
/* Prevent config work handler from accessing the device. */
- mutex_lock(&vi->config_lock);
- vi->config_enable = false;
- mutex_unlock(&vi->config_lock);
+ flush_work(&vi->config_work);
unregister_netdev(vi->dev);
remove_vq_common(vi);
- flush_work(&vi->config_work);
-
free_percpu(vi->stats);
free_netdev(vi->dev);
}
@@ -1899,9 +1888,7 @@ static int virtnet_freeze(struct virtio_device *vdev)
unregister_hotcpu_notifier(&vi->nb);
/* Prevent config work handler from accessing the device */
- mute...
2014 Oct 06
0
[PATCH v2 07/15] virtio_net: drop config_enable
...config work handler from accessing the device. */
- mutex_lock(&vi->config_lock);
- vi->config_enable = false;
- mutex_unlock(&vi->config_lock);
+ /* Make sure no work handler is accessing the device. */
+ flush_work(&vi->config_work);
unregister_netdev(vi->dev);
remove_vq_common(vi);
- flush_work(&vi->config_work);
-
free_percpu(vi->stats);
free_netdev(vi->dev);
}
@@ -1898,10 +1887,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
unregister_hotcpu_notifier(&vi->nb);
- /* Prevent config work handler from accessing the device */
- m...
2014 Oct 06
1
[PATCH 08/16] virtio_net: drop config_enable
...*/
Same comment as for the equivalent comment in the virtio-blk code.
> - mutex_lock(&vi->config_lock);
> - vi->config_enable = false;
> - mutex_unlock(&vi->config_lock);
> + flush_work(&vi->config_work);
>
> unregister_netdev(vi->dev);
>
> remove_vq_common(vi);
>
> - flush_work(&vi->config_work);
> -
> free_percpu(vi->stats);
> free_netdev(vi->dev);
> }
> @@ -1899,9 +1888,7 @@ static int virtnet_freeze(struct virtio_device *vdev)
> unregister_hotcpu_notifier(&vi->nb);
>
> /* Prevent config...
2014 Oct 06
1
[PATCH 08/16] virtio_net: drop config_enable
...*/
Same comment as for the equivalent comment in the virtio-blk code.
> - mutex_lock(&vi->config_lock);
> - vi->config_enable = false;
> - mutex_unlock(&vi->config_lock);
> + flush_work(&vi->config_work);
>
> unregister_netdev(vi->dev);
>
> remove_vq_common(vi);
>
> - flush_work(&vi->config_work);
> -
> free_percpu(vi->stats);
> free_netdev(vi->dev);
> }
> @@ -1899,9 +1888,7 @@ static int virtnet_freeze(struct virtio_device *vdev)
> unregister_hotcpu_notifier(&vi->nb);
>
> /* Prevent config...
2012 Apr 12
2
[net-next V7 PATCH] virtio-net: send gratuitous packets when needed
...et_remove(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
+ /* Prevent config work handler from accessing the device. */
+ mutex_lock(&vi->config_lock);
+ vi->config_enable = false;
+ mutex_unlock(&vi->config_lock);
+
unregister_netdev(vi->dev);
remove_vq_common(vi);
+ flush_work(&vi->config_work);
+
free_percpu(vi->stats);
free_netdev(vi->dev);
}
@@ -1183,6 +1225,11 @@ static int virtnet_freeze(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
+ /* Prevent config work handler from accessing the device */
+ mut...
2012 Apr 12
2
[net-next V7 PATCH] virtio-net: send gratuitous packets when needed
...et_remove(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
+ /* Prevent config work handler from accessing the device. */
+ mutex_lock(&vi->config_lock);
+ vi->config_enable = false;
+ mutex_unlock(&vi->config_lock);
+
unregister_netdev(vi->dev);
remove_vq_common(vi);
+ flush_work(&vi->config_work);
+
free_percpu(vi->stats);
free_netdev(vi->dev);
}
@@ -1183,6 +1225,11 @@ static int virtnet_freeze(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
+ /* Prevent config work handler from accessing the device */
+ mut...
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...gt;vdev;
>> >> + int ret;
>> >> +
>> >> + virtio_config_disable(dev);
>> >> + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED;
>> >> + virtnet_freeze_down(dev, true);
>> >> + remove_vq_common(vi);
>> >> +
>> >> + virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
>> >> + virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER);
>> >> +
>> >> + ret = virtio_finalize_features(dev);
>> >> + if (ret)
>> &g...