Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196931
b: refs/heads/master
c: 9495c28
h: refs/heads/master
i:
  196929: b340f3d
  196927: 167d7f5
v: v3
  • Loading branch information
Stephen Hemminger authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 87350bc commit da46911
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b852fdcefc782b6751f96a8ea09471efd844b6bf
refs/heads/master: 9495c282baf53ec7bfffcb9dd9f40cb10d4240e0
32 changes: 12 additions & 20 deletions trunk/drivers/staging/hv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ static int netvsc_recv_callback(struct hv_device *device_obj,
struct net_device_context *net_device_ctx;
struct sk_buff *skb;
void *data;
int ret;
int i;
unsigned long flags;

Expand All @@ -308,12 +307,12 @@ static int netvsc_recv_callback(struct hv_device *device_obj,

net_device_ctx = netdev_priv(net);

/* Allocate a skb - TODO preallocate this */
/* Pad 2-bytes to align IP header to 16 bytes */
skb = dev_alloc_skb(packet->TotalDataBufferLength + 2);
ASSERT(skb);
skb_reserve(skb, 2);
skb->dev = net;
/* Allocate a skb - TODO direct I/O to pages? */
skb = netdev_alloc_skb_ip_align(net, packet->TotalDataBufferLength);
if (unlikely(!skb)) {
++net->stats.rx_dropped;
return 0;
}

/* for kmap_atomic */
local_irq_save(flags);
Expand All @@ -338,25 +337,18 @@ static int netvsc_recv_callback(struct hv_device *device_obj,
local_irq_restore(flags);

skb->protocol = eth_type_trans(skb, net);

skb->ip_summed = CHECKSUM_NONE;

net->stats.rx_packets++;
net->stats.rx_bytes += skb->len;

/*
* Pass the skb back up. Network stack will deallocate the skb when it
* is done
* is done.
* TODO - use NAPI?
*/
ret = netif_rx(skb);

switch (ret) {
case NET_RX_DROP:
net->stats.rx_dropped++;
break;
default:
net->stats.rx_packets++;
net->stats.rx_bytes += skb->len;
break;
netif_rx(skb);

}
DPRINT_DBG(NETVSC_DRV, "# of recvs %lu total size %lu",
net->stats.rx_packets, net->stats.rx_bytes);

Expand Down

0 comments on commit da46911

Please sign in to comment.