Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32835
b: refs/heads/master
c: 32d8c57
h: refs/heads/master
i:
  32833: f580ef1
  32831: a910a93
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Jul 25, 2006
1 parent eb074ec commit 125b515
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 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: b9ec6c1b917e2e43a058a78198d54aeca3d71c6f
refs/heads/master: 32d8c5724b7b05c7d8f7386c49432104cc222e32
32 changes: 27 additions & 5 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -4258,7 +4258,7 @@ static void tg3_free_rings(struct tg3 *tp)
* end up in the driver. tp->{tx,}lock are held and thus
* we may not sleep.
*/
static void tg3_init_rings(struct tg3 *tp)
static int tg3_init_rings(struct tg3 *tp)
{
u32 i;

Expand Down Expand Up @@ -4307,18 +4307,38 @@ static void tg3_init_rings(struct tg3 *tp)

/* Now allocate fresh SKBs for each rx ring. */
for (i = 0; i < tp->rx_pending; i++) {
if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_STD,
-1, i) < 0)
if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_STD, -1, i) < 0) {
printk(KERN_WARNING PFX
"%s: Using a smaller RX standard ring, "
"only %d out of %d buffers were allocated "
"successfully.\n",
tp->dev->name, i, tp->rx_pending);
if (i == 0)
return -ENOMEM;
tp->rx_pending = i;
break;
}
}

if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) {
for (i = 0; i < tp->rx_jumbo_pending; i++) {
if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_JUMBO,
-1, i) < 0)
-1, i) < 0) {
printk(KERN_WARNING PFX
"%s: Using a smaller RX jumbo ring, "
"only %d out of %d buffers were "
"allocated successfully.\n",
tp->dev->name, i, tp->rx_jumbo_pending);
if (i == 0) {
tg3_free_rings(tp);
return -ENOMEM;
}
tp->rx_jumbo_pending = i;
break;
}
}
}
return 0;
}

/*
Expand Down Expand Up @@ -5969,7 +5989,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
* can only do this after the hardware has been
* successfully reset.
*/
tg3_init_rings(tp);
err = tg3_init_rings(tp);
if (err)
return err;

/* This value is determined during the probe time DMA
* engine test, tg3_test_dma.
Expand Down

0 comments on commit 125b515

Please sign in to comment.