search for: buf_len

Displaying 20 results from an estimated 235 matches for "buf_len".

2018 Nov 05
2
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...(GFP_KERNEL); + if (!page) + return -ENOMEM; + + sg_init_one(&sg, page, PAGE_SIZE); + + err = virtqueue_add_inbuf(vq, &sg, 1, page, GFP_KERNEL); + if (err < 0) + free_page((unsigned long) page); + + return err; +} + static void virtio_vsock_rx_fill(struct virtio_vsock *vsock) { int buf_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; @@ -267,27 +287,33 @@ static void virtio_vsock_rx_fill(struct virtio_vsock *vsock) vq = vsock->vqs[VSOCK_VQ_RX]; do { - pkt = kzalloc(sizeof(*pkt), GFP_KERNEL); - if (!pkt) - break; + if (vsock->mergeable) { + ret = fill_mergeable_rx_buff(vq); +...
2018 Nov 05
2
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...(GFP_KERNEL); + if (!page) + return -ENOMEM; + + sg_init_one(&sg, page, PAGE_SIZE); + + err = virtqueue_add_inbuf(vq, &sg, 1, page, GFP_KERNEL); + if (err < 0) + free_page((unsigned long) page); + + return err; +} + static void virtio_vsock_rx_fill(struct virtio_vsock *vsock) { int buf_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; @@ -267,27 +287,33 @@ static void virtio_vsock_rx_fill(struct virtio_vsock *vsock) vq = vsock->vqs[VSOCK_VQ_RX]; do { - pkt = kzalloc(sizeof(*pkt), GFP_KERNEL); - if (!pkt) - break; + if (vsock->mergeable) { + ret = fill_mergeable_rx_buff(vq); +...
2019 May 14
3
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
.../vsock.c >>> index bb5fc0e9fbc2..7964e2daee09 100644 >>> --- a/drivers/vhost/vsock.c >>> +++ b/drivers/vhost/vsock.c >>> @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, >>> return NULL; >>> } >>> + pkt->buf_len = pkt->len; >>> + >>> nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); >>> if (nbytes != pkt->len) { >>> vq_err(vq, "Expected %u byte payload, got %zu bytes\n", >>> diff --git a/include/linux/virtio_vsock.h b...
2019 May 14
3
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
.../vsock.c >>> index bb5fc0e9fbc2..7964e2daee09 100644 >>> --- a/drivers/vhost/vsock.c >>> +++ b/drivers/vhost/vsock.c >>> @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, >>> return NULL; >>> } >>> + pkt->buf_len = pkt->len; >>> + >>> nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); >>> if (nbytes != pkt->len) { >>> vq_err(vq, "Expected %u byte payload, got %zu bytes\n", >>> diff --git a/include/linux/virtio_vsock.h b...
2019 May 13
2
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c > index bb5fc0e9fbc2..7964e2daee09 100644 > --- a/drivers/vhost/vsock.c > +++ b/drivers/vhost/vsock.c > @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, > return NULL; > } > > + pkt->buf_len = pkt->len; > + > nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); > if (nbytes != pkt->len) { > vq_err(vq, "Expected %u byte payload, got %zu bytes\n", > diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h > index e2...
2019 May 13
2
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c > index bb5fc0e9fbc2..7964e2daee09 100644 > --- a/drivers/vhost/vsock.c > +++ b/drivers/vhost/vsock.c > @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, > return NULL; > } > > + pkt->buf_len = pkt->len; > + > nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); > if (nbytes != pkt->len) { > vq_err(vq, "Expected %u byte payload, got %zu bytes\n", > diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h > index e2...
2015 Sep 04
2
[syslinux:master] tftp: Report server IP address on debug message
...44 > --- a/core/fs/pxe/tftp.c > +++ b/core/fs/pxe/tftp.c > @@ -259,7 +259,16 @@ wait_pkt: > } else { > /* Make sure the packet actually came from the server and > is long enough for a TFTP opcode */ > - dprintf("tftp_open: got packet buflen=%d\n", buf_len); > + dprintf("tftp_open: got packet buflen=%d from server %u.%u.%u.%u(%u.%u.%u.%u)\n", > + buf_len, > + ((uint8_t *)&src_ip)[0], > + ((uint8_t *)&src_ip)[1], > + ((uint8_t *)&src_ip)[2], > + ((uint8_t *)&src_ip)[3], Most likely the TFTP se...
2015 Feb 02
1
Re: [PATCH 5/6] New APIs: copy-in and copy-out
...const char **dirname, const char **basename); > + > +int > +guestfs__copy_in (guestfs_h *g, const char *localpath, const char *remotedir) > +{ > + CLEANUP_CMD_CLOSE struct command *cmd = guestfs___new_command (g); > + int fd; > + int r; > + char fdbuf[64]; > + size_t buf_len = strlen (localpath) + 1; > + char buf[buf_len]; > + const char *dirname, *basename; > + > + if (guestfs_is_dir (g, remotedir) == -1) > + return -1; I suppose this is here to check that remotedir is a directory, but that's not what the code here does. The original guestfi...
2019 May 12
1
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...t; diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c > index bb5fc0e9fbc2..7964e2daee09 100644 > --- a/drivers/vhost/vsock.c > +++ b/drivers/vhost/vsock.c > @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, > return NULL; > } > > + pkt->buf_len = pkt->len; > + > nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); > if (nbytes != pkt->len) { > vq_err(vq, "Expected %u byte payload, got %zu bytes\n", > diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h > index e223e...
2018 Nov 06
0
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...hose nice features. Thanks > + > + err = virtqueue_add_inbuf(vq, &sg, 1, page, GFP_KERNEL); > + if (err < 0) > + free_page((unsigned long) page); > + > + return err; > +} > + > static void virtio_vsock_rx_fill(struct virtio_vsock *vsock) > { > int buf_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; > @@ -267,27 +287,33 @@ static void virtio_vsock_rx_fill(struct virtio_vsock *vsock) > vq = vsock->vqs[VSOCK_VQ_RX]; > > do { > - pkt = kzalloc(sizeof(*pkt), GFP_KERNEL); > - if (!pkt) > - break; > + if (vsock->mergeable)...
2015 Jan 26
6
[PATCH 1/6] cmd: add a way to run (and wait) asynchronously commands
--- src/command.c | 64 +++++++++++++++++++++++++++++++++++++++++++------- src/guestfs-internal.h | 3 +++ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/command.c b/src/command.c index 4bb469b..e26573d 100644 --- a/src/command.c +++ b/src/command.c @@ -360,7 +360,7 @@ debug_command (struct command *cmd) } static int -run_command (struct command *cmd)
2019 May 31
0
[PATCH v3 1/5] vsock/virtio: limit the memory used per-socket
...changed, 55 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bb5fc0e9fbc2..7964e2daee09 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, return NULL; } + pkt->buf_len = pkt->len; + nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); if (nbytes != pkt->len) { vq_err(vq, "Expected %u byte payload, got %zu bytes\n", diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h index e223e2632edd..7d973903f52e 100644 -...
2019 Jul 17
0
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...changed, 55 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 6a50e1d0529c..6c8390a2af52 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -329,6 +329,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, return NULL; } + pkt->buf_len = pkt->len; + nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); if (nbytes != pkt->len) { vq_err(vq, "Expected %u byte payload, got %zu bytes\n", diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h index e223e2632edd..7d973903f52e 100644 -...
2015 Jan 26
0
[PATCH 5/6] New APIs: copy-in and copy-out
...har *buf, size_t buf_size, const char *path, const char **dirname, const char **basename); + +int +guestfs__copy_in (guestfs_h *g, const char *localpath, const char *remotedir) +{ + CLEANUP_CMD_CLOSE struct command *cmd = guestfs___new_command (g); + int fd; + int r; + char fdbuf[64]; + size_t buf_len = strlen (localpath) + 1; + char buf[buf_len]; + const char *dirname, *basename; + + if (guestfs_is_dir (g, remotedir) == -1) + return -1; + + if (split_path (buf, buf_len, localpath, &dirname, &basename) == -1) + return -1; + + guestfs___cmd_add_arg (cmd, "tar"); + if...
2019 May 13
0
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...vsock.c b/drivers/vhost/vsock.c > > index bb5fc0e9fbc2..7964e2daee09 100644 > > --- a/drivers/vhost/vsock.c > > +++ b/drivers/vhost/vsock.c > > @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, > > return NULL; > > } > > + pkt->buf_len = pkt->len; > > + > > nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); > > if (nbytes != pkt->len) { > > vq_err(vq, "Expected %u byte payload, got %zu bytes\n", > > diff --git a/include/linux/virtio_vsock.h b/include/linux/vir...
2010 Jul 15
0
Speex Resampler
...all, bufout_len = 320 is correct since that value is the number of stereo samples. Using 640 would be wrong (and no wonder that it crashes). Secondly, "speex_resampler_process_interleaved_float" has a bug that keeps it from working when it is output limited, so if you ever set "buf_len" to any value greater than 1764 the resampler will stop functioning properly from then on. Hope this helps. --John Date: Thu, 15 Jul 2010 13:15:32 +0200 > From: Ren? Sch?mann<white06tiger at gmx.de> > Subject: [Speex-dev] Speex Resampler > To: Speex-dev at xiph.org > Mes...
2019 May 14
0
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...7964e2daee09 100644 > > > > --- a/drivers/vhost/vsock.c > > > > +++ b/drivers/vhost/vsock.c > > > > @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, > > > > return NULL; > > > > } > > > > + pkt->buf_len = pkt->len; > > > > + > > > > nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); > > > > if (nbytes != pkt->len) { > > > > vq_err(vq, "Expected %u byte payload, got %zu bytes\n", > > > > diff --g...
2002 Oct 23
2
vsnprintf()
I think I stumbled upon a bug in the i_snprintf() function. In the case of vnsprintf() being available, it depends on vnsprintf() returning -1 when the string was longer than the passed-in limit (or it won't terminate the string.). But this isn't the C99-standardized behaviour, and newer glibc's don't do that anymore either, so you can end up with a non-terminated string. This
2019 May 10
0
[PATCH v2 1/8] vsock/virtio: limit the memory used per-socket
...hanged, 81 insertions(+), 25 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bb5fc0e9fbc2..7964e2daee09 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -320,6 +320,8 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, return NULL; } + pkt->buf_len = pkt->len; + nbytes = copy_from_iter(pkt->buf, pkt->len, &iov_iter); if (nbytes != pkt->len) { vq_err(vq, "Expected %u byte payload, got %zu bytes\n", diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h index e223e2632edd..345f04ee9193 100644 -...
2018 Dec 12
2
[PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest
...fer. + */ + len += hole; + alloc_frag->offset += hole; + } + + sg_init_one(&sg, buf, len); + err = virtqueue_add_inbuf(vq, &sg, 1, buf, GFP_KERNEL); + if (err < 0) + put_page(virt_to_head_page(buf)); + + return err; +} + +static int fill_old_rx_buff(struct virtqueue *vq) { int buf_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; struct virtio_vsock_pkt *pkt; struct scatterlist hdr, buf, *sgs[2]; - struct virtqueue *vq; int ret; - vq = vsock->vqs[VSOCK_VQ_RX]; + pkt = kzalloc(sizeof(*pkt), GFP_KERNEL); + if (!pkt) + return -ENOMEM; - do { - pkt = kzalloc(sizeof(*pkt), GFP_KER...