diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2010-05-04 18:01:26 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-05-16 18:21:47 -0400 |
commit | 5ff1d58410ffb160b388d622ef0c6a0411a05559 (patch) | |
tree | a8d95de2c47bf3b0beaae6730b61b3d84c2bde56 /drivers/scsi/qla2xxx/qla_os.c | |
parent | 99b0bec7bbf3350d1a920a7138fa62c456a8ecf1 (diff) |
[SCSI] qla2xxx: Limit mailbox command contention for ADISC requests.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 10c14af2235b..2e083c0d9215 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -2639,9 +2639,19 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, | |||
2639 | 2639 | ||
2640 | INIT_LIST_HEAD(&ha->gbl_dsd_list); | 2640 | INIT_LIST_HEAD(&ha->gbl_dsd_list); |
2641 | 2641 | ||
2642 | /* Get consistent memory allocated for Async Port-Database. */ | ||
2643 | if (!IS_FWI2_CAPABLE(ha)) { | ||
2644 | ha->async_pd = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, | ||
2645 | &ha->async_pd_dma); | ||
2646 | if (!ha->async_pd) | ||
2647 | goto fail_async_pd; | ||
2648 | } | ||
2649 | |||
2642 | INIT_LIST_HEAD(&ha->vp_list); | 2650 | INIT_LIST_HEAD(&ha->vp_list); |
2643 | return 1; | 2651 | return 1; |
2644 | 2652 | ||
2653 | fail_async_pd: | ||
2654 | dma_pool_free(ha->s_dma_pool, ha->ex_init_cb, ha->ex_init_cb_dma); | ||
2645 | fail_ex_init_cb: | 2655 | fail_ex_init_cb: |
2646 | kfree(ha->npiv_info); | 2656 | kfree(ha->npiv_info); |
2647 | fail_npiv_info: | 2657 | fail_npiv_info: |
@@ -2757,6 +2767,9 @@ qla2x00_mem_free(struct qla_hw_data *ha) | |||
2757 | dma_pool_free(ha->s_dma_pool, | 2767 | dma_pool_free(ha->s_dma_pool, |
2758 | ha->ex_init_cb, ha->ex_init_cb_dma); | 2768 | ha->ex_init_cb, ha->ex_init_cb_dma); |
2759 | 2769 | ||
2770 | if (ha->async_pd) | ||
2771 | dma_pool_free(ha->s_dma_pool, ha->async_pd, ha->async_pd_dma); | ||
2772 | |||
2760 | if (ha->s_dma_pool) | 2773 | if (ha->s_dma_pool) |
2761 | dma_pool_destroy(ha->s_dma_pool); | 2774 | dma_pool_destroy(ha->s_dma_pool); |
2762 | 2775 | ||
@@ -2809,6 +2822,8 @@ qla2x00_mem_free(struct qla_hw_data *ha) | |||
2809 | ha->init_cb_dma = 0; | 2822 | ha->init_cb_dma = 0; |
2810 | ha->ex_init_cb = NULL; | 2823 | ha->ex_init_cb = NULL; |
2811 | ha->ex_init_cb_dma = 0; | 2824 | ha->ex_init_cb_dma = 0; |
2825 | ha->async_pd = NULL; | ||
2826 | ha->async_pd_dma = 0; | ||
2812 | 2827 | ||
2813 | ha->s_dma_pool = NULL; | 2828 | ha->s_dma_pool = NULL; |
2814 | ha->dl_dma_pool = NULL; | 2829 | ha->dl_dma_pool = NULL; |
@@ -2935,6 +2950,8 @@ qla2x00_post_async_work(login, QLA_EVT_ASYNC_LOGIN); | |||
2935 | qla2x00_post_async_work(login_done, QLA_EVT_ASYNC_LOGIN_DONE); | 2950 | qla2x00_post_async_work(login_done, QLA_EVT_ASYNC_LOGIN_DONE); |
2936 | qla2x00_post_async_work(logout, QLA_EVT_ASYNC_LOGOUT); | 2951 | qla2x00_post_async_work(logout, QLA_EVT_ASYNC_LOGOUT); |
2937 | qla2x00_post_async_work(logout_done, QLA_EVT_ASYNC_LOGOUT_DONE); | 2952 | qla2x00_post_async_work(logout_done, QLA_EVT_ASYNC_LOGOUT_DONE); |
2953 | qla2x00_post_async_work(adisc, QLA_EVT_ASYNC_ADISC); | ||
2954 | qla2x00_post_async_work(adisc_done, QLA_EVT_ASYNC_ADISC_DONE); | ||
2938 | 2955 | ||
2939 | int | 2956 | int |
2940 | qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code) | 2957 | qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code) |
@@ -3004,6 +3021,14 @@ qla2x00_do_work(struct scsi_qla_host *vha) | |||
3004 | qla2x00_async_logout_done(vha, e->u.logio.fcport, | 3021 | qla2x00_async_logout_done(vha, e->u.logio.fcport, |
3005 | e->u.logio.data); | 3022 | e->u.logio.data); |
3006 | break; | 3023 | break; |
3024 | case QLA_EVT_ASYNC_ADISC: | ||
3025 | qla2x00_async_adisc(vha, e->u.logio.fcport, | ||
3026 | e->u.logio.data); | ||
3027 | break; | ||
3028 | case QLA_EVT_ASYNC_ADISC_DONE: | ||
3029 | qla2x00_async_adisc_done(vha, e->u.logio.fcport, | ||
3030 | e->u.logio.data); | ||
3031 | break; | ||
3007 | case QLA_EVT_UEVENT: | 3032 | case QLA_EVT_UEVENT: |
3008 | qla2x00_uevent_emit(vha, e->u.uevent.code); | 3033 | qla2x00_uevent_emit(vha, e->u.uevent.code); |
3009 | break; | 3034 | break; |
@@ -3029,9 +3054,8 @@ void qla2x00_relogin(struct scsi_qla_host *vha) | |||
3029 | * If the port is not ONLINE then try to login | 3054 | * If the port is not ONLINE then try to login |
3030 | * to it if we haven't run out of retries. | 3055 | * to it if we haven't run out of retries. |
3031 | */ | 3056 | */ |
3032 | if (atomic_read(&fcport->state) != | 3057 | if (atomic_read(&fcport->state) != FCS_ONLINE && |
3033 | FCS_ONLINE && fcport->login_retry) { | 3058 | fcport->login_retry && !(fcport->flags & FCF_ASYNC_SENT)) { |
3034 | |||
3035 | fcport->login_retry--; | 3059 | fcport->login_retry--; |
3036 | if (fcport->flags & FCF_FABRIC_DEVICE) { | 3060 | if (fcport->flags & FCF_FABRIC_DEVICE) { |
3037 | if (fcport->flags & FCF_FCP2_DEVICE) | 3061 | if (fcport->flags & FCF_FCP2_DEVICE) |
@@ -3042,6 +3066,7 @@ void qla2x00_relogin(struct scsi_qla_host *vha) | |||
3042 | fcport->d_id.b.al_pa); | 3066 | fcport->d_id.b.al_pa); |
3043 | 3067 | ||
3044 | if (IS_ALOGIO_CAPABLE(ha)) { | 3068 | if (IS_ALOGIO_CAPABLE(ha)) { |
3069 | fcport->flags |= FCF_ASYNC_SENT; | ||
3045 | data[0] = 0; | 3070 | data[0] = 0; |
3046 | data[1] = QLA_LOGIO_LOGIN_RETRIED; | 3071 | data[1] = QLA_LOGIO_LOGIN_RETRIED; |
3047 | status = qla2x00_post_async_login_work( | 3072 | status = qla2x00_post_async_login_work( |