Commit e37d2c47 authored by Eddie Wai's avatar Eddie Wai Committed by James Bottomley

[SCSI] bnx2i: Fine tuned conn destroy and context destroy timeout values

Added variables to separate the fine tuned timeout values for
connection destroy and context destroy for both 1g and 10g devices.

v2: Extended the 5771X disconnect timeout from 10s to 20s as the firmware
has a retransmission timeout of 16s.  This fixes one of the iscsi_endpoint
leak issues when the target is slow or non-responsive to our TCP FIN.
Signed-off-by: default avatarEddie Wai <eddie.wai@broadcom.com>
Reviewed-by: default avatarMichael Chan <mchan@broadcom.com>
Reviewed-by: default avatarBenjamin Li <benli@broadcom.com>
Acked-by: default avatarAnil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 55e15c97
...@@ -308,6 +308,8 @@ struct iscsi_cid_queue { ...@@ -308,6 +308,8 @@ struct iscsi_cid_queue {
* @dummy_buf_dma: DMA address of 'dummy_buffer' memory buffer * @dummy_buf_dma: DMA address of 'dummy_buffer' memory buffer
* @lock: lock to synchonize access to hba structure * @lock: lock to synchonize access to hba structure
* @hba_shutdown_tmo: Timeout value to shutdown each connection * @hba_shutdown_tmo: Timeout value to shutdown each connection
* @conn_teardown_tmo: Timeout value to tear down each connection
* @conn_ctx_destroy_tmo: Timeout value to destroy context of each connection
* @pci_did: PCI device ID * @pci_did: PCI device ID
* @pci_vid: PCI vendor ID * @pci_vid: PCI vendor ID
* @pci_sdid: PCI subsystem device ID * @pci_sdid: PCI subsystem device ID
...@@ -387,6 +389,8 @@ struct bnx2i_hba { ...@@ -387,6 +389,8 @@ struct bnx2i_hba {
struct mutex net_dev_lock;/* sync net device access */ struct mutex net_dev_lock;/* sync net device access */
int hba_shutdown_tmo; int hba_shutdown_tmo;
int conn_teardown_tmo;
int conn_ctx_destroy_tmo;
/* /*
* PCI related info. * PCI related info.
*/ */
......
...@@ -854,10 +854,15 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic) ...@@ -854,10 +854,15 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic)
spin_lock_init(&hba->lock); spin_lock_init(&hba->lock);
mutex_init(&hba->net_dev_lock); mutex_init(&hba->net_dev_lock);
init_waitqueue_head(&hba->eh_wait); init_waitqueue_head(&hba->eh_wait);
if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) {
hba->hba_shutdown_tmo = 20 * HZ; hba->hba_shutdown_tmo = 20 * HZ;
else /* 5706/5708/5709 */ hba->conn_teardown_tmo = 20 * HZ;
hba->conn_ctx_destroy_tmo = 6 * HZ;
} else { /* 5706/5708/5709 */
hba->hba_shutdown_tmo = 20 * HZ; hba->hba_shutdown_tmo = 20 * HZ;
hba->conn_teardown_tmo = 10 * HZ;
hba->conn_ctx_destroy_tmo = 2 * HZ;
}
if (iscsi_host_add(shost, &hba->pcidev->dev)) if (iscsi_host_add(shost, &hba->pcidev->dev))
goto free_dump_mem; goto free_dump_mem;
...@@ -1633,7 +1638,7 @@ static int bnx2i_tear_down_conn(struct bnx2i_hba *hba, ...@@ -1633,7 +1638,7 @@ static int bnx2i_tear_down_conn(struct bnx2i_hba *hba,
ep->state = EP_STATE_CLEANUP_START; ep->state = EP_STATE_CLEANUP_START;
init_timer(&ep->ofld_timer); init_timer(&ep->ofld_timer);
ep->ofld_timer.expires = 10*HZ + jiffies; ep->ofld_timer.expires = hba->conn_ctx_destroy_tmo + jiffies;
ep->ofld_timer.function = bnx2i_ep_ofld_timer; ep->ofld_timer.function = bnx2i_ep_ofld_timer;
ep->ofld_timer.data = (unsigned long) ep; ep->ofld_timer.data = (unsigned long) ep;
add_timer(&ep->ofld_timer); add_timer(&ep->ofld_timer);
...@@ -1937,7 +1942,7 @@ int bnx2i_hw_ep_disconnect(struct bnx2i_endpoint *bnx2i_ep) ...@@ -1937,7 +1942,7 @@ int bnx2i_hw_ep_disconnect(struct bnx2i_endpoint *bnx2i_ep)
bnx2i_ep->state = EP_STATE_DISCONN_START; bnx2i_ep->state = EP_STATE_DISCONN_START;
init_timer(&bnx2i_ep->ofld_timer); init_timer(&bnx2i_ep->ofld_timer);
bnx2i_ep->ofld_timer.expires = 10*HZ + jiffies; bnx2i_ep->ofld_timer.expires = hba->conn_teardown_tmo + jiffies;
bnx2i_ep->ofld_timer.function = bnx2i_ep_ofld_timer; bnx2i_ep->ofld_timer.function = bnx2i_ep_ofld_timer;
bnx2i_ep->ofld_timer.data = (unsigned long) bnx2i_ep; bnx2i_ep->ofld_timer.data = (unsigned long) bnx2i_ep;
add_timer(&bnx2i_ep->ofld_timer); add_timer(&bnx2i_ep->ofld_timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment