Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315471
b: refs/heads/master
c: 6ecd09d
h: refs/heads/master
i:
  315469: bb9e99e
  315467: b69d08d
  315463: fa9538b
  315455: 34addd7
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jul 18, 2012
1 parent 20adbb2 commit 2991543
Show file tree
Hide file tree
Showing 3 changed files with 15 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: db8dacf953a70274172236957a4b97d4fdb376f0
refs/heads/master: 6ecd09dd35fd07b8f2f6f5210ecffd4cc5ac0581
9 changes: 7 additions & 2 deletions trunk/drivers/net/ethernet/faraday/ftgmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,14 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed)
rxdes = ftgmac100_current_rxdes(priv);
} while (!done);

if (skb->len <= 64)
/* Small frames are copied into linear part of skb to free one page */
if (skb->len <= 128) {
skb->truesize -= PAGE_SIZE;
__pskb_pull_tail(skb, min(skb->len, 64U));
__pskb_pull_tail(skb, skb->len);
} else {
/* We pull the minimum amount into linear part */
__pskb_pull_tail(skb, ETH_HLEN);
}
skb->protocol = eth_type_trans(skb, netdev);

netdev->stats.rx_packets++;
Expand Down
11 changes: 7 additions & 4 deletions trunk/drivers/net/ethernet/faraday/ftmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,14 @@ static bool ftmac100_rx_packet(struct ftmac100 *priv, int *processed)
skb->len += length;
skb->data_len += length;

/* page might be freed in __pskb_pull_tail() */
if (length > 64)
if (length > 128) {
skb->truesize += PAGE_SIZE;
__pskb_pull_tail(skb, min(length, 64));

/* We pull the minimum amount into linear part */
__pskb_pull_tail(skb, ETH_HLEN);
} else {
/* Small frames are copied into linear part to free one page */
__pskb_pull_tail(skb, length);
}
ftmac100_alloc_rx_page(priv, rxdes, GFP_ATOMIC);

ftmac100_rx_pointer_advance(priv);
Expand Down

0 comments on commit 2991543

Please sign in to comment.