search for: virtio_transport_free_buf

Displaying 7 results from an estimated 7 matches for "virtio_transport_free_buf".

2019 May 12
1
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...->addr = kmalloc(pkt->len, GFP_KERNEL); > + if (!buf->addr) { > + kfree(buf); > + return NULL; > + } > + > + memcpy(buf->addr, pkt->buf, pkt->len); > + } > + > + buf->len = pkt->len; > + > + return buf; > +} > + > +static void virtio_transport_free_buf(struct virtio_vsock_buf *buf) > +{ > + kfree(buf->addr); > + kfree(buf); > +} > + > /* Packet capture */ > static struct sk_buff *virtio_transport_build_skb(void *opaque) > { > @@ -190,17 +233,15 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, &...
2019 May 10
0
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...buf->addr = pkt->buf; + pkt->buf = NULL; + } else { + buf->addr = kmalloc(pkt->len, GFP_KERNEL); + if (!buf->addr) { + kfree(buf); + return NULL; + } + + memcpy(buf->addr, pkt->buf, pkt->len); + } + + buf->len = pkt->len; + + return buf; +} + +static void virtio_transport_free_buf(struct virtio_vsock_buf *buf) +{ + kfree(buf->addr); + kfree(buf); +} + /* Packet capture */ static struct sk_buff *virtio_transport_build_skb(void *opaque) { @@ -190,17 +233,15 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, return virtio_transport_get_ops()->send_p...
2019 May 10
18
[PATCH v2 0/8] vsock/virtio: optimizations to increase the throughput
While I was testing this new series (v2) I discovered an huge use of memory and a memory leak in the virtio-vsock driver in the guest when I sent 1-byte packets to the guest. These issues are present since the introduction of the virtio-vsock driver. I added the patches 1 and 2 to fix them in this series in order to better track the performance trends. v1:
2019 May 10
18
[PATCH v2 0/8] vsock/virtio: optimizations to increase the throughput
While I was testing this new series (v2) I discovered an huge use of memory and a memory leak in the virtio-vsock driver in the guest when I sent 1-byte packets to the guest. These issues are present since the introduction of the virtio-vsock driver. I added the patches 1 and 2 to fix them in this series in order to better track the performance trends. v1:
2019 May 10
0
[PATCH v2 2/8] vsock/virtio: free packets during the socket release
...ol remove_sock = true; lock_sock(sk); if (sk->sk_type == SOCK_STREAM) remove_sock = virtio_transport_close(vsk); + while (!list_empty(&vvs->rx_queue)) { + buf = list_first_entry(&vvs->rx_queue, + struct virtio_vsock_buf, list); + list_del(&buf->list); + virtio_transport_free_buf(buf); + } release_sock(sk); if (remove_sock) -- 2.20.1
2019 May 13
2
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...->addr = kmalloc(pkt->len, GFP_KERNEL); > + if (!buf->addr) { > + kfree(buf); > + return NULL; > + } > + > + memcpy(buf->addr, pkt->buf, pkt->len); > + } > + > + buf->len = pkt->len; > + > + return buf; > +} > + > +static void virtio_transport_free_buf(struct virtio_vsock_buf *buf) > +{ > + kfree(buf->addr); > + kfree(buf); > +} > + > /* Packet capture */ > static struct sk_buff *virtio_transport_build_skb(void *opaque) > { > @@ -190,17 +233,15 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk...
2019 May 13
2
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...->addr = kmalloc(pkt->len, GFP_KERNEL); > + if (!buf->addr) { > + kfree(buf); > + return NULL; > + } > + > + memcpy(buf->addr, pkt->buf, pkt->len); > + } > + > + buf->len = pkt->len; > + > + return buf; > +} > + > +static void virtio_transport_free_buf(struct virtio_vsock_buf *buf) > +{ > + kfree(buf->addr); > + kfree(buf); > +} > + > /* Packet capture */ > static struct sk_buff *virtio_transport_build_skb(void *opaque) > { > @@ -190,17 +233,15 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk...