search for: receive_skb

Displaying 20 results from an estimated 28 matches for "receive_skb".

2007 Jul 24
0
[PATCH] virtio_net.c gso & feature support
...t sk_buff *skb) +{ + sg->page = virt_to_page(skb_vnet_hdr(skb)); + sg->offset = offset_in_page(skb_vnet_hdr(skb)); + sg->length = sizeof(struct virtio_net_hdr); +} + static bool skb_xmit_done(struct virtqueue *vq) { struct virtnet_info *vi = vq->priv; @@ -52,12 +65,14 @@ static void receive_skb(struct net_devic static void receive_skb(struct net_device *dev, struct sk_buff *skb, unsigned len) { - if (unlikely(len < ETH_HLEN)) { + struct virtio_net_hdr *hdr = skb_vnet_hdr(skb); + + if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) { pr_debug("%s: short packe...
2007 Jul 24
0
[PATCH] virtio_net.c gso & feature support
...t sk_buff *skb) +{ + sg->page = virt_to_page(skb_vnet_hdr(skb)); + sg->offset = offset_in_page(skb_vnet_hdr(skb)); + sg->length = sizeof(struct virtio_net_hdr); +} + static bool skb_xmit_done(struct virtqueue *vq) { struct virtnet_info *vi = vq->priv; @@ -52,12 +65,14 @@ static void receive_skb(struct net_devic static void receive_skb(struct net_device *dev, struct sk_buff *skb, unsigned len) { - if (unlikely(len < ETH_HLEN)) { + struct virtio_net_hdr *hdr = skb_vnet_hdr(skb); + + if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) { pr_debug("%s: short packe...
2008 Jun 19
0
[patch 05/15] virtio_net: Fix skb->csum_start computation
...by: Rusty Russell <rusty at rustcorp.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de> --- drivers/net/virtio_net.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -83,9 +83,7 @@ static void receive_skb(struct net_devic BUG_ON(len > MAX_PACKET_LEN); skb_trim(skb, len); - skb->protocol = eth_type_trans(skb, dev); - pr_debug("Receiving skb proto 0x%04x len %i type %i\n", - ntohs(skb->protocol), skb->len, skb->pkt_type); + dev->stats.rx_bytes += skb->len; de...
2008 Jun 16
1
[PATCH] virtio_net: Fix skb->csum_start computation (2.6.24, 2.6.25)
...tcorp.com.au> --- drivers/net/virtio_net.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 50e6e59..503486f 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -86,9 +86,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb, BUG_ON(len > MAX_PACKET_LEN); skb_trim(skb, len); - skb->protocol = eth_type_trans(skb, dev); - pr_debug("Receiving skb proto 0x%04x len %i type %i\n", - ntohs(skb->protocol), skb->len, skb->pkt_type); + dev->stats.r...
2008 Jun 16
1
[PATCH] virtio_net: Fix skb->csum_start computation (2.6.24, 2.6.25)
...tcorp.com.au> --- drivers/net/virtio_net.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 50e6e59..503486f 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -86,9 +86,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb, BUG_ON(len > MAX_PACKET_LEN); skb_trim(skb, len); - skb->protocol = eth_type_trans(skb, dev); - pr_debug("Receiving skb proto 0x%04x len %i type %i\n", - ntohs(skb->protocol), skb->len, skb->pkt_type); + dev->stats.r...
2008 Jan 15
2
[PATCH 1/3] skb_partial_csum_set
...BOL_GPL(skb_to_sgvec); EXPORT_SYMBOL_GPL(skb_cow_data); +EXPORT_SYMBOL_GPL(skb_partial_csum_set); diff -r 72be3d596d31 drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c Wed Jan 09 15:57:40 2008 +1100 +++ b/drivers/net/virtio_net.c Wed Jan 09 16:56:41 2008 +1100 @@ -89,17 +89,8 @@ static void receive_skb(struct net_devic if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { pr_debug("Needs csum!\n"); - skb->ip_summed = CHECKSUM_PARTIAL; - skb->csum_start = hdr->csum_start; - skb->csum_offset = hdr->csum_offset; - if (skb->csum_start > skb->len - 2 -...
2008 Jan 15
2
[PATCH 1/3] skb_partial_csum_set
...BOL_GPL(skb_to_sgvec); EXPORT_SYMBOL_GPL(skb_cow_data); +EXPORT_SYMBOL_GPL(skb_partial_csum_set); diff -r 72be3d596d31 drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c Wed Jan 09 15:57:40 2008 +1100 +++ b/drivers/net/virtio_net.c Wed Jan 09 16:56:41 2008 +1100 @@ -89,17 +89,8 @@ static void receive_skb(struct net_devic if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { pr_debug("Needs csum!\n"); - skb->ip_summed = CHECKSUM_PARTIAL; - skb->csum_start = hdr->csum_start; - skb->csum_offset = hdr->csum_offset; - if (skb->csum_start > skb->len - 2 -...
2008 Jun 08
2
[PATCH 1/4] virtio_net: Fix skb->csum_start computation
...tcorp.com.au> --- drivers/net/virtio_net.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 50e6e59..503486f 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -86,9 +86,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb, BUG_ON(len > MAX_PACKET_LEN); skb_trim(skb, len); - skb->protocol = eth_type_trans(skb, dev); - pr_debug("Receiving skb proto 0x%04x len %i type %i\n", - ntohs(skb->protocol), skb->len, skb->pkt_type); + dev->stats.r...
2008 Jan 23
1
[PATCH 1/3] Cleanup and simplify virtnet header
...virtio_net.c Wed Jan 23 18:46:05 2008 +1100 @@ -26,6 +26,10 @@ static int napi_weight = 128; module_param(napi_weight, int, 0444); + +static int csum = 1, gso = 1; +module_param(csum, int, 0444); +module_param(gso, int, 0444); MODULE_LICENSE("GPL"); @@ -95,12 +99,9 @@ static void receive_skb(struct net_devic if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { pr_debug("GSO!\n"); - switch (hdr->gso_type) { + switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { case VIRTIO_NET_HDR_GSO_TCPV4: skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; - break; - case...
2008 Jan 23
1
[PATCH 1/3] Cleanup and simplify virtnet header
...virtio_net.c Wed Jan 23 18:46:05 2008 +1100 @@ -26,6 +26,10 @@ static int napi_weight = 128; module_param(napi_weight, int, 0444); + +static int csum = 1, gso = 1; +module_param(csum, int, 0444); +module_param(gso, int, 0444); MODULE_LICENSE("GPL"); @@ -95,12 +99,9 @@ static void receive_skb(struct net_devic if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { pr_debug("GSO!\n"); - switch (hdr->gso_type) { + switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { case VIRTIO_NET_HDR_GSO_TCPV4: skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; - break; - case...
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
This attempts to implement a "virtual I/O" layer which should allow common drivers to be efficiently used across most virtual I/O mechanisms. It will no-doubt need further enhancement. The details of probing the device are left to hypervisor-specific code: it simple constructs the "struct virtio_device" and hands it to the probe function (eg. virtnet_probe() or
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
This attempts to implement a "virtual I/O" layer which should allow common drivers to be efficiently used across most virtual I/O mechanisms. It will no-doubt need further enhancement. The details of probing the device are left to hypervisor-specific code: it simple constructs the "struct virtio_device" and hands it to the probe function (eg. virtnet_probe() or
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
This attempts to implement a "virtual I/O" layer which should allow common drivers to be efficiently used across most virtual I/O mechanisms. It will no-doubt need further enhancement. The details of probing the device are left to hypervisor-specific code: it simple constructs the "struct virtio_device" and hands it to the probe function (eg. virtnet_probe() or
2009 May 29
2
[PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.
...tput buffers. */ netif_wake_queue(vi->dev); - /* Make sure we re-xmit last_xmit_skb: if there are no more packets - * queued, start_xmit won't be called. */ - tasklet_schedule(&vi->tasklet); + if (vi->free_in_tasklet) + tasklet_schedule(&vi->tasklet); } static void receive_skb(struct net_device *dev, struct sk_buff *skb, @@ -509,12 +505,7 @@ static void xmit_tasklet(unsigned long d struct virtnet_info *vi = (void *)data; netif_tx_lock_bh(vi->dev); - if (vi->last_xmit_skb && xmit_skb(vi, vi->last_xmit_skb) == 0) { - vi->svq->vq_ops->kick(v...
2009 May 29
2
[PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.
...tput buffers. */ netif_wake_queue(vi->dev); - /* Make sure we re-xmit last_xmit_skb: if there are no more packets - * queued, start_xmit won't be called. */ - tasklet_schedule(&vi->tasklet); + if (vi->free_in_tasklet) + tasklet_schedule(&vi->tasklet); } static void receive_skb(struct net_device *dev, struct sk_buff *skb, @@ -509,12 +505,7 @@ static void xmit_tasklet(unsigned long d struct virtnet_info *vi = (void *)data; netif_tx_lock_bh(vi->dev); - if (vi->last_xmit_skb && xmit_skb(vi, vi->last_xmit_skb) == 0) { - vi->svq->vq_ops->kick(v...
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 May 29
1
[PATCH 3/4] virtio_net: don't free buffers in xmit ring
...big packets and I cannot lie! */ bool big_packets; @@ -112,9 +105,6 @@ static void skb_xmit_done(struct virtque /* We were probably waiting for more output buffers. */ netif_wake_queue(vi->dev); - - if (vi->free_in_tasklet) - tasklet_schedule(&vi->tasklet); } static void receive_skb(struct net_device *dev, struct sk_buff *skb, @@ -428,25 +418,9 @@ static void free_old_xmit_skbs(struct vi } } -/* If the virtio transport doesn't always notify us when all in-flight packets - * are consumed, we fall back to using this function on a timer to free them. */ -static void xmit...
2009 May 29
1
[PATCH 3/4] virtio_net: don't free buffers in xmit ring
...big packets and I cannot lie! */ bool big_packets; @@ -112,9 +105,6 @@ static void skb_xmit_done(struct virtque /* We were probably waiting for more output buffers. */ netif_wake_queue(vi->dev); - - if (vi->free_in_tasklet) - tasklet_schedule(&vi->tasklet); } static void receive_skb(struct net_device *dev, struct sk_buff *skb, @@ -428,25 +418,9 @@ static void free_old_xmit_skbs(struct vi } } -/* If the virtio transport doesn't always notify us when all in-flight packets - * are consumed, we fall back to using this function on a timer to free them. */ -static void xmit...
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
Hi again all, It turns out that networking really wants ordered requests, which the previous patches didn't allow. This patch changes it to a callback mechanism; kudos to Avi. The downside is that locking is more complicated, and after a few dead ends I implemented the simplest solution: the struct virtio_device contains the spinlock to use, and it's held when your callbacks get