Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204024
b: refs/heads/master
c: 8e86acd
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Kirsher authored and David S. Miller committed Aug 3, 2010
1 parent 16c3bc4 commit 388ba5a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 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: c128ec29208d410568469bd8bb373b4cdc10912a
refs/heads/master: 8e86acd7d5968e08b3e1604e685a8c45f6fd7f40
1 change: 1 addition & 0 deletions trunk/drivers/net/e1000e/e1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ struct e1000_adapter {
u32 test_icr;

u32 msg_enable;
unsigned int num_vectors;
struct msix_entry *msix_entries;
int int_mode;
u32 eiac_mask;
Expand Down
26 changes: 18 additions & 8 deletions trunk/drivers/net/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1785,25 +1785,25 @@ void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter)
void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
{
int err;
int numvecs, i;

int i;

switch (adapter->int_mode) {
case E1000E_INT_MODE_MSIX:
if (adapter->flags & FLAG_HAS_MSIX) {
numvecs = 3; /* RxQ0, TxQ0 and other */
adapter->msix_entries = kcalloc(numvecs,
adapter->num_vectors = 3; /* RxQ0, TxQ0 and other */
adapter->msix_entries = kcalloc(adapter->num_vectors,
sizeof(struct msix_entry),
GFP_KERNEL);
if (adapter->msix_entries) {
for (i = 0; i < numvecs; i++)
for (i = 0; i < adapter->num_vectors; i++)
adapter->msix_entries[i].entry = i;

err = pci_enable_msix(adapter->pdev,
adapter->msix_entries,
numvecs);
if (err == 0)
adapter->num_vectors);
if (err == 0) {
return;
}
}
/* MSI-X failed, so fall through and try MSI */
e_err("Failed to initialize MSI-X interrupts. "
Expand All @@ -1825,6 +1825,9 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
/* Don't do anything; this is the system default */
break;
}

/* store the number of vectors being used */
adapter->num_vectors = 1;
}

/**
Expand Down Expand Up @@ -1946,7 +1949,14 @@ static void e1000_irq_disable(struct e1000_adapter *adapter)
if (adapter->msix_entries)
ew32(EIAC_82574, 0);
e1e_flush();
synchronize_irq(adapter->pdev->irq);

if (adapter->msix_entries) {
int i;
for (i = 0; i < adapter->num_vectors; i++)
synchronize_irq(adapter->msix_entries[i].vector);
} else {
synchronize_irq(adapter->pdev->irq);
}
}

/**
Expand Down

0 comments on commit 388ba5a

Please sign in to comment.