From 9c4f8b01731c4ccf369a34f40f5eb384548af46a Mon Sep 17 00:00:00 2001 From: Jitendra Bhivare Date: Wed, 20 Jan 2016 14:10:59 +0530 Subject: be2iscsi: Fix async link event processing Use only port_link_status only to determine link state change. Only bit 0 is used to get the state. Remove code for processing port_fault. Fixed get_nic_conf structure definition. Removed rsvd[23] field in be_cmd_get_nic_conf_resp. Moved definitions of struct field values below the field. Signed-off-by: Jitendra Bhivare Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen --- drivers/scsi/be2iscsi/be_cmds.c | 48 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'drivers/scsi/be2iscsi/be_cmds.c') diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c index ce82f4d68745..34c33d422ec4 100644 --- a/drivers/scsi/be2iscsi/be_cmds.c +++ b/drivers/scsi/be2iscsi/be_cmds.c @@ -405,32 +405,31 @@ void beiscsi_fail_session(struct iscsi_cls_session *cls_session) iscsi_session_failure(cls_session->dd_data, ISCSI_ERR_CONN_FAILED); } -static void beiscsi_async_link_state_process(struct beiscsi_hba *phba, - struct be_async_event_link_state *evt) +static void beiscsi_process_async_link(struct beiscsi_hba *phba, + struct be_mcc_compl *compl) { - phba->port_speed = evt->port_speed; - if ((evt->port_link_status == ASYNC_EVENT_LINK_DOWN) || - ((evt->port_link_status & ASYNC_EVENT_LOGICAL) && - (evt->port_fault != BEISCSI_PHY_LINK_FAULT_NONE))) { - phba->state = BE_ADAPTER_LINK_DOWN; + struct be_async_event_link_state *evt; - beiscsi_log(phba, KERN_ERR, - BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, - "BC_%d : Link Down on Port %d\n", - evt->physical_port); + evt = (struct be_async_event_link_state *)compl; - iscsi_host_for_each_session(phba->shost, - beiscsi_fail_session); - } else if ((evt->port_link_status & ASYNC_EVENT_LINK_UP) || - ((evt->port_link_status & ASYNC_EVENT_LOGICAL) && - (evt->port_fault == BEISCSI_PHY_LINK_FAULT_NONE))) { + phba->port_speed = evt->port_speed; + /** + * Check logical link status in ASYNC event. + * This has been newly introduced in SKH-R Firmware 10.0.338.45. + **/ + if (evt->port_link_status & BE_ASYNC_LINK_UP_MASK) { phba->state = BE_ADAPTER_LINK_UP | BE_ADAPTER_CHECK_BOOT; phba->get_boot = BE_GET_BOOT_RETRIES; - - beiscsi_log(phba, KERN_ERR, - BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, - "BC_%d : Link UP on Port %d\n", - evt->physical_port); + __beiscsi_log(phba, KERN_ERR, + "BC_%d : Link Up on Port %d tag 0x%x\n", + evt->physical_port, evt->event_tag); + } else { + phba->state = BE_ADAPTER_LINK_DOWN; + __beiscsi_log(phba, KERN_ERR, + "BC_%d : Link Down on Port %d tag 0x%x\n", + evt->physical_port, evt->event_tag); + iscsi_host_for_each_session(phba->shost, + beiscsi_fail_session); } } @@ -507,8 +506,7 @@ void beiscsi_process_async_event(struct beiscsi_hba *phba, evt_code &= ASYNC_TRAILER_EVENT_CODE_MASK; switch (evt_code) { case ASYNC_EVENT_CODE_LINK_STATE: - beiscsi_async_link_state_process(phba, - (struct be_async_event_link_state *)compl); + beiscsi_process_async_link(phba, compl); break; case ASYNC_EVENT_CODE_ISCSI: phba->state |= BE_ADAPTER_CHECK_BOOT; @@ -524,8 +522,8 @@ void beiscsi_process_async_event(struct beiscsi_hba *phba, } beiscsi_log(phba, sev, BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, - "BC_%d : ASYNC Event: status 0x%08x flags 0x%08x\n", - compl->status, compl->flags); + "BC_%d : ASYNC Event %x: status 0x%08x flags 0x%08x\n", + evt_code, compl->status, compl->flags); } int beiscsi_process_mcc(struct beiscsi_hba *phba) -- cgit v1.2.3-59-g8ed1b