Displaying 20 results from an estimated 74 matches for "virtnet_free_queues".
2015 Mar 12
2
[PATCH net] virtio-net: correctly delete napi hash
...us_add_driver+0x170/0x220
[<ffffffffa0a60000>] ? 0xffffffffa0a60000
[<ffffffff814c894f>] driver_register+0x5f/0xf0
[<ffffffff8139e41b>] register_virtio_driver+0x1b/0x30
[<ffffffffa0a60010>] virtio_net_driver_init+0x10/0x12 [virtio_net]
This patch fixes this by doing this in virtnet_free_queues(). And also
don't delete napi in virtnet_freeze() since it will call
virtnet_free_queues() which has already did this.
Fixes 91815639d880 ("virtio-net: rx busy polling support")
Cc: Rusty Russell <rusty at rustcorp.com.au>
Cc: Michael S. Tsirkin <mst at redhat.com>
Signed...
2015 Mar 12
2
[PATCH net] virtio-net: correctly delete napi hash
...us_add_driver+0x170/0x220
[<ffffffffa0a60000>] ? 0xffffffffa0a60000
[<ffffffff814c894f>] driver_register+0x5f/0xf0
[<ffffffff8139e41b>] register_virtio_driver+0x1b/0x30
[<ffffffffa0a60010>] virtio_net_driver_init+0x10/0x12 [virtio_net]
This patch fixes this by doing this in virtnet_free_queues(). And also
don't delete napi in virtnet_freeze() since it will call
virtnet_free_queues() which has already did this.
Fixes 91815639d880 ("virtio-net: rx busy polling support")
Cc: Rusty Russell <rusty at rustcorp.com.au>
Cc: Michael S. Tsirkin <mst at redhat.com>
Signed...
2015 Mar 12
0
[PATCH net] virtio-net: correctly delete napi hash
...[<ffffffffa0a60000>] ? 0xffffffffa0a60000
> [<ffffffff814c894f>] driver_register+0x5f/0xf0
> [<ffffffff8139e41b>] register_virtio_driver+0x1b/0x30
> [<ffffffffa0a60010>] virtio_net_driver_init+0x10/0x12 [virtio_net]
>
> This patch fixes this by doing this in virtnet_free_queues(). And also
> don't delete napi in virtnet_freeze() since it will call
> virtnet_free_queues() which has already did this.
>
> Fixes 91815639d880 ("virtio-net: rx busy polling support")
> Cc: Rusty Russell <rusty at rustcorp.com.au>
> Cc: Michael S. Tsirkin &l...
2015 Mar 12
0
[PATCH net] virtio-net: correctly delete napi hash
...[<ffffffffa0a60000>] ? 0xffffffffa0a60000
> [<ffffffff814c894f>] driver_register+0x5f/0xf0
> [<ffffffff8139e41b>] register_virtio_driver+0x1b/0x30
> [<ffffffffa0a60010>] virtio_net_driver_init+0x10/0x12 [virtio_net]
>
> This patch fixes this by doing this in virtnet_free_queues(). And also
> don't delete napi in virtnet_freeze() since it will call
> virtnet_free_queues() which has already did this.
>
> Fixes 91815639d880 ("virtio-net: rx busy polling support")
> Cc: Rusty Russell <rusty at rustcorp.com.au>
> Cc: Michael S. Tsirkin &l...
2018 Apr 19
3
[PATCH net] virtio_net: split out ctrl buffer
...mp;vi->ctrl_offloads, sizeof(vi->ctrl_offloads));
+ sg_init_one(&sg, &vi->ctrl->offloads, sizeof(vi->ctrl->offloads));
if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_GUEST_OFFLOADS,
VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET, &sg)) {
@@ -2351,6 +2355,7 @@ static void virtnet_free_queues(struct virtnet_info *vi)
kfree(vi->rq);
kfree(vi->sq);
+ kfree(vi->err_ctrl);
}
static void _free_receive_bufs(struct virtnet_info *vi)
@@ -2543,6 +2548,9 @@ static int virtnet_alloc_queues(struct virtnet_info *vi)
{
int i;
+ vi->ctrl = kzalloc(sizeof(*vi->ctrl), GFP_K...
2013 Dec 06
1
[PATCH 2/2] virtio: delete napi structures from netdev before releasing memory
...)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 930039a..c293764 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1367,6 +1367,11 @@ static void virtnet_config_changed(struct virtio_device *vdev)
>
> static void virtnet_free_queues(struct virtnet_info *vi)
> {
> + int i;
> +
> + for (i = 0; i < vi->max_queue_pairs; i++)
> + netif_napi_del(&vi->rq[i].napi);
> +
> kfree(vi->rq);
> kfree(vi->sq);
> }
Acked-by: Jason Wang <jasowang at redhat.com>
2013 Dec 06
1
[PATCH 2/2] virtio: delete napi structures from netdev before releasing memory
...)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 930039a..c293764 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1367,6 +1367,11 @@ static void virtnet_config_changed(struct virtio_device *vdev)
>
> static void virtnet_free_queues(struct virtnet_info *vi)
> {
> + int i;
> +
> + for (i = 0; i < vi->max_queue_pairs; i++)
> + netif_napi_del(&vi->rq[i].napi);
> +
> kfree(vi->rq);
> kfree(vi->sq);
> }
Acked-by: Jason Wang <jasowang at redhat.com>
2017 Mar 29
1
[PATCH] virtio_net: fix support for small rings
...e;
- len = get_mergeable_buf_len(&rq->mrg_avg_pkt_len);
+ len = get_mergeable_buf_len(rq, &rq->mrg_avg_pkt_len);
if (unlikely(!skb_page_frag_refill(len + headroom, alloc_frag, gfp)))
return -ENOMEM;
@@ -2086,6 +2090,21 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
virtnet_free_queues(vi);
}
+/* How large should a single buffer be so a queue full of these can fit at
+ * least one full packet?
+ * Logic below assumes the mergeable buffer header is used.
+ */
+static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)
+{
+ const unsigned int hdr_le...
2017 Mar 29
1
[PATCH] virtio_net: fix support for small rings
...e;
- len = get_mergeable_buf_len(&rq->mrg_avg_pkt_len);
+ len = get_mergeable_buf_len(rq, &rq->mrg_avg_pkt_len);
if (unlikely(!skb_page_frag_refill(len + headroom, alloc_frag, gfp)))
return -ENOMEM;
@@ -2086,6 +2090,21 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
virtnet_free_queues(vi);
}
+/* How large should a single buffer be so a queue full of these can fit at
+ * least one full packet?
+ * Logic below assumes the mergeable buffer header is used.
+ */
+static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)
+{
+ const unsigned int hdr_le...
2017 Mar 29
1
[PATCH v2] virtio_net: fix support for small rings
...e;
- len = get_mergeable_buf_len(&rq->mrg_avg_pkt_len);
+ len = get_mergeable_buf_len(rq, &rq->mrg_avg_pkt_len);
if (unlikely(!skb_page_frag_refill(len + headroom, alloc_frag, gfp)))
return -ENOMEM;
@@ -2086,6 +2091,21 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
virtnet_free_queues(vi);
}
+/* How large should a single buffer be so a queue full of these can fit at
+ * least one full packet?
+ * Logic below assumes the mergeable buffer header is used.
+ */
+static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)
+{
+ const unsigned int hdr_le...
2017 Mar 29
1
[PATCH v2] virtio_net: fix support for small rings
...e;
- len = get_mergeable_buf_len(&rq->mrg_avg_pkt_len);
+ len = get_mergeable_buf_len(rq, &rq->mrg_avg_pkt_len);
if (unlikely(!skb_page_frag_refill(len + headroom, alloc_frag, gfp)))
return -ENOMEM;
@@ -2086,6 +2091,21 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
virtnet_free_queues(vi);
}
+/* How large should a single buffer be so a queue full of these can fit at
+ * least one full packet?
+ * Logic below assumes the mergeable buffer header is used.
+ */
+static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)
+{
+ const unsigned int hdr_le...
2014 Dec 19
1
[PATCH RFC v4 net-next 1/5] virtio_net: enable tx interrupt
...refill);
>
> - for (i = 0; i < vi->max_queue_pairs; i++)
> + for (i = 0; i < vi->max_queue_pairs; i++) {
> napi_disable(&vi->rq[i].napi);
> + napi_disable(&vi->sq[i].napi);
> + }
>
> return 0;
> }
> @@ -1452,8 +1486,10 @@ static void virtnet_free_queues(struct virtnet_info *vi)
> {
> int i;
>
> - for (i = 0; i < vi->max_queue_pairs; i++)
> + for (i = 0; i < vi->max_queue_pairs; i++) {
> netif_napi_del(&vi->rq[i].napi);
> + netif_napi_del(&vi->sq[i].napi);
> + }
>
> kfree(vi->r...
2014 Dec 19
1
[PATCH RFC v4 net-next 1/5] virtio_net: enable tx interrupt
...refill);
>
> - for (i = 0; i < vi->max_queue_pairs; i++)
> + for (i = 0; i < vi->max_queue_pairs; i++) {
> napi_disable(&vi->rq[i].napi);
> + napi_disable(&vi->sq[i].napi);
> + }
>
> return 0;
> }
> @@ -1452,8 +1486,10 @@ static void virtnet_free_queues(struct virtnet_info *vi)
> {
> int i;
>
> - for (i = 0; i < vi->max_queue_pairs; i++)
> + for (i = 0; i < vi->max_queue_pairs; i++) {
> netif_napi_del(&vi->rq[i].napi);
> + netif_napi_del(&vi->sq[i].napi);
> + }
>
> kfree(vi->r...
2013 Dec 05
9
[PATCH 0/2] virtio-net: Fix two bugs on unloading the module
They can be easy to reproduce, if you try to unload virtio-net
Andrey Vagin (2):
virtio-net: determine type of bufs correctly
virtio: delete napi objects from netdev before releasing memory
drivers/net/virtio_net.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
Cc: Rusty Russell <rusty at rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst at redhat.com>
2013 Dec 05
9
[PATCH 0/2] virtio-net: Fix two bugs on unloading the module
They can be easy to reproduce, if you try to unload virtio-net
Andrey Vagin (2):
virtio-net: determine type of bufs correctly
virtio: delete napi objects from netdev before releasing memory
drivers/net/virtio_net.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
Cc: Rusty Russell <rusty at rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst at redhat.com>
2014 Jan 07
0
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...ic bool try_fill_recv(struct receive_queue *rq, gfp_t gfp)
int err;
bool oom;
+ /* Do not attempt to add a buffer if the RX ring is full. */
+ if (unlikely(!rq->vq->num_free))
+ return true;
gfp |= __GFP_COLD;
do {
if (vi->mergeable_rx_bufs)
@@ -1354,8 +1401,10 @@ static void virtnet_free_queues(struct virtnet_info *vi)
{
int i;
- for (i = 0; i < vi->max_queue_pairs; i++)
+ for (i = 0; i < vi->max_queue_pairs; i++) {
netif_napi_del(&vi->rq[i].napi);
+ kfree(vi->rq[i].mrg_buf_ctx);
+ }
kfree(vi->rq);
kfree(vi->sq);
@@ -1394,12 +1443,14 @@ static vo...
2013 Dec 05
0
[PATCH 2/2] virtio: delete napi structures from netdev before releasing memory
...5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 930039a..c293764 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1367,6 +1367,11 @@ static void virtnet_config_changed(struct virtio_device *vdev)
static void virtnet_free_queues(struct virtnet_info *vi)
{
+ int i;
+
+ for (i = 0; i < vi->max_queue_pairs; i++)
+ netif_napi_del(&vi->rq[i].napi);
+
kfree(vi->rq);
kfree(vi->sq);
}
--
1.8.3.1
2018 Apr 19
1
[PATCH v2 net 1/3] virtio_net: split out ctrl buffer
...mp;vi->ctrl_offloads, sizeof(vi->ctrl_offloads));
+ sg_init_one(&sg, &vi->ctrl->offloads, sizeof(vi->ctrl->offloads));
if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_GUEST_OFFLOADS,
VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET, &sg)) {
@@ -2351,6 +2355,7 @@ static void virtnet_free_queues(struct virtnet_info *vi)
kfree(vi->rq);
kfree(vi->sq);
+ kfree(vi->ctrl);
}
static void _free_receive_bufs(struct virtnet_info *vi)
@@ -2543,6 +2548,9 @@ static int virtnet_alloc_queues(struct virtnet_info *vi)
{
int i;
+ vi->ctrl = kzalloc(sizeof(*vi->ctrl), GFP_KERNE...
2014 Oct 14
4
[PATCH RFC] virtio_net: enable tx interrupt
...napi! */
cancel_delayed_work_sync(&vi->refill);
- for (i = 0; i < vi->max_queue_pairs; i++)
+ for (i = 0; i < vi->max_queue_pairs; i++) {
napi_disable(&vi->rq[i].napi);
+ napi_disable(&vi->sq[i].napi);
+ }
return 0;
}
@@ -1438,8 +1477,10 @@ static void virtnet_free_queues(struct virtnet_info *vi)
{
int i;
- for (i = 0; i < vi->max_queue_pairs; i++)
+ for (i = 0; i < vi->max_queue_pairs; i++) {
netif_napi_del(&vi->rq[i].napi);
+ netif_napi_del(&vi->sq[i].napi);
+ }
kfree(vi->rq);
kfree(vi->sq);
@@ -1593,6 +1634,8 @@ stat...
2014 Oct 14
4
[PATCH RFC] virtio_net: enable tx interrupt
...napi! */
cancel_delayed_work_sync(&vi->refill);
- for (i = 0; i < vi->max_queue_pairs; i++)
+ for (i = 0; i < vi->max_queue_pairs; i++) {
napi_disable(&vi->rq[i].napi);
+ napi_disable(&vi->sq[i].napi);
+ }
return 0;
}
@@ -1438,8 +1477,10 @@ static void virtnet_free_queues(struct virtnet_info *vi)
{
int i;
- for (i = 0; i < vi->max_queue_pairs; i++)
+ for (i = 0; i < vi->max_queue_pairs; i++) {
netif_napi_del(&vi->rq[i].napi);
+ netif_napi_del(&vi->sq[i].napi);
+ }
kfree(vi->rq);
kfree(vi->sq);
@@ -1593,6 +1634,8 @@ stat...