search for: rq_get_buf

Displaying 4 results from an estimated 4 matches for "rq_get_buf".

2013 Nov 20
1
[PATCH net 2/3] virtio-net: fix num calculation on frag skb allocation failure
...ink we need to apply this. diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 11d9cc9..1cc2e43 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -296,6 +296,14 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, return skb; } +static void *rq_get_buf(struct receive_queue *rq, unsigned int *len) +{ + void *buf = virtqueue_get_buf(rq->vq, len); + if (buf) + rq->num--; + return buf; +} + static struct sk_buff *receive_mergeable(struct net_device *dev, struct receive_queue *rq, void *buf, @@ -315,7 +323,7 @@ static struct sk_b...
2013 Nov 20
1
[PATCH net 2/3] virtio-net: fix num calculation on frag skb allocation failure
...ink we need to apply this. diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 11d9cc9..1cc2e43 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -296,6 +296,14 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, return skb; } +static void *rq_get_buf(struct receive_queue *rq, unsigned int *len) +{ + void *buf = virtqueue_get_buf(rq->vq, len); + if (buf) + rq->num--; + return buf; +} + static struct sk_buff *receive_mergeable(struct net_device *dev, struct receive_queue *rq, void *buf, @@ -315,7 +323,7 @@ static struct sk_b...
2013 Nov 20
2
[PATCH net 2/3] virtio-net: fix num calculation on frag skb allocation failure
On Wed, Nov 20, 2013 at 05:07:26PM +0800, Jason Wang wrote: > We need decrease the rq->num after we can get a buf through > virtqueue_get_buf() even if we could not allocate frag skb. Otherwise, the > refill routine won't be triggered under heavy memory stress since the driver may > still think there's enough room. > > This bug was introduced by commit
2013 Nov 20
2
[PATCH net 2/3] virtio-net: fix num calculation on frag skb allocation failure
On Wed, Nov 20, 2013 at 05:07:26PM +0800, Jason Wang wrote: > We need decrease the rq->num after we can get a buf through > virtqueue_get_buf() even if we could not allocate frag skb. Otherwise, the > refill routine won't be triggered under heavy memory stress since the driver may > still think there's enough room. > > This bug was introduced by commit