Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214306
b: refs/heads/master
c: 8d86c61
h: refs/heads/master
v: v3
  • Loading branch information
Santiago Leon authored and David S. Miller committed Sep 7, 2010
1 parent 4c3f4a9 commit d737fad
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 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: c08cc3ccebd46dce44d13a8ce81d249e687eeb8a
refs/heads/master: 8d86c61ae41d9068fd5e5cc01a4abd53c4fe3ab5
29 changes: 23 additions & 6 deletions trunk/drivers/net/ibmveth.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ module_param(tx_copybreak, uint, 0644);
MODULE_PARM_DESC(tx_copybreak,
"Maximum size of packet that is copied to a new buffer on transmit");

static unsigned int rx_copybreak __read_mostly = 128;
module_param(rx_copybreak, uint, 0644);
MODULE_PARM_DESC(rx_copybreak,
"Maximum size of packet that is copied to a new buffer on receive");

struct ibmveth_stat {
char name[ETH_GSTRING_LEN];
int offset;
Expand Down Expand Up @@ -1002,8 +1007,6 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)

restart_poll:
do {
struct sk_buff *skb;

if (!ibmveth_rxq_pending_buffer(adapter))
break;

Expand All @@ -1014,20 +1017,34 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
ibmveth_debug_printk("recycling invalid buffer\n");
ibmveth_rxq_recycle_buffer(adapter);
} else {
struct sk_buff *skb, *new_skb;
int length = ibmveth_rxq_frame_length(adapter);
int offset = ibmveth_rxq_frame_offset(adapter);
int csum_good = ibmveth_rxq_csum_good(adapter);

skb = ibmveth_rxq_get_buffer(adapter);
if (csum_good)
skb->ip_summed = CHECKSUM_UNNECESSARY;

ibmveth_rxq_harvest_buffer(adapter);
new_skb = NULL;
if (length < rx_copybreak)
new_skb = netdev_alloc_skb(netdev, length);

if (new_skb) {
skb_copy_to_linear_data(new_skb,
skb->data + offset,
length);
skb = new_skb;
ibmveth_rxq_recycle_buffer(adapter);
} else {
ibmveth_rxq_harvest_buffer(adapter);
skb_reserve(skb, offset);
}

skb_reserve(skb, offset);
skb_put(skb, length);
skb->protocol = eth_type_trans(skb, netdev);

if (csum_good)
skb->ip_summed = CHECKSUM_UNNECESSARY;

netif_receive_skb(skb); /* send it up */

netdev->stats.rx_packets++;
Expand Down

0 comments on commit d737fad

Please sign in to comment.