Displaying 20 results from an estimated 354 matches for "num_buff".
Did you mean:
num_buf
2015 Feb 03
2
[PATCH for-3.19] vhost/net: fix up num_buffers endian-ness
In virtio 1.0 mode, when mergeable buffers are enabled on a big-endian
host, num_buffers wasn't byte-swapped correctly, so large incoming
packets got corrupted.
To fix, fill it in within hdr - this also makes sure it gets
the correct type.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
It seems important to get this into 3.19, otherwise
VIRTIO_1 feature bit i...
2015 Feb 03
2
[PATCH for-3.19] vhost/net: fix up num_buffers endian-ness
In virtio 1.0 mode, when mergeable buffers are enabled on a big-endian
host, num_buffers wasn't byte-swapped correctly, so large incoming
packets got corrupted.
To fix, fill it in within hdr - this also makes sure it gets
the correct type.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
It seems important to get this into 3.19, otherwise
VIRTIO_1 feature bit i...
2010 May 17
2
[PATCH] [resend] fix non-mergeable buffers packet too large error handling
...61,21 @@ static void handle_rx(struct vhost_net *net)
break;
}
/* TODO: Should check and handle checksum. */
- if (vhost_has_feature(&net->dev, VIRTIO_NET_F_MRG_RXBUF) &&
- memcpy_toiovecend(vq->hdr, (unsigned char *)&headcount,
- offsetof(typeof(hdr), num_buffers),
- sizeof hdr.num_buffers)) {
- vq_err(vq, "Failed num_buffers write");
+ if (vhost_has_feature(&net->dev, VIRTIO_NET_F_MRG_RXBUF)) {
+ if (memcpy_toiovecend(vq->hdr,
+ (unsigned char *)&headcount,
+ offsetof(typeof(hdr),
+ num...
2010 May 17
2
[PATCH] [resend] fix non-mergeable buffers packet too large error handling
...61,21 @@ static void handle_rx(struct vhost_net *net)
break;
}
/* TODO: Should check and handle checksum. */
- if (vhost_has_feature(&net->dev, VIRTIO_NET_F_MRG_RXBUF) &&
- memcpy_toiovecend(vq->hdr, (unsigned char *)&headcount,
- offsetof(typeof(hdr), num_buffers),
- sizeof hdr.num_buffers)) {
- vq_err(vq, "Failed num_buffers write");
+ if (vhost_has_feature(&net->dev, VIRTIO_NET_F_MRG_RXBUF)) {
+ if (memcpy_toiovecend(vq->hdr,
+ (unsigned char *)&headcount,
+ offsetof(typeof(hdr),
+ num...
2015 Feb 24
3
[PATCH] vhost: drop hard-coded num_buffers size
...at.com>
---
drivers/vhost/net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index ca70434..2bbfc25 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -621,7 +621,8 @@ static void handle_rx(struct vhost_net *net)
num_buffers = cpu_to_vhost16(vq, headcount);
if (likely(mergeable) &&
- copy_to_iter(&num_buffers, 2, &fixup) != 2) {
+ copy_to_iter(&num_buffers, sizeof num_buffers,
+ &fixup) != sizeof num_buffers) {
vq_err(vq, "Failed num_buffers write");
vhost_d...
2015 Feb 25
0
[PATCH] vhost: drop hard-coded num_buffers size
...at.com>
---
drivers/vhost/net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index ca70434..2bbfc25 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -621,7 +621,8 @@ static void handle_rx(struct vhost_net *net)
num_buffers = cpu_to_vhost16(vq, headcount);
if (likely(mergeable) &&
- copy_to_iter(&num_buffers, 2, &fixup) != 2) {
+ copy_to_iter(&num_buffers, sizeof num_buffers,
+ &fixup) != sizeof num_buffers) {
vq_err(vq, "Failed num_buffers write");
vhost_d...
2015 Feb 24
3
[PATCH] vhost: drop hard-coded num_buffers size
...at.com>
---
drivers/vhost/net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index ca70434..2bbfc25 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -621,7 +621,8 @@ static void handle_rx(struct vhost_net *net)
num_buffers = cpu_to_vhost16(vq, headcount);
if (likely(mergeable) &&
- copy_to_iter(&num_buffers, 2, &fixup) != 2) {
+ copy_to_iter(&num_buffers, sizeof num_buffers,
+ &fixup) != sizeof num_buffers) {
vq_err(vq, "Failed num_buffers write");
vhost_d...
2015 Feb 25
0
[PATCH] vhost: drop hard-coded num_buffers size
...at.com>
---
drivers/vhost/net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index ca70434..2bbfc25 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -621,7 +621,8 @@ static void handle_rx(struct vhost_net *net)
num_buffers = cpu_to_vhost16(vq, headcount);
if (likely(mergeable) &&
- copy_to_iter(&num_buffers, 2, &fixup) != 2) {
+ copy_to_iter(&num_buffers, sizeof num_buffers,
+ &fixup) != sizeof num_buffers) {
vq_err(vq, "Failed num_buffers write");
vhost_d...
2017 Mar 01
1
[virtio-dev] packed ring layout proposal v2
...ngs serve devices (e.g. storage) that complete out of order.
I see, and thanks.
> > That said, if it's "16: 16" and if we use only 8 bits for batch, we
> > could still have another 8 bit for anything else, say the number of
> > desc for a single pkt. With that, the num_buffers of mergeable Rx
> > header could be replaced. More importantly, we could reduce a cache
> > line write if non offload are supported in mergeable Rx path.
>
> Why do you bother with mergeable Rx without offloads?
Oh, my bad. I actually meant "without offloads __being us...
2017 Mar 01
2
[virtio-dev] packed ring layout proposal v2
...he default vring size is 256 and a typical burst size normally is
> way less than that.
>
> That said, if it's "16: 16" and if we use only 8 bits for batch, we
> could still have another 8 bit for anything else, say the number of
> desc for a single pkt. With that, the num_buffers of mergeable Rx
> header could be replaced. More importantly, we could reduce a cache
> line write if non offload are supported in mergeable Rx path.
Why do you bother with mergeable Rx without offloads? Make each buffer
MTU sized and it'll fit without merging. Linux used not to,...
2017 Mar 01
2
[virtio-dev] packed ring layout proposal v2
...he default vring size is 256 and a typical burst size normally is
> way less than that.
>
> That said, if it's "16: 16" and if we use only 8 bits for batch, we
> could still have another 8 bit for anything else, say the number of
> desc for a single pkt. With that, the num_buffers of mergeable Rx
> header could be replaced. More importantly, we could reduce a cache
> line write if non offload are supported in mergeable Rx path.
Why do you bother with mergeable Rx without offloads? Make each buffer
MTU sized and it'll fit without merging. Linux used not to,...
2015 Feb 04
2
[PATCH v3 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend()
...vq->iov, in, vhost_len);
+ fixup = msg.msg_iter;
+ if (unlikely((vhost_hlen))) {
+ /* We will supply the header ourselves
+ * TODO: support TSO.
+ */
+ iov_iter_advance(&msg.msg_iter, vhost_hlen);
+ } else {
+ /* It'll come from socket; we'll need to patch
+ * ->num_buffers over if VIRTIO_NET_F_MRG_RXBUF
+ */
+ iov_iter_advance(&fixup, sizeof(hdr));
+ }
err = sock->ops->recvmsg(NULL, sock, &msg,
sock_len, MSG_DONTWAIT | MSG_TRUNC);
/* Userspace might have consumed the packet meanwhile:
@@ -643,18 +607,18 @@ static void handle_rx(str...
2015 Feb 04
2
[PATCH v3 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend()
...vq->iov, in, vhost_len);
+ fixup = msg.msg_iter;
+ if (unlikely((vhost_hlen))) {
+ /* We will supply the header ourselves
+ * TODO: support TSO.
+ */
+ iov_iter_advance(&msg.msg_iter, vhost_hlen);
+ } else {
+ /* It'll come from socket; we'll need to patch
+ * ->num_buffers over if VIRTIO_NET_F_MRG_RXBUF
+ */
+ iov_iter_advance(&fixup, sizeof(hdr));
+ }
err = sock->ops->recvmsg(NULL, sock, &msg,
sock_len, MSG_DONTWAIT | MSG_TRUNC);
/* Userspace might have consumed the packet meanwhile:
@@ -643,18 +607,18 @@ static void handle_rx(str...
2020 Aug 19
4
[PATCH 05/28] media/v4l2: remove V4L2-FLAG-MEMORY-NON-CONSISTENT
...onsistency model mismatch\n");
> - return false;
> - }
> - return true;
> -}
> -
> int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
> unsigned int flags, unsigned int *count)
> {
> unsigned int num_buffers, allocated_buffers, num_planes = 0;
> unsigned plane_sizes[VB2_MAX_PLANES] = { };
> - bool consistent_mem = true;
> unsigned int i;
> int ret;
>
> - if (flags & V4L2_FLAG_MEMORY_NON_CONSISTENT)
> - consistent_mem = false;...
2015 Feb 04
0
[PATCH for-3.19] vhost/net: fix up num_buffers endian-ness
From: "Michael S. Tsirkin" <mst at redhat.com>
Date: Tue, 3 Feb 2015 11:07:06 +0200
> In virtio 1.0 mode, when mergeable buffers are enabled on a big-endian
> host, num_buffers wasn't byte-swapped correctly, so large incoming
> packets got corrupted.
>
> To fix, fill it in within hdr - this also makes sure it gets
> the correct type.
>
> Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
Applied.
2015 Feb 04
0
[PATCH for-3.19] vhost/net: fix up num_buffers endian-ness
From: "Michael S. Tsirkin" <mst at redhat.com>
Date: Tue, 3 Feb 2015 11:07:06 +0200
> In virtio 1.0 mode, when mergeable buffers are enabled on a big-endian
> host, num_buffers wasn't byte-swapped correctly, so large incoming
> packets got corrupted.
>
> To fix, fill it in within hdr - this also makes sure it gets
> the correct type.
>
> Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
Applied.
2017 Mar 01
0
[virtio-dev] packed ring layout proposal v2
...e) that complete out of order.
>
> I see, and thanks.
>
> > > That said, if it's "16: 16" and if we use only 8 bits for batch, we
> > > could still have another 8 bit for anything else, say the number of
> > > desc for a single pkt. With that, the num_buffers of mergeable Rx
> > > header could be replaced. More importantly, we could reduce a cache
> > > line write if non offload are supported in mergeable Rx path.
> >
> > Why do you bother with mergeable Rx without offloads?
>
> Oh, my bad. I actually meant &qu...
2015 Feb 15
1
[PATCH net] vhost_net: fix wrong iter offset when setting number of buffers
...O_NONE
+ struct virtio_net_hdr hdr = {
+ .flags = 0,
+ .gso_type = VIRTIO_NET_HDR_GSO_NONE
};
size_t total_len = 0;
int err, mergeable;
@@ -539,6 +539,7 @@ static void handle_rx(struct vhost_net *net)
size_t vhost_len, sock_len;
struct socket *sock;
struct iov_iter fixup;
+ __virtio16 num_buffers;
mutex_lock(&vq->mutex);
sock = vq->private_data;
@@ -616,9 +617,9 @@ static void handle_rx(struct vhost_net *net)
}
/* TODO: Should check and handle checksum. */
- hdr.num_buffers = cpu_to_vhost16(vq, headcount);
+ num_buffers = cpu_to_vhost16(vq, headcount);
if (li...
2015 Feb 15
1
[PATCH net] vhost_net: fix wrong iter offset when setting number of buffers
...O_NONE
+ struct virtio_net_hdr hdr = {
+ .flags = 0,
+ .gso_type = VIRTIO_NET_HDR_GSO_NONE
};
size_t total_len = 0;
int err, mergeable;
@@ -539,6 +539,7 @@ static void handle_rx(struct vhost_net *net)
size_t vhost_len, sock_len;
struct socket *sock;
struct iov_iter fixup;
+ __virtio16 num_buffers;
mutex_lock(&vq->mutex);
sock = vq->private_data;
@@ -616,9 +617,9 @@ static void handle_rx(struct vhost_net *net)
}
/* TODO: Should check and handle checksum. */
- hdr.num_buffers = cpu_to_vhost16(vq, headcount);
+ num_buffers = cpu_to_vhost16(vq, headcount);
if (li...
2020 Aug 19
0
[PATCH 05/28] media/v4l2: remove V4L2-FLAG-MEMORY-NON-CONSISTENT
...ISTENT);
-
- if (consistent_mem != queue_is_consistent) {
- dprintk(q, 1, "memory consistency model mismatch\n");
- return false;
- }
- return true;
-}
-
int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
unsigned int flags, unsigned int *count)
{
unsigned int num_buffers, allocated_buffers, num_planes = 0;
unsigned plane_sizes[VB2_MAX_PLANES] = { };
- bool consistent_mem = true;
unsigned int i;
int ret;
- if (flags & V4L2_FLAG_MEMORY_NON_CONSISTENT)
- consistent_mem = false;
-
if (q->streaming) {
dprintk(q, 1, "streaming active\n")...