Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286217
b: refs/heads/master
c: c3b5003
h: refs/heads/master
i:
  286215: 3d7effa
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Jan 18, 2012
1 parent be90cbd commit e5a1378
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 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: 77676fdbd54f0c6fdb71d55d9758bebc69a00fc4
refs/heads/master: c3b5003b628d8e373262bee42c7260d6a799c73e
27 changes: 14 additions & 13 deletions trunk/drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -8846,9 +8846,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl);
udelay(100);

if (tg3_flag(tp, USING_MSIX) && tp->irq_cnt > 1) {
if (tg3_flag(tp, USING_MSIX)) {
val = tr32(MSGINT_MODE);
val |= MSGINT_MODE_MULTIVEC_EN | MSGINT_MODE_ENABLE;
val |= MSGINT_MODE_ENABLE;
if (tp->irq_cnt > 1)
val |= MSGINT_MODE_MULTIVEC_EN;
if (!tg3_flag(tp, 1SHOT_MSI))
val |= MSGINT_MODE_ONE_SHOT_DISABLE;
tw32(MSGINT_MODE, val);
Expand Down Expand Up @@ -9548,19 +9550,18 @@ static int tg3_request_firmware(struct tg3 *tp)

static bool tg3_enable_msix(struct tg3 *tp)
{
int i, rc, cpus = num_online_cpus();
int i, rc;
struct msix_entry msix_ent[tp->irq_max];

if (cpus == 1)
/* Just fallback to the simpler MSI mode. */
return false;

/*
* We want as many rx rings enabled as there are cpus.
* The first MSIX vector only deals with link interrupts, etc,
* so we add one to the number of vectors we are requesting.
*/
tp->irq_cnt = min_t(unsigned, cpus + 1, tp->irq_max);
tp->irq_cnt = num_online_cpus();
if (tp->irq_cnt > 1) {
/* We want as many rx rings enabled as there are cpus.
* In multiqueue MSI-X mode, the first MSI-X vector
* only deals with link interrupts, etc, so we add
* one to the number of vectors we are requesting.
*/
tp->irq_cnt = min_t(unsigned, tp->irq_cnt + 1, tp->irq_max);
}

for (i = 0; i < tp->irq_max; i++) {
msix_ent[i].entry = i;
Expand Down

0 comments on commit e5a1378

Please sign in to comment.