Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ea9b3b0 authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley
Browse files

[SCSI] be2iscsi: Fix the Port Link Status issue



Check the Logical Link status also as part of the port link status.

Signed-off-by: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 7ad4dfe1
Loading
Loading
Loading
Loading
+11 −15
Original line number Diff line number Diff line
@@ -348,30 +348,26 @@ static void be2iscsi_fail_session(struct iscsi_cls_session *cls_session)
void beiscsi_async_link_state_process(struct beiscsi_hba *phba,
		struct be_async_event_link_state *evt)
{
	switch (evt->port_link_status) {
	case ASYNC_EVENT_LINK_DOWN:
	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;

		beiscsi_log(phba, KERN_ERR,
			    BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT,
			    "BC_%d : Link Down on Physical Port %d\n",
			    "BC_%d : Link Down on Port %d\n",
			    evt->physical_port);

		phba->state |= BE_ADAPTER_LINK_DOWN;
		iscsi_host_for_each_session(phba->shost,
					    be2iscsi_fail_session);
		break;
	case ASYNC_EVENT_LINK_UP:
	} 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->state = BE_ADAPTER_UP;

		beiscsi_log(phba, KERN_ERR,
			    BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT,
			    "BC_%d : Link UP on Physical Port %d\n",
			    evt->physical_port);
		break;
	default:
		beiscsi_log(phba, KERN_ERR,
			    BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT,
			    "BC_%d : Unexpected Async Notification %d on"
			    "Physical Port %d\n",
			    evt->port_link_status,
			    "BC_%d : Link UP on Port %d\n",
			    evt->physical_port);
	}
}
+5 −1
Original line number Diff line number Diff line
@@ -122,7 +122,8 @@ struct be_async_event_trailer {

enum {
	ASYNC_EVENT_LINK_DOWN = 0x0,
	ASYNC_EVENT_LINK_UP = 0x1
	ASYNC_EVENT_LINK_UP = 0x1,
	ASYNC_EVENT_LOGICAL = 0x2
};

/**
@@ -134,6 +135,9 @@ struct be_async_event_link_state {
	u8 port_link_status;
	u8 port_duplex;
	u8 port_speed;
#define BEISCSI_PHY_LINK_FAULT_NONE	0x00
#define BEISCSI_PHY_LINK_FAULT_LOCAL	0x01
#define BEISCSI_PHY_LINK_FAULT_REMOTE	0x02
	u8 port_fault;
	u8 rsvd0[7];
	struct be_async_event_trailer trailer;