search for: xmit_skb

Displaying 20 results from an estimated 268 matches for "xmit_skb".

2009 Sep 21
0
[PATCH 2/6] virtio: make add_buf return capacity remaining
...73,7 @@ static bool try_fill_recv(struct virtnet skb_queue_head(&vi->recv, skb); err = vi->rvq->vq_ops->add_buf(vi->rvq, sg, 0, 1, skb); - if (err) { + if (err < 0) { skb_unlink(skb, &vi->recv); kfree_skb(skb); break; @@ -527,7 +527,7 @@ static int xmit_skb(struct virtnet_info num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); - if (!err && !vi->free_in_tasklet) + if (err >= 0 && !vi->free_in_tasklet) mod_timer(&vi->xmit_free_timer, jiffies...
2009 Sep 21
0
[PATCH 2/6] virtio: make add_buf return capacity remaining
...73,7 @@ static bool try_fill_recv(struct virtnet skb_queue_head(&vi->recv, skb); err = vi->rvq->vq_ops->add_buf(vi->rvq, sg, 0, 1, skb); - if (err) { + if (err < 0) { skb_unlink(skb, &vi->recv); kfree_skb(skb); break; @@ -527,7 +527,7 @@ static int xmit_skb(struct virtnet_info num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); - if (!err && !vi->free_in_tasklet) + if (err >= 0 && !vi->free_in_tasklet) mod_timer(&vi->xmit_free_timer, jiffies...
2008 May 26
7
[PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug
If we fail to transmit a packet, we assume the queue is full and put the skb into last_xmit_skb. However, if more space frees up before we xmit it, we loop, and the result can be transmitting the same skb twice. Fix is simple: set skb to NULL if we've used it in some way, and check before sending. Signed-off-by: Rusty Russell <rusty at rustcorp.com.au> --- drivers/net/virtio_net...
2008 May 26
7
[PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug
If we fail to transmit a packet, we assume the queue is full and put the skb into last_xmit_skb. However, if more space frees up before we xmit it, we loop, and the result can be transmitting the same skb twice. Fix is simple: set skb to NULL if we've used it in some way, and check before sending. Signed-off-by: Rusty Russell <rusty at rustcorp.com.au> --- drivers/net/virtio_net...
2009 May 29
2
[PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.
...--git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -47,9 +47,6 @@ struct virtnet_info struct napi_struct napi; unsigned int status; - /* The skb we couldn't send because buffers were full. */ - struct sk_buff *last_xmit_skb; - /* If we need to free in a timer, this is it. */ struct timer_list xmit_free_timer; @@ -116,9 +113,8 @@ static void skb_xmit_done(struct virtque /* We were probably waiting for more output buffers. */ netif_wake_queue(vi->dev); - /* Make sure we re-xmit last_xmit_skb: if there are...
2009 May 29
2
[PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.
...--git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -47,9 +47,6 @@ struct virtnet_info struct napi_struct napi; unsigned int status; - /* The skb we couldn't send because buffers were full. */ - struct sk_buff *last_xmit_skb; - /* If we need to free in a timer, this is it. */ struct timer_list xmit_free_timer; @@ -116,9 +113,8 @@ static void skb_xmit_done(struct virtque /* We were probably waiting for more output buffers. */ netif_wake_queue(vi->dev); - /* Make sure we re-xmit last_xmit_skb: if there are...
2014 Dec 19
1
[PATCH RFC v4 net-next 1/5] virtio_net: enable tx interrupt
...++++++++++++++++++++++++++---------------- > 1 file changed, 88 insertions(+), 44 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index ec2a8b4..f68114e 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) > { > struct skb_vnet_hdr *hdr; > @@ -912,7 +951,9 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) > sg_set_buf(sq->sg, hdr, hdr_len); > num_sg = skb_to_sgvec(skb, sq->sg + 1, 0, skb->len) + 1; >...
2014 Dec 19
1
[PATCH RFC v4 net-next 1/5] virtio_net: enable tx interrupt
...++++++++++++++++++++++++++---------------- > 1 file changed, 88 insertions(+), 44 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index ec2a8b4..f68114e 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) > { > struct skb_vnet_hdr *hdr; > @@ -912,7 +951,9 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) > sg_set_buf(sq->sg, hdr, hdr_len); > num_sg = skb_to_sgvec(skb, sq->sg + 1, 0, skb->len) + 1; >...
2011 Jun 02
6
[PATCHv2 RFC 0/4] virtio and vhost-net capacity handling
OK, here's a new attempt to use the new capacity api. I also added more comments to clarify the logic. Hope this is more readable. Let me know pls. This is on top of the patches applied by Rusty. Warning: untested. Posting now to give people chance to comment on the API. Changes from v1: - fix comment in patch 2 to correct confusion noted by Rusty - rewrite patch 3 along the lines
2011 Jun 02
6
[PATCHv2 RFC 0/4] virtio and vhost-net capacity handling
OK, here's a new attempt to use the new capacity api. I also added more comments to clarify the logic. Hope this is more readable. Let me know pls. This is on top of the patches applied by Rusty. Warning: untested. Posting now to give people chance to comment on the API. Changes from v1: - fix comment in patch 2 to correct confusion noted by Rusty - rewrite patch 3 along the lines
2014 Oct 14
0
[PATCH net-next RFC 3/3] virtio-net: conditionally enable tx interrupt
...ex */ > char name[40]; > + > + struct napi_struct napi; > }; > > /* Internal representation of a receive virtqueue */ > @@ -217,15 +219,40 @@ static struct page *get_a_page(struct receive_queue *rq, gfp_t gfp_mask) > return p; > } > > +static int free_old_xmit_skbs(struct send_queue *sq, int budget) > +{ > + struct sk_buff *skb; > + unsigned int len; > + struct virtnet_info *vi = sq->vq->vdev->priv; > + struct virtnet_stats *stats = this_cpu_ptr(vi->stats); > + int sent = 0; > + > + while (sent < budget && >...
2008 Jul 15
0
[PATCH 2/5] virtio: fix virtio_net xmit of freed skb bug
...t Content-Disposition: inline Message-Id: <200807151340.00446.rusty at rustcorp.com.au> From: Mark McLoughlin <markmc at redhat.com> On Mon, 2008-05-26 at 17:42 +1000, Rusty Russell wrote: > If we fail to transmit a packet, we assume the queue is full and put > the skb into last_xmit_skb. However, if more space frees up before we > xmit it, we loop, and the result can be transmitting the same skb twice. > > Fix is simple: set skb to NULL if we've used it in some way, and check > before sending. ... > diff -r 564237b31993 drivers/net/virtio_net.c > --- a/driv...
2008 Jul 15
0
[PATCH 2/5] virtio: fix virtio_net xmit of freed skb bug
...t Content-Disposition: inline Message-Id: <200807151340.00446.rusty at rustcorp.com.au> From: Mark McLoughlin <markmc at redhat.com> On Mon, 2008-05-26 at 17:42 +1000, Rusty Russell wrote: > If we fail to transmit a packet, we assume the queue is full and put > the skb into last_xmit_skb. However, if more space frees up before we > xmit it, we loop, and the result can be transmitting the same skb twice. > > Fix is simple: set skb to NULL if we've used it in some way, and check > before sending. ... > diff -r 564237b31993 drivers/net/virtio_net.c > --- a/driv...
2014 Oct 14
4
[PATCH RFC] virtio_net: enable tx interrupt
...send_queue { /* Name of the send queue: output.$index */ char name[40]; + + struct napi_struct napi; }; /* Internal representation of a receive virtqueue */ @@ -211,15 +213,38 @@ static struct page *get_a_page(struct receive_queue *rq, gfp_t gfp_mask) return p; } +static int free_old_xmit_skbs(struct send_queue *sq, int budget) +{ + struct sk_buff *skb; + unsigned int len; + struct virtnet_info *vi = sq->vq->vdev->priv; + struct virtnet_stats *stats = this_cpu_ptr(vi->stats); + int sent = 0; + + while (sent < budget && + (skb = virtqueue_get_buf(sq->vq,...
2014 Oct 14
4
[PATCH RFC] virtio_net: enable tx interrupt
...send_queue { /* Name of the send queue: output.$index */ char name[40]; + + struct napi_struct napi; }; /* Internal representation of a receive virtqueue */ @@ -211,15 +213,38 @@ static struct page *get_a_page(struct receive_queue *rq, gfp_t gfp_mask) return p; } +static int free_old_xmit_skbs(struct send_queue *sq, int budget) +{ + struct sk_buff *skb; + unsigned int len; + struct virtnet_info *vi = sq->vq->vdev->priv; + struct virtnet_stats *stats = this_cpu_ptr(vi->stats); + int sent = 0; + + while (sent < budget && + (skb = virtqueue_get_buf(sq->vq,...
2008 Apr 18
0
virtio: wean net driver off NETDEV_TX_BUSY
...Apr 17 05:03:18 2008 +1000 +++ b/drivers/net/virtio_net.c Thu Apr 17 06:15:40 2008 +1000 @@ -40,6 +40,9 @@ struct virtnet_info struct virtqueue *rvq, *svq; struct net_device *dev; struct napi_struct napi; + + /* The skb we couldn't send because buffers were full. */ + struct sk_buff *last_xmit_skb; /* Number of input buffers, and max we've ever had. */ unsigned int num, max; @@ -227,10 +230,9 @@ static void free_old_xmit_skbs(struct vi } } -static int start_xmit(struct sk_buff *skb, struct net_device *dev) +static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) { -...
2008 Apr 18
0
virtio: wean net driver off NETDEV_TX_BUSY
...Apr 17 05:03:18 2008 +1000 +++ b/drivers/net/virtio_net.c Thu Apr 17 06:15:40 2008 +1000 @@ -40,6 +40,9 @@ struct virtnet_info struct virtqueue *rvq, *svq; struct net_device *dev; struct napi_struct napi; + + /* The skb we couldn't send because buffers were full. */ + struct sk_buff *last_xmit_skb; /* Number of input buffers, and max we've ever had. */ unsigned int num, max; @@ -227,10 +230,9 @@ static void free_old_xmit_skbs(struct vi } } -static int start_xmit(struct sk_buff *skb, struct net_device *dev) +static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) { -...
2011 Jun 01
5
[PATCH RFC 0/3] virtio and vhost-net capacity handling
OK, here's a new attempt to use the new capacity api. I also added more comments to clarify the logic. Hope this is more readable. Let me know pls. This is on top of the patches applied by Rusty. Note: there are now actually 2 calls to fee_old_xmit_skbs on data path so instead of passing flag '2' to the second one I thought we can just make each call free up at least 1 skb. This will work and even might be a bit faster (less branches), but in the end I discarded this idea as too fragile (relies on two calls on data path to function proper...
2011 Jun 01
5
[PATCH RFC 0/3] virtio and vhost-net capacity handling
OK, here's a new attempt to use the new capacity api. I also added more comments to clarify the logic. Hope this is more readable. Let me know pls. This is on top of the patches applied by Rusty. Note: there are now actually 2 calls to fee_old_xmit_skbs on data path so instead of passing flag '2' to the second one I thought we can just make each call free up at least 1 skb. This will work and even might be a bit faster (less branches), but in the end I discarded this idea as too fragile (relies on two calls on data path to function proper...
2019 Jul 10
2
[RFC] virtio-net: share receive_*() and add_recvbuf_*() with virtio-vsock
...skb*vs, ...); int virtskb_add_recvbuf_big(struct virtskb *vs, ...); int virtskb_add_recvbuf_mergeable(struct virtskb *vs, ...); For the Guest->Host path it should be easier, so maybe I can add a "virtskb_send(struct virtskb *vs, struct sk_buff *skb)" with a part of the code of xmit_skb(). Let me know if you have in mind better names or if I should put these function in another place. I would like to leave the control part completely separate, so, for example, the two drivers will negotiate the features independently and they will call the right virtskb_receive_*() function base...