Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78969
b: refs/heads/master
c: 5f06eba
h: refs/heads/master
i:
  78967: 7cd2df6
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jan 28, 2008
1 parent 27860b3 commit 8f26cf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 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: f03b865491c2f30f2a4d77cdafc69c978ceb38a0
refs/heads/master: 5f06eba4dce361bfc077868d044768476b41d698
28 changes: 9 additions & 19 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ static int sky2_rx_start(struct sky2_port *sky2)
struct sky2_hw *hw = sky2->hw;
struct rx_ring_info *re;
unsigned rxq = rxqaddr[sky2->port];
unsigned i, size, space, thresh;
unsigned i, size, thresh;

sky2->rx_put = sky2->rx_next = 0;
sky2_qset(hw, rxq);
Expand All @@ -1261,28 +1261,18 @@ static int sky2_rx_start(struct sky2_port *sky2)
/* Stopping point for hardware truncation */
thresh = (size - 8) / sizeof(u32);

/* Account for overhead of skb - to avoid order > 0 allocation */
space = SKB_DATA_ALIGN(size) + NET_SKB_PAD
+ sizeof(struct skb_shared_info);

sky2->rx_nfrags = space >> PAGE_SHIFT;
sky2->rx_nfrags = size >> PAGE_SHIFT;
BUG_ON(sky2->rx_nfrags > ARRAY_SIZE(re->frag_addr));

if (sky2->rx_nfrags != 0) {
/* Compute residue after pages */
space = sky2->rx_nfrags << PAGE_SHIFT;
/* Compute residue after pages */
size -= sky2->rx_nfrags << PAGE_SHIFT;

if (space < size)
size -= space;
else
size = 0;
/* Optimize to handle small packets and headers */
if (size < copybreak)
size = copybreak;
if (size < ETH_HLEN)
size = ETH_HLEN;

/* Optimize to handle small packets and headers */
if (size < copybreak)
size = copybreak;
if (size < ETH_HLEN)
size = ETH_HLEN;
}
sky2->rx_data_size = size;

/* Fill Rx ring */
Expand Down

0 comments on commit 8f26cf3

Please sign in to comment.