search for: virtnet_freeze_down

Displaying 20 results from an estimated 70 matches for "virtnet_freeze_down".

2017 Oct 13
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
..._reset function introduced in commit 2de2f7f40ef9 ("virtio_net: XDP support for adjust_head"). That was removed in commit 4941d472bf95 ("virtio-net: do not reset during XDP set"), because no longer used. Bring it back, minus the xdp specific code. Before tearing down any state, virtnet_freeze_down quiesces the device with netif_tx_disable. virtnet_reset also ensures that no other config operations can run concurrently. On successful reset, the host can observe that the flag has been cleared. There is no need for the explicit control flag introduced in the previous RFC of this patch. Change...
2017 Oct 13
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
..._reset function introduced in commit 2de2f7f40ef9 ("virtio_net: XDP support for adjust_head"). That was removed in commit 4941d472bf95 ("virtio-net: do not reset during XDP set"), because no longer used. Bring it back, minus the xdp specific code. Before tearing down any state, virtnet_freeze_down quiesces the device with netif_tx_disable. virtnet_reset also ensures that no other config operations can run concurrently. On successful reset, the host can observe that the flag has been cleared. There is no need for the explicit control flag introduced in the previous RFC of this patch. Change...
2017 Oct 15
0
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...d in commit 2de2f7f40ef9 > ("virtio_net: XDP support for adjust_head"). That was removed in > commit 4941d472bf95 ("virtio-net: do not reset during XDP set"), > because no longer used. Bring it back, minus the xdp specific code. > > Before tearing down any state, virtnet_freeze_down quiesces the > device with netif_tx_disable. virtnet_reset also ensures that no > other config operations can run concurrently. > > On successful reset, the host can observe that the flag has been > cleared. There is no need for the explicit control flag introduced > in the previ...
2017 Oct 05
0
[PATCH RFC 1/2] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...from the config workqueue. No other config requests >> can be active or scheduled concurrently on vi->config. > > You need to prevent packet TX from being in progress. I had another look at this. As of commit 713a98d90c5e ("virtio-net: serialize tx routine during reset") virtnet_freeze_down calls synchronize_net() after stopping the queues to quiesce the device before any further actions. This should suffice for virtnet_reset, too. The control path can indeed be much simpler than my initial patchset. The host can read vdev->status to observe when the reset went through. It adds fl...
2017 Oct 05
0
[PATCH RFC 1/2] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...from the config workqueue. No other config requests >> can be active or scheduled concurrently on vi->config. > > You need to prevent packet TX from being in progress. I had another look at this. As of commit 713a98d90c5e ("virtio-net: serialize tx routine during reset") virtnet_freeze_down calls synchronize_net() after stopping the queues to quiesce the device before any further actions. This should suffice for virtnet_reset, too. The control path can indeed be much simpler than my initial patchset. The host can read vdev->status to observe when the reset went through. It adds fl...
2017 Jul 25
2
[PATCH net-next] virtio-net: mark PM functions as __maybe_unused
...reeze and restore functions are now unused when CONFIG_PM_SLEEP is disabled: drivers/net/virtio_net.c:1881:12: error: 'virtnet_restore_up' defined but not used [-Werror=unused-function] static int virtnet_restore_up(struct virtio_device *vdev) drivers/net/virtio_net.c:1859:13: error: 'virtnet_freeze_down' defined but not used [-Werror=unused-function] static void virtnet_freeze_down(struct virtio_device *vdev) A more robust way to do this is to remove the #ifdef around the callers and instead mark them as __maybe_unused. The compiler will now just silently drop the unused code. Fixes: 4941d4...
2017 Jul 25
2
[PATCH net-next] virtio-net: mark PM functions as __maybe_unused
...reeze and restore functions are now unused when CONFIG_PM_SLEEP is disabled: drivers/net/virtio_net.c:1881:12: error: 'virtnet_restore_up' defined but not used [-Werror=unused-function] static int virtnet_restore_up(struct virtio_device *vdev) drivers/net/virtio_net.c:1859:13: error: 'virtnet_freeze_down' defined but not used [-Werror=unused-function] static void virtnet_freeze_down(struct virtio_device *vdev) A more robust way to do this is to remove the #ifdef around the callers and instead mark them as __maybe_unused. The compiler will now just silently drop the unused code. Fixes: 4941d4...
2020 Jun 05
2
[PATCH] virtio_net: Unregister and re-register xdp_rxq across freeze/restore
...MEM_TYPE_PAGE_SHARED, NULL); - if (err < 0) { - xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq); - return err; - } - virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi); virtnet_napi_tx_enable(vi, vi->sq[i].vq, &vi->sq[i].napi); } @@ -2306,6 +2314,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev) if (netif_running(vi->dev)) { for (i = 0; i < vi->max_queue_pairs; i++) { + xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq); napi_disable(&vi->rq[i].napi); virtnet_napi_tx_disable(&vi->sq[i].napi); } @@ -2313,6 +2322,8 @@ static v...
2020 Jun 05
2
[PATCH] virtio_net: Unregister and re-register xdp_rxq across freeze/restore
...MEM_TYPE_PAGE_SHARED, NULL); - if (err < 0) { - xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq); - return err; - } - virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi); virtnet_napi_tx_enable(vi, vi->sq[i].vq, &vi->sq[i].napi); } @@ -2306,6 +2314,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev) if (netif_running(vi->dev)) { for (i = 0; i < vi->max_queue_pairs; i++) { + xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq); napi_disable(&vi->rq[i].napi); virtnet_napi_tx_disable(&vi->sq[i].napi); } @@ -2313,6 +2322,8 @@ static v...
2017 Apr 25
3
[PATCH net-next] virtio-net: on tx, only call napi_disable if tx napi is on
...+1451,7 @@ static int virtnet_close(struct net_device *dev) for (i = 0; i < vi->max_queue_pairs; i++) { napi_disable(&vi->rq[i].napi); - napi_disable(&vi->sq[i].napi); + virtnet_napi_tx_disable(&vi->sq[i].napi); } return 0; @@ -1803,7 +1809,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev) if (netif_running(vi->dev)) { for (i = 0; i < vi->max_queue_pairs; i++) { napi_disable(&vi->rq[i].napi); - napi_disable(&vi->sq[i].napi); + virtnet_napi_tx_disable(&vi->sq[i].napi); } } } -- 2.13.0.rc0.306.g87b477812d-goo...
2017 Apr 25
3
[PATCH net-next] virtio-net: on tx, only call napi_disable if tx napi is on
...+1451,7 @@ static int virtnet_close(struct net_device *dev) for (i = 0; i < vi->max_queue_pairs; i++) { napi_disable(&vi->rq[i].napi); - napi_disable(&vi->sq[i].napi); + virtnet_napi_tx_disable(&vi->sq[i].napi); } return 0; @@ -1803,7 +1809,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev) if (netif_running(vi->dev)) { for (i = 0; i < vi->max_queue_pairs; i++) { napi_disable(&vi->rq[i].napi); - napi_disable(&vi->sq[i].napi); + virtnet_napi_tx_disable(&vi->sq[i].napi); } } } -- 2.13.0.rc0.306.g87b477812d-goo...
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...nt virtnet_reset(struct virtnet_info *vi) >> +{ >> + 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) >> +...
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...nt virtnet_reset(struct virtnet_info *vi) >> +{ >> + 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) >> +...
2017 Mar 29
1
[PATCH net-next] virtio_net: don't reset twice on XDP on/off
...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 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1810,7 +1810,6 @@ static int virtnet_reset(struct virtnet_info *vi, int curr_qp, int xdp_qp) virtnet_freeze_down(dev); _remove_vq_common(vi); - dev->config->reset(dev); virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE); virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER); -- MST
2017 Mar 29
1
[PATCH net-next] virtio_net: don't reset twice on XDP on/off
...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 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1810,7 +1810,6 @@ static int virtnet_reset(struct virtnet_info *vi, int curr_qp, int xdp_qp) virtnet_freeze_down(dev); _remove_vq_common(vi); - dev->config->reset(dev); virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE); virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER); -- MST
2018 Oct 12
0
[PATCH] virtio_net: enable tx after resuming from suspend
...>>> investigation, what areas should I look into? >> As you've figured out, you can start with why netif_tx_wake_all_queues() >> were not executed? >> >> (Btw, does the issue disappear if you move netif_tx_disable() under the >> check of netif_running() in virtnet_freeze_down()?) > The issue disappears if I move netif_tx_disable() under the check of > netif_running() in virtnet_freeze_down(). Moving netif_tx_disable() > is probably better as its logic is consistent with > netif_device_attach() implementation. If you are OK with this idea, > I will submit...
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...>> >> + 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_featur...
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...>> >> + 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_featur...
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...*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); >> >> >> + >&gt...
2017 Oct 16
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...*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); >> >> >> + >&gt...