search for: vhost_net_max_sg

Displaying 20 results from an estimated 46 matches for "vhost_net_max_sg".

2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
...etions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 29e850a..e828ef1 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -243,7 +243,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, int r, nlogs = 0; while (datalen > 0) { - if (unlikely(headcount >= VHOST_NET_MAX_SG)) { + if (unlikely(headcount >= UIO_MAXIOV)) { r = -ENOBUFS; goto err; } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c579dcc..a45270e 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -212,6 +212,45 @@ static int vhost_worker(void *data) } }...
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
...etions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 29e850a..e828ef1 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -243,7 +243,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, int r, nlogs = 0; while (datalen > 0) { - if (unlikely(headcount >= VHOST_NET_MAX_SG)) { + if (unlikely(headcount >= UIO_MAXIOV)) { r = -ENOBUFS; goto err; } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c579dcc..a45270e 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -212,6 +212,45 @@ static int vhost_worker(void *data) } }...
2010 Aug 05
0
[PATCH RFC] vhost: max s/g to match qemu
...h +++ b/drivers/vhost/vhost.h @@ -12,14 +12,10 @@ #include <linux/uio.h> #include <linux/virtio_config.h> #include <linux/virtio_ring.h> +#include <linux/virtio_net.h> struct vhost_device; -enum { - /* Enough place for all fragments, head, and virtio net header. */ - VHOST_NET_MAX_SG = MAX_SKB_FRAGS + 2, -}; - /* Poll a file (eventfd or socket) */ /* Note: there's nothing vhost specific about this structure. */ struct vhost_poll { @@ -83,9 +79,12 @@ struct vhost_virtqueue { bool log_used; u64 log_addr; - struct iovec indirect[VHOST_NET_MAX_SG]; - struct iovec iov[V...
2010 Aug 05
0
[PATCH RFC] vhost: max s/g to match qemu
...h +++ b/drivers/vhost/vhost.h @@ -12,14 +12,10 @@ #include <linux/uio.h> #include <linux/virtio_config.h> #include <linux/virtio_ring.h> +#include <linux/virtio_net.h> struct vhost_device; -enum { - /* Enough place for all fragments, head, and virtio net header. */ - VHOST_NET_MAX_SG = MAX_SKB_FRAGS + 2, -}; - /* Poll a file (eventfd or socket) */ /* Note: there's nothing vhost specific about this structure. */ struct vhost_poll { @@ -83,9 +79,12 @@ struct vhost_virtqueue { bool log_used; u64 log_addr; - struct iovec indirect[VHOST_NET_MAX_SG]; - struct iovec iov[V...
2010 Mar 03
1
[RFC][ PATCH 2/3] vhost-net: handle vnet_hdr processing for MRG_RX_BUF
...seg = vhost_get_hdr(vq, &in, log, log_num); + if (!seg) + return 0; + hc++; + datalen -= iov_length(vq->iov+seg, in); + seg += in; + } + while (datalen > 0) { if (hc >= VHOST_NET_MAX_SG) { vhost_discard(vq, hc); return 0; } heads[hc].iov_base = (void *)vhost_get_vq_desc(vq->dev, vq, - vq->iov, ARRAY_SIZE(vq->iov), &out, &in, log, log_num); +...
2010 Mar 03
1
[RFC][ PATCH 2/3] vhost-net: handle vnet_hdr processing for MRG_RX_BUF
...seg = vhost_get_hdr(vq, &in, log, log_num); + if (!seg) + return 0; + hc++; + datalen -= iov_length(vq->iov+seg, in); + seg += in; + } + while (datalen > 0) { if (hc >= VHOST_NET_MAX_SG) { vhost_discard(vq, hc); return 0; } heads[hc].iov_base = (void *)vhost_get_vq_desc(vq->dev, vq, - vq->iov, ARRAY_SIZE(vq->iov), &out, &in, log, log_num); +...
2010 Sep 14
1
[PATCH] vhost-net: fix range checking in mrg bufs case
...etions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 6400cd5..f095de6 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -245,7 +245,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, int r, nlogs = 0; while (datalen > 0) { - if (unlikely(headcount >= VHOST_NET_MAX_SG)) { + if (unlikely(seg >= VHOST_NET_MAX_SG)) { r = -ENOBUFS; goto err; } -- 1.7.3.rc1.5.ge5969
2010 Sep 14
1
[PATCH] vhost-net: fix range checking in mrg bufs case
...etions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 6400cd5..f095de6 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -245,7 +245,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, int r, nlogs = 0; while (datalen > 0) { - if (unlikely(headcount >= VHOST_NET_MAX_SG)) { + if (unlikely(seg >= VHOST_NET_MAX_SG)) { r = -ENOBUFS; goto err; } -- 1.7.3.rc1.5.ge5969
2010 Mar 03
1
[RFC][ PATCH 1/3] vhost-net: support multiple buffer heads in receiver
...rn 0; } +unsigned vhost_get_heads(struct vhost_virtqueue *vq, int datalen, int *iovcount, + struct vhost_log *log, unsigned int *log_num) +{ + struct iovec *heads = vq->heads; + int out, in; + int hc = 0; + + while (datalen > 0) { + if (hc >= VHOST_NET_MAX_SG) { + vhost_discard(vq, hc); + return 0; + } + heads[hc].iov_base = (void *)vhost_get_vq_desc(vq->dev, vq, + vq->iov, ARRAY_SIZE(vq->iov), &out, &in, log, log_num); + if (he...
2010 Mar 03
1
[RFC][ PATCH 1/3] vhost-net: support multiple buffer heads in receiver
...rn 0; } +unsigned vhost_get_heads(struct vhost_virtqueue *vq, int datalen, int *iovcount, + struct vhost_log *log, unsigned int *log_num) +{ + struct iovec *heads = vq->heads; + int out, in; + int hc = 0; + + while (datalen > 0) { + if (hc >= VHOST_NET_MAX_SG) { + vhost_discard(vq, hc); + return 0; + } + heads[hc].iov_base = (void *)vhost_get_vq_desc(vq->dev, vq, + vq->iov, ARRAY_SIZE(vq->iov), &out, &in, log, log_num); + if (he...
2010 Apr 19
2
[PATCH v4] Add mergeable RX bufs support to vhost
...st_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, int *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + int out, in; + int seg = 0; /* iov index */ + int hc = 0; /* head count */ + int rv; + + while (datalen > 0) { + if (hc >= VHOST_NET_MAX_SG) { + rv = -ENOBUFS; + goto err; + } + heads[hc].id = vhost_get_desc(vq->dev, vq, vq->iov+seg, + ARRAY_SIZE(vq->iov)-seg, &out, + &in, log, log_num); + if (heads[hc].id == vq->num) { + rv = 0; + goto err; + } + if (out || in <= 0) { + vq_err(...
2010 Apr 19
2
[PATCH v4] Add mergeable RX bufs support to vhost
...st_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, int *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + int out, in; + int seg = 0; /* iov index */ + int hc = 0; /* head count */ + int rv; + + while (datalen > 0) { + if (hc >= VHOST_NET_MAX_SG) { + rv = -ENOBUFS; + goto err; + } + heads[hc].id = vhost_get_desc(vq->dev, vq, vq->iov+seg, + ARRAY_SIZE(vq->iov)-seg, &out, + &in, log, log_num); + if (heads[hc].id == vq->num) { + rv = 0; + goto err; + } + if (out || in <= 0) { + vq_err(...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...+int vhost_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, unsigned *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + unsigned int out, in; + int seg = 0; + int headcount = 0; + int r; + + while (datalen > 0) { + if (headcount >= VHOST_NET_MAX_SG) { + r = -ENOBUFS; + goto err; + } + heads[headcount].id = vhost_get_desc(vq->dev, vq, vq->iov + seg, + ARRAY_SIZE(vq->iov) - seg, &out, + &in, log, log_num); + if (heads[headcount].id == vq->num) { + r = 0; + goto err; + } + if (out || in <=...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...+int vhost_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, unsigned *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + unsigned int out, in; + int seg = 0; + int headcount = 0; + int r; + + while (datalen > 0) { + if (headcount >= VHOST_NET_MAX_SG) { + r = -ENOBUFS; + goto err; + } + heads[headcount].id = vhost_get_desc(vq->dev, vq, vq->iov + seg, + ARRAY_SIZE(vq->iov) - seg, &out, + &in, log, log_num); + if (heads[headcount].id == vq->num) { + r = 0; + goto err; + } + if (out || in <=...
2010 Apr 23
1
[PATCHv5] add mergeable receiver buffers support to vhost
...st_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, int *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + int out, in; + int seg = 0; /* iov index */ + int hc = 0; /* head count */ + int rv; + + while (datalen > 0) { + if (hc >= VHOST_NET_MAX_SG) { + rv = -ENOBUFS; + goto err; + } + heads[hc].id = vhost_get_desc(vq->dev, vq, vq->iov+seg, + ARRAY_SIZE(vq->iov)-seg, &out, + &in, log, log_num); + if (heads[hc].id == vq->num) { + rv = 0; + goto err; + } + if (out || in <= 0) { + vq_err(...
2010 Apr 23
1
[PATCHv5] add mergeable receiver buffers support to vhost
...st_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, int *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + int out, in; + int seg = 0; /* iov index */ + int hc = 0; /* head count */ + int rv; + + while (datalen > 0) { + if (hc >= VHOST_NET_MAX_SG) { + rv = -ENOBUFS; + goto err; + } + heads[hc].id = vhost_get_desc(vq->dev, vq, vq->iov+seg, + ARRAY_SIZE(vq->iov)-seg, &out, + &in, log, log_num); + if (heads[hc].id == vq->num) { + rv = 0; + goto err; + } + if (out || in <= 0) { + vq_err(...
2010 Apr 28
6
[PATCHv7] add mergeable buffers support to vhost_net
...+int vhost_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, unsigned *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + unsigned int out, in; + int seg = 0; + int headcount = 0; + int r; + + while (datalen > 0) { + if (headcount >= VHOST_NET_MAX_SG) { + r = -ENOBUFS; + goto err; + } + heads[headcount].id = vhost_get_desc(vq->dev, vq, vq->iov + seg, + ARRAY_SIZE(vq->iov) - seg, &out, + &in, log, log_num); + if (heads[headcount].id == vq->num) { + r = 0; + goto err; + } + if (out || in <=...
2010 Apr 28
6
[PATCHv7] add mergeable buffers support to vhost_net
...+int vhost_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, unsigned *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + unsigned int out, in; + int seg = 0; + int headcount = 0; + int r; + + while (datalen > 0) { + if (headcount >= VHOST_NET_MAX_SG) { + r = -ENOBUFS; + goto err; + } + heads[headcount].id = vhost_get_desc(vq->dev, vq, vq->iov + seg, + ARRAY_SIZE(vq->iov) - seg, &out, + &in, log, log_num); + if (heads[headcount].id == vq->num) { + r = 0; + goto err; + } + if (out || in <=...
2010 Apr 06
1
[PATCH v3] Add Mergeable receive buffer support to vhost_net
.../ +int vhost_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, int *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + int out, in; + int seg = 0; /* iov index */ + int hc = 0; /* head count */ + + while (datalen > 0) { + if (hc >= VHOST_NET_MAX_SG) + goto err; + heads[hc].id = vhost_get_desc(vq->dev, vq, vq->iov+seg, + ARRAY_SIZE(vq->iov)-seg, &out, + &in, log, log_num); + if (heads[hc].id == vq->num) + goto err; + if (out || in <= 0) { + vq_err(vq, "unexpected descriptor format for RX...
2010 Apr 06
1
[PATCH v3] Add Mergeable receive buffer support to vhost_net
.../ +int vhost_get_desc_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, + int datalen, int *iovcount, struct vhost_log *log, + unsigned int *log_num) +{ + int out, in; + int seg = 0; /* iov index */ + int hc = 0; /* head count */ + + while (datalen > 0) { + if (hc >= VHOST_NET_MAX_SG) + goto err; + heads[hc].id = vhost_get_desc(vq->dev, vq, vq->iov+seg, + ARRAY_SIZE(vq->iov)-seg, &out, + &in, log, log_num); + if (heads[hc].id == vq->num) + goto err; + if (out || in <= 0) { + vq_err(vq, "unexpected descriptor format for RX...