diff options
author | David S. Miller <davem@davemloft.net> | 2008-12-06 01:54:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-06 01:54:40 -0500 |
commit | 730c30ec646bd252a9448a66ecd51d794853513f (patch) | |
tree | c0d413860f9d8bf37374f17cfabb4911143465d7 /drivers/net/bnx2.c | |
parent | 726e07a8a38168266ac95d87736f9501a2d9e7b2 (diff) | |
parent | 0a0755c9fe47dc9f8271935909c66096e43efbfe (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-sta.c
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 182f2410c23d..0e2218dadb3d 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -3147,6 +3147,28 @@ bnx2_has_work(struct bnx2_napi *bnapi) | |||
3147 | return 0; | 3147 | return 0; |
3148 | } | 3148 | } |
3149 | 3149 | ||
3150 | static void | ||
3151 | bnx2_chk_missed_msi(struct bnx2 *bp) | ||
3152 | { | ||
3153 | struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; | ||
3154 | u32 msi_ctrl; | ||
3155 | |||
3156 | if (bnx2_has_work(bnapi)) { | ||
3157 | msi_ctrl = REG_RD(bp, BNX2_PCICFG_MSI_CONTROL); | ||
3158 | if (!(msi_ctrl & BNX2_PCICFG_MSI_CONTROL_ENABLE)) | ||
3159 | return; | ||
3160 | |||
3161 | if (bnapi->last_status_idx == bp->idle_chk_status_idx) { | ||
3162 | REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl & | ||
3163 | ~BNX2_PCICFG_MSI_CONTROL_ENABLE); | ||
3164 | REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl); | ||
3165 | bnx2_msi(bp->irq_tbl[0].vector, bnapi); | ||
3166 | } | ||
3167 | } | ||
3168 | |||
3169 | bp->idle_chk_status_idx = bnapi->last_status_idx; | ||
3170 | } | ||
3171 | |||
3150 | static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi) | 3172 | static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi) |
3151 | { | 3173 | { |
3152 | struct status_block *sblk = bnapi->status_blk.msi; | 3174 | struct status_block *sblk = bnapi->status_blk.msi; |
@@ -3221,14 +3243,15 @@ static int bnx2_poll(struct napi_struct *napi, int budget) | |||
3221 | 3243 | ||
3222 | work_done = bnx2_poll_work(bp, bnapi, work_done, budget); | 3244 | work_done = bnx2_poll_work(bp, bnapi, work_done, budget); |
3223 | 3245 | ||
3224 | if (unlikely(work_done >= budget)) | ||
3225 | break; | ||
3226 | |||
3227 | /* bnapi->last_status_idx is used below to tell the hw how | 3246 | /* bnapi->last_status_idx is used below to tell the hw how |
3228 | * much work has been processed, so we must read it before | 3247 | * much work has been processed, so we must read it before |
3229 | * checking for more work. | 3248 | * checking for more work. |
3230 | */ | 3249 | */ |
3231 | bnapi->last_status_idx = sblk->status_idx; | 3250 | bnapi->last_status_idx = sblk->status_idx; |
3251 | |||
3252 | if (unlikely(work_done >= budget)) | ||
3253 | break; | ||
3254 | |||
3232 | rmb(); | 3255 | rmb(); |
3233 | if (likely(!bnx2_has_work(bnapi))) { | 3256 | if (likely(!bnx2_has_work(bnapi))) { |
3234 | netif_rx_complete(bp->dev, napi); | 3257 | netif_rx_complete(bp->dev, napi); |
@@ -4581,6 +4604,8 @@ bnx2_init_chip(struct bnx2 *bp) | |||
4581 | for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) | 4604 | for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) |
4582 | bp->bnx2_napi[i].last_status_idx = 0; | 4605 | bp->bnx2_napi[i].last_status_idx = 0; |
4583 | 4606 | ||
4607 | bp->idle_chk_status_idx = 0xffff; | ||
4608 | |||
4584 | bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE; | 4609 | bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE; |
4585 | 4610 | ||
4586 | /* Set up how to generate a link change interrupt. */ | 4611 | /* Set up how to generate a link change interrupt. */ |
@@ -5729,6 +5754,10 @@ bnx2_timer(unsigned long data) | |||
5729 | if (atomic_read(&bp->intr_sem) != 0) | 5754 | if (atomic_read(&bp->intr_sem) != 0) |
5730 | goto bnx2_restart_timer; | 5755 | goto bnx2_restart_timer; |
5731 | 5756 | ||
5757 | if ((bp->flags & (BNX2_FLAG_USING_MSI | BNX2_FLAG_ONE_SHOT_MSI)) == | ||
5758 | BNX2_FLAG_USING_MSI) | ||
5759 | bnx2_chk_missed_msi(bp); | ||
5760 | |||
5732 | bnx2_send_heart_beat(bp); | 5761 | bnx2_send_heart_beat(bp); |
5733 | 5762 | ||
5734 | bp->stats_blk->stat_FwRxDrop = | 5763 | bp->stats_blk->stat_FwRxDrop = |