Displaying 20 results from an estimated 55 matches for "__skb_queue_head".
2009 Oct 25
1
[PATCH] virtio-net: fix data corruption with OOM
...o_net.c b/drivers/net/virtio_net.c
index 8d00976..be459e1 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -517,8 +517,7 @@ again:
/* Free up any pending old buffers before queueing new ones. */
free_old_xmit_skbs(vi);
- /* Put new one in send queue and do transmit */
- __skb_queue_head(&vi->send, skb);
+ /* Try to transmit */
capacity = xmit_skb(vi, skb);
/* This can happen with OOM and indirect buffers. */
@@ -532,8 +531,11 @@ again:
}
return NETDEV_TX_BUSY;
}
-
vi->svq->vq_ops->kick(vi->svq);
+
+ /* Put new one in send queue */
+ __skb_queue_h...
2009 Oct 25
1
[PATCH] virtio-net: fix data corruption with OOM
...o_net.c b/drivers/net/virtio_net.c
index 8d00976..be459e1 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -517,8 +517,7 @@ again:
/* Free up any pending old buffers before queueing new ones. */
free_old_xmit_skbs(vi);
- /* Put new one in send queue and do transmit */
- __skb_queue_head(&vi->send, skb);
+ /* Try to transmit */
capacity = xmit_skb(vi, skb);
/* This can happen with OOM and indirect buffers. */
@@ -532,8 +531,11 @@ again:
}
return NETDEV_TX_BUSY;
}
-
vi->svq->vq_ops->kick(vi->svq);
+
+ /* Put new one in send queue */
+ __skb_queue_h...
2009 May 29
2
[PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.
...d buffers before queueing new ones. */
free_old_xmit_skbs(vi);
- /* If we has a buffer left over from last time, send it now. */
- if (unlikely(vi->last_xmit_skb) &&
- xmit_skb(vi, vi->last_xmit_skb) != 0)
- goto stop_queue;
+ /* Put new one in send queue and do transmit */
+ __skb_queue_head(&vi->send, skb);
+ if (likely(xmit_skb(vi, skb) == 0)) {
+ vi->svq->vq_ops->kick(vi->svq);
+ return NETDEV_TX_OK;
+ }
- vi->last_xmit_skb = NULL;
-
- /* Put new one in send queue and do transmit */
- if (likely(skb)) {
- __skb_queue_head(&vi->send, skb);
- if (xmi...
2009 May 29
2
[PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.
...d buffers before queueing new ones. */
free_old_xmit_skbs(vi);
- /* If we has a buffer left over from last time, send it now. */
- if (unlikely(vi->last_xmit_skb) &&
- xmit_skb(vi, vi->last_xmit_skb) != 0)
- goto stop_queue;
+ /* Put new one in send queue and do transmit */
+ __skb_queue_head(&vi->send, skb);
+ if (likely(xmit_skb(vi, skb) == 0)) {
+ vi->svq->vq_ops->kick(vi->svq);
+ return NETDEV_TX_OK;
+ }
- vi->last_xmit_skb = NULL;
-
- /* Put new one in send queue and do transmit */
- if (likely(skb)) {
- __skb_queue_head(&vi->send, skb);
- if (xmi...
2008 Apr 18
0
virtio: wean net driver off NETDEV_TX_BUSY
...bug("%s: xmit %p %s\n", vi->dev->name, skb, print_mac(mac, dest));
/* Encode metadata header at front. */
hdr = skb_vnet_hdr(skb);
@@ -271,30 +273,47 @@ static int start_xmit(struct sk_buff *sk
vnet_hdr_to_sg(sg, skb);
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
- __skb_queue_head(&vi->send, skb);
+
+ return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+}
+
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
again:
/* Free up any pending old buffers before queueing new ones. */...
2008 Apr 18
0
virtio: wean net driver off NETDEV_TX_BUSY
...bug("%s: xmit %p %s\n", vi->dev->name, skb, print_mac(mac, dest));
/* Encode metadata header at front. */
hdr = skb_vnet_hdr(skb);
@@ -271,30 +273,47 @@ static int start_xmit(struct sk_buff *sk
vnet_hdr_to_sg(sg, skb);
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
- __skb_queue_head(&vi->send, skb);
+
+ return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+}
+
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
again:
/* Free up any pending old buffers before queueing new ones. */...
2008 Apr 28
3
[PATCH 1/4] virtio: wean net driver off NETDEV_TX_BUSY
...,
+ pr_debug("%s: xmit %p " MAC_FMT "\n", vi->dev->name, skb,
dest[0], dest[1], dest[2],
dest[3], dest[4], dest[5]);
@@ -272,30 +274,50 @@ static int start_xmit(struct sk_buff *sk
vnet_hdr_to_sg(sg, skb);
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
- __skb_queue_head(&vi->send, skb);
+
+ return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+}
+
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
again:
/* Free up any pending old buffers before queueing new ones. */...
2008 Apr 28
3
[PATCH 1/4] virtio: wean net driver off NETDEV_TX_BUSY
...,
+ pr_debug("%s: xmit %p " MAC_FMT "\n", vi->dev->name, skb,
dest[0], dest[1], dest[2],
dest[3], dest[4], dest[5]);
@@ -272,30 +274,50 @@ static int start_xmit(struct sk_buff *sk
vnet_hdr_to_sg(sg, skb);
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
- __skb_queue_head(&vi->send, skb);
+
+ return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+}
+
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
again:
/* Free up any pending old buffers before queueing new ones. */...
2008 May 26
7
[PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug
...t_xmit_skb)) {
if (xmit_skb(vi, vi->last_xmit_skb) != 0) {
/* Drop this skb: we only queue one. */
vi->dev->stats.tx_dropped++;
kfree_skb(skb);
+ skb = NULL;
goto stop_queue;
}
vi->last_xmit_skb = NULL;
}
/* Put new one in send queue and do transmit */
- __skb_queue_head(&vi->send, skb);
- if (xmit_skb(vi, skb) != 0) {
- vi->last_xmit_skb = skb;
- goto stop_queue;
+ if (likely(skb)) {
+ __skb_queue_head(&vi->send, skb);
+ if (xmit_skb(vi, skb) != 0) {
+ vi->last_xmit_skb = skb;
+ skb = NULL;
+ goto stop_queue;
+ }
}
done:
vi->...
2008 May 26
7
[PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug
...t_xmit_skb)) {
if (xmit_skb(vi, vi->last_xmit_skb) != 0) {
/* Drop this skb: we only queue one. */
vi->dev->stats.tx_dropped++;
kfree_skb(skb);
+ skb = NULL;
goto stop_queue;
}
vi->last_xmit_skb = NULL;
}
/* Put new one in send queue and do transmit */
- __skb_queue_head(&vi->send, skb);
- if (xmit_skb(vi, skb) != 0) {
- vi->last_xmit_skb = skb;
- goto stop_queue;
+ if (likely(skb)) {
+ __skb_queue_head(&vi->send, skb);
+ if (xmit_skb(vi, skb) != 0) {
+ vi->last_xmit_skb = skb;
+ skb = NULL;
+ goto stop_queue;
+ }
}
done:
vi->...
2023 Mar 06
0
[RFC PATCH v2 1/4] virtio/vsock: fix 'rx_bytes'/'fwd_cnt' calculation
...skb_pull(skb, bytes);
if (skb->len == 0) {
- virtio_transport_dec_rx_pkt(vvs, skb);
+ virtio_transport_dec_rx_pkt(vvs, bytes);
consume_skb(skb);
} else {
__skb_queue_head(&vvs->rx_queue, skb);
@@ -437,17 +434,17 @@ static int virtio_transport_seqpacket_do_dequeue(struct vsock_sock *vsk,
while (!msg_ready) {
struct virtio_vsock_hdr *hdr;
+ size_t pkt_len;
skb = __skb_dequeue(&vvs->rx_queue);...
2002 Jun 08
2
New qdisc path, try it (what is the problem)
hello,
this is my new qdisc patch, when i recompile the
kernel with this patch i dn''nt succeed please look at
it and if there are any mistakes plesease send me a
mail
thanks in advance
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
2007 Nov 18
3
[PATCH 1/2] virtio: fix net driver loop case where we fail to restart
skb is only NULL the first time around: it's more correct to test for
being under-budget.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff -r 2a94425ac7d5 drivers/net/virtio_net.c
--- a/drivers/net/virtio_net.c Thu Nov 15 13:47:28 2007 +1100
+++ b/drivers/net/virtio_net.c Thu Nov 15 23:10:44 2007 +1100
@@ -198,8 +198,8 @@ again:
if (vi->num < vi->max / 2)
2007 Nov 18
3
[PATCH 1/2] virtio: fix net driver loop case where we fail to restart
skb is only NULL the first time around: it's more correct to test for
being under-budget.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff -r 2a94425ac7d5 drivers/net/virtio_net.c
--- a/drivers/net/virtio_net.c Thu Nov 15 13:47:28 2007 +1100
+++ b/drivers/net/virtio_net.c Thu Nov 15 23:10:44 2007 +1100
@@ -198,8 +198,8 @@ again:
if (vi->num < vi->max / 2)
2009 Sep 21
0
[PATCH 2/6] virtio: make add_buf return capacity remaining
.../
if (unlikely(vi->last_xmit_skb) &&
- xmit_skb(vi, vi->last_xmit_skb) != 0)
+ xmit_skb(vi, vi->last_xmit_skb) < 0)
goto stop_queue;
vi->last_xmit_skb = NULL;
@@ -565,7 +565,7 @@ again:
/* Put new one in send queue and do transmit */
if (likely(skb)) {
__skb_queue_head(&vi->send, skb);
- if (xmit_skb(vi, skb) != 0) {
+ if (xmit_skb(vi, skb) < 0) {
vi->last_xmit_skb = skb;
skb = NULL;
goto stop_queue;
@@ -668,7 +668,7 @@ static bool virtnet_send_command(struct
sg_set_buf(&sg[i + 1], sg_virt(s), s->length);
sg_set_buf(&sg...
2009 Sep 21
0
[PATCH 2/6] virtio: make add_buf return capacity remaining
.../
if (unlikely(vi->last_xmit_skb) &&
- xmit_skb(vi, vi->last_xmit_skb) != 0)
+ xmit_skb(vi, vi->last_xmit_skb) < 0)
goto stop_queue;
vi->last_xmit_skb = NULL;
@@ -565,7 +565,7 @@ again:
/* Put new one in send queue and do transmit */
if (likely(skb)) {
__skb_queue_head(&vi->send, skb);
- if (xmit_skb(vi, skb) != 0) {
+ if (xmit_skb(vi, skb) < 0) {
vi->last_xmit_skb = skb;
skb = NULL;
goto stop_queue;
@@ -668,7 +668,7 @@ static bool virtnet_send_command(struct
sg_set_buf(&sg[i + 1], sg_virt(s), s->length);
sg_set_buf(&sg...
2007 Jul 24
0
[PATCH] virtio_net.c gso & feature support
...GSO_TCPV6;
+ else if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP)
+ hdr->gso_type = VIRTIO_NET_GSO_UDP;
+ else
+ BUG();
+ } else {
+ hdr->gso_type = VIRTIO_NET_GSO_NONE;
+ hdr->gso_size = 0;
+ }
+
+ vnet_hdr_to_sg(sg, skb);
+ num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
__skb_queue_head(&vi->send, skb);
err = vi->vq_send->ops->add_buf(vi->vq_send, sg, num, 0, skb);
if (err) {
@@ -220,7 +328,8 @@ struct net_device *virtnet_probe(struct
struct net_device *virtnet_probe(struct virtqueue *vq_recv,
struct virtqueue *vq_send,
struct device *device,
-...
2007 Jul 24
0
[PATCH] virtio_net.c gso & feature support
...GSO_TCPV6;
+ else if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP)
+ hdr->gso_type = VIRTIO_NET_GSO_UDP;
+ else
+ BUG();
+ } else {
+ hdr->gso_type = VIRTIO_NET_GSO_NONE;
+ hdr->gso_size = 0;
+ }
+
+ vnet_hdr_to_sg(sg, skb);
+ num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
__skb_queue_head(&vi->send, skb);
err = vi->vq_send->ops->add_buf(vi->vq_send, sg, num, 0, skb);
if (err) {
@@ -220,7 +328,8 @@ struct net_device *virtnet_probe(struct
struct net_device *virtnet_probe(struct virtqueue *vq_recv,
struct virtqueue *vq_send,
struct device *device,
-...
2009 Aug 18
2
[PATCH 1/2] virtio: Add a can_add_buf helper
This helper returns 1 if a call to add_buf will not fail
with -ENOSPC.
This will help callers that do
while(1) {
alloc()
if (add_buf()) {
free();
break;
}
}
This will result in one less alloc/free exercise.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
---
drivers/virtio/virtio_ring.c | 8 ++++++++
include/linux/virtio.h | 5 +++++
2 files changed, 13
2009 Aug 18
2
[PATCH 1/2] virtio: Add a can_add_buf helper
This helper returns 1 if a call to add_buf will not fail
with -ENOSPC.
This will help callers that do
while(1) {
alloc()
if (add_buf()) {
free();
break;
}
}
This will result in one less alloc/free exercise.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
---
drivers/virtio/virtio_ring.c | 8 ++++++++
include/linux/virtio.h | 5 +++++
2 files changed, 13