Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119749
b: refs/heads/master
c: efba018
h: refs/heads/master
i:
  119747: 4077a79
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Dec 3, 2008
1 parent 5e512db commit fd883d1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 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: d5654efd3ff1cd0baa935a0c9a5d89862f07d009
refs/heads/master: efba01803c8570bab11d0d6188a630231d0ddccf
35 changes: 32 additions & 3 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3144,6 +3144,28 @@ bnx2_has_work(struct bnx2_napi *bnapi)
return 0;
}

static void
bnx2_chk_missed_msi(struct bnx2 *bp)
{
struct bnx2_napi *bnapi = &bp->bnx2_napi[0];
u32 msi_ctrl;

if (bnx2_has_work(bnapi)) {
msi_ctrl = REG_RD(bp, BNX2_PCICFG_MSI_CONTROL);
if (!(msi_ctrl & BNX2_PCICFG_MSI_CONTROL_ENABLE))
return;

if (bnapi->last_status_idx == bp->idle_chk_status_idx) {
REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl &
~BNX2_PCICFG_MSI_CONTROL_ENABLE);
REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl);
bnx2_msi(bp->irq_tbl[0].vector, bnapi);
}
}

bp->idle_chk_status_idx = bnapi->last_status_idx;
}

static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi)
{
struct status_block *sblk = bnapi->status_blk.msi;
Expand Down Expand Up @@ -3218,14 +3240,15 @@ static int bnx2_poll(struct napi_struct *napi, int budget)

work_done = bnx2_poll_work(bp, bnapi, work_done, budget);

if (unlikely(work_done >= budget))
break;

/* bnapi->last_status_idx is used below to tell the hw how
* much work has been processed, so we must read it before
* checking for more work.
*/
bnapi->last_status_idx = sblk->status_idx;

if (unlikely(work_done >= budget))
break;

rmb();
if (likely(!bnx2_has_work(bnapi))) {
netif_rx_complete(bp->dev, napi);
Expand Down Expand Up @@ -4570,6 +4593,8 @@ bnx2_init_chip(struct bnx2 *bp)
for (i = 0; i < BNX2_MAX_MSIX_VEC; i++)
bp->bnx2_napi[i].last_status_idx = 0;

bp->idle_chk_status_idx = 0xffff;

bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE;

/* Set up how to generate a link change interrupt. */
Expand Down Expand Up @@ -5718,6 +5743,10 @@ bnx2_timer(unsigned long data)
if (atomic_read(&bp->intr_sem) != 0)
goto bnx2_restart_timer;

if ((bp->flags & (BNX2_FLAG_USING_MSI | BNX2_FLAG_ONE_SHOT_MSI)) ==
BNX2_FLAG_USING_MSI)
bnx2_chk_missed_msi(bp);

bnx2_send_heart_beat(bp);

bp->stats_blk->stat_FwRxDrop =
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ struct l2_fhdr {
* pci_config_l definition
* offset: 0000
*/
#define BNX2_PCICFG_MSI_CONTROL 0x00000058
#define BNX2_PCICFG_MSI_CONTROL_ENABLE (1L<<16)

#define BNX2_PCICFG_MISC_CONFIG 0x00000068
#define BNX2_PCICFG_MISC_CONFIG_TARGET_BYTE_SWAP (1L<<2)
#define BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP (1L<<3)
Expand Down Expand Up @@ -6863,6 +6866,9 @@ struct bnx2 {

u8 num_tx_rings;
u8 num_rx_rings;

u32 idle_chk_status_idx;

};

#define REG_RD(bp, offset) \
Expand Down

0 comments on commit fd883d1

Please sign in to comment.