summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2013-04-17 20:18:29 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 16:05:26 -0400
commit711ea882a0ce853521cc444ce07c167992c44d0f (patch)
treef301d36e5d1f3eb755fde29efebe708462d9093a
parenta62a435adaa0137ca2a53bc2b57f99ffe0324bcb (diff)
[SCSI] lpfc 8.3.39: Fixed bad book keeping in posting els sgls to port
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index c37e70439448..b78244a30f29 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -6000,7 +6000,7 @@ lpfc_sli4_repost_els_sgl_list(struct lpfc_hba *phba)
6000 struct lpfc_sglq *sglq_entry = NULL; 6000 struct lpfc_sglq *sglq_entry = NULL;
6001 struct lpfc_sglq *sglq_entry_next = NULL; 6001 struct lpfc_sglq *sglq_entry_next = NULL;
6002 struct lpfc_sglq *sglq_entry_first = NULL; 6002 struct lpfc_sglq *sglq_entry_first = NULL;
6003 int status, post_cnt = 0, num_posted = 0, block_cnt = 0; 6003 int status, total_cnt, post_cnt = 0, num_posted = 0, block_cnt = 0;
6004 int last_xritag = NO_XRI; 6004 int last_xritag = NO_XRI;
6005 LIST_HEAD(prep_sgl_list); 6005 LIST_HEAD(prep_sgl_list);
6006 LIST_HEAD(blck_sgl_list); 6006 LIST_HEAD(blck_sgl_list);
@@ -6012,6 +6012,7 @@ lpfc_sli4_repost_els_sgl_list(struct lpfc_hba *phba)
6012 list_splice_init(&phba->sli4_hba.lpfc_sgl_list, &allc_sgl_list); 6012 list_splice_init(&phba->sli4_hba.lpfc_sgl_list, &allc_sgl_list);
6013 spin_unlock_irq(&phba->hbalock); 6013 spin_unlock_irq(&phba->hbalock);
6014 6014
6015 total_cnt = phba->sli4_hba.els_xri_cnt;
6015 list_for_each_entry_safe(sglq_entry, sglq_entry_next, 6016 list_for_each_entry_safe(sglq_entry, sglq_entry_next,
6016 &allc_sgl_list, list) { 6017 &allc_sgl_list, list) {
6017 list_del_init(&sglq_entry->list); 6018 list_del_init(&sglq_entry->list);
@@ -6063,9 +6064,7 @@ lpfc_sli4_repost_els_sgl_list(struct lpfc_hba *phba)
6063 sglq_entry->sli4_xritag); 6064 sglq_entry->sli4_xritag);
6064 list_add_tail(&sglq_entry->list, 6065 list_add_tail(&sglq_entry->list,
6065 &free_sgl_list); 6066 &free_sgl_list);
6066 spin_lock_irq(&phba->hbalock); 6067 total_cnt--;
6067 phba->sli4_hba.els_xri_cnt--;
6068 spin_unlock_irq(&phba->hbalock);
6069 } 6068 }
6070 } 6069 }
6071 } 6070 }
@@ -6093,9 +6092,7 @@ lpfc_sli4_repost_els_sgl_list(struct lpfc_hba *phba)
6093 (sglq_entry_first->sli4_xritag + 6092 (sglq_entry_first->sli4_xritag +
6094 post_cnt - 1)); 6093 post_cnt - 1));
6095 list_splice_init(&blck_sgl_list, &free_sgl_list); 6094 list_splice_init(&blck_sgl_list, &free_sgl_list);
6096 spin_lock_irq(&phba->hbalock); 6095 total_cnt -= post_cnt;
6097 phba->sli4_hba.els_xri_cnt -= post_cnt;
6098 spin_unlock_irq(&phba->hbalock);
6099 } 6096 }
6100 6097
6101 /* don't reset xirtag due to hole in xri block */ 6098 /* don't reset xirtag due to hole in xri block */
@@ -6105,6 +6102,8 @@ lpfc_sli4_repost_els_sgl_list(struct lpfc_hba *phba)
6105 /* reset els sgl post count for next round of posting */ 6102 /* reset els sgl post count for next round of posting */
6106 post_cnt = 0; 6103 post_cnt = 0;
6107 } 6104 }
6105 /* update the number of XRIs posted for ELS */
6106 phba->sli4_hba.els_xri_cnt = total_cnt;
6108 6107
6109 /* free the els sgls failed to post */ 6108 /* free the els sgls failed to post */
6110 lpfc_free_sgl_list(phba, &free_sgl_list); 6109 lpfc_free_sgl_list(phba, &free_sgl_list);