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

Commit a8adb832 authored by James Smart's avatar James Smart Committed by James Bottomley
Browse files

[SCSI] lpfc 8.2.3 : Miscellaneous Small Fixes - part 2



Miscellaneous Small Fixes - part 2

- Fix ndlp left in PLOGI state after link up
- Fix cannot rcv unsol ELS frames after running HBA resets for a few minutes
- Fix HBQ buffer_count implemention
- Fix RPI leak
- Fix crash while deleting vports while HBA is reset
- Revert the FCP Fbits offset back to 7
- Fix panic when deleting vports
- Remove unused code in switch statement outside of a case
- Reject PLOGI from invalid PName or NName of 0
- Ignore PLOGI responses from WWPName or WWNName of 0
- Fix debugfs hbqinfo display for ppc
- Added 8G to list of supported speeds for sysfs parameter
- Defer ndlp cleanup to dev-loss timeout handler
- Added support for WRITE_VPARMS mailbox command by applications

Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 87af33fe
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -367,6 +367,7 @@ struct lpfc_vport {


struct hbq_s {
struct hbq_s {
	uint16_t entry_count;	  /* Current number of HBQ slots */
	uint16_t entry_count;	  /* Current number of HBQ slots */
	uint16_t buffer_count;	  /* Current number of buffers posted */
	uint32_t next_hbqPutIdx;  /* Index to next HBQ slot to use */
	uint32_t next_hbqPutIdx;  /* Index to next HBQ slot to use */
	uint32_t hbqPutIdx;	  /* HBQ slot to use */
	uint32_t hbqPutIdx;	  /* HBQ slot to use */
	uint32_t local_hbqGetIdx; /* Local copy of Get index from Port */
	uint32_t local_hbqGetIdx; /* Local copy of Get index from Port */
+3 −5
Original line number Original line Diff line number Diff line
@@ -187,12 +187,9 @@ lpfc_state_show(struct class_device *cdev, char *buf)
	case LPFC_LINK_UP:
	case LPFC_LINK_UP:
	case LPFC_CLEAR_LA:
	case LPFC_CLEAR_LA:
	case LPFC_HBA_READY:
	case LPFC_HBA_READY:
		len += snprintf(buf + len, PAGE_SIZE-len, "Link Up - \n");
		len += snprintf(buf + len, PAGE_SIZE-len, "Link Up - ");


		switch (vport->port_state) {
		switch (vport->port_state) {
			len += snprintf(buf + len, PAGE_SIZE-len,
					"initializing\n");
			break;
		case LPFC_LOCAL_CFG_LINK:
		case LPFC_LOCAL_CFG_LINK:
			len += snprintf(buf + len, PAGE_SIZE-len,
			len += snprintf(buf + len, PAGE_SIZE-len,
					"Configuring Link\n");
					"Configuring Link\n");
@@ -1759,7 +1756,6 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,


		switch (phba->sysfs_mbox.mbox->mb.mbxCommand) {
		switch (phba->sysfs_mbox.mbox->mb.mbxCommand) {
			/* Offline only */
			/* Offline only */
		case MBX_WRITE_NV:
		case MBX_INIT_LINK:
		case MBX_INIT_LINK:
		case MBX_DOWN_LINK:
		case MBX_DOWN_LINK:
		case MBX_CONFIG_LINK:
		case MBX_CONFIG_LINK:
@@ -1782,6 +1778,8 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
				spin_unlock_irq(&phba->hbalock);
				spin_unlock_irq(&phba->hbalock);
				return -EPERM;
				return -EPERM;
			}
			}
		case MBX_WRITE_NV:
		case MBX_WRITE_VPARMS:
		case MBX_LOAD_SM:
		case MBX_LOAD_SM:
		case MBX_READ_NV:
		case MBX_READ_NV:
		case MBX_READ_CONFIG:
		case MBX_READ_CONFIG:
+7 −6
Original line number Original line Diff line number Diff line
@@ -243,16 +243,17 @@ lpfc_debugfs_hbqinfo_data(struct lpfc_hba *phba, char *buf, int size)
	raw_index = phba->hbq_get[i];
	raw_index = phba->hbq_get[i];
	getidx = le32_to_cpu(raw_index);
	getidx = le32_to_cpu(raw_index);
	len +=  snprintf(buf+len, size-len,
	len +=  snprintf(buf+len, size-len,
		"entrys:%d Put:%d nPut:%d localGet:%d hbaGet:%d\n",
		"entrys:%d bufcnt:%d Put:%d nPut:%d localGet:%d hbaGet:%d\n",
		hbqs->entry_count, hbqs->hbqPutIdx, hbqs->next_hbqPutIdx,
		hbqs->entry_count, hbqs->buffer_count, hbqs->hbqPutIdx,
		hbqs->local_hbqGetIdx, getidx);
		hbqs->next_hbqPutIdx, hbqs->local_hbqGetIdx, getidx);


	hbqe = (struct lpfc_hbq_entry *) phba->hbqs[i].hbq_virt;
	hbqe = (struct lpfc_hbq_entry *) phba->hbqs[i].hbq_virt;
	for (j=0; j<hbqs->entry_count; j++) {
	for (j=0; j<hbqs->entry_count; j++) {
		len +=  snprintf(buf+len, size-len,
		len +=  snprintf(buf+len, size-len,
			"%03d: %08x %04x %05x ", j,
			"%03d: %08x %04x %05x ", j,
			hbqe->bde.addrLow, hbqe->bde.tus.w, hbqe->buffer_tag);
			le32_to_cpu(hbqe->bde.addrLow),

			le32_to_cpu(hbqe->bde.tus.w),
			le32_to_cpu(hbqe->buffer_tag));
		i = 0;
		i = 0;
		found = 0;
		found = 0;


@@ -276,7 +277,7 @@ lpfc_debugfs_hbqinfo_data(struct lpfc_hba *phba, char *buf, int size)
		list_for_each_entry(d_buf, &hbqs->hbq_buffer_list, list) {
		list_for_each_entry(d_buf, &hbqs->hbq_buffer_list, list) {
			hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf);
			hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf);
			phys = ((uint64_t)hbq_buf->dbuf.phys & 0xffffffff);
			phys = ((uint64_t)hbq_buf->dbuf.phys & 0xffffffff);
			if (phys == hbqe->bde.addrLow) {
			if (phys == le32_to_cpu(hbqe->bde.addrLow)) {
				len +=  snprintf(buf+len, size-len,
				len +=  snprintf(buf+len, size-len,
					"Buf%d: %p %06x\n", i,
					"Buf%d: %p %06x\n", i,
					hbq_buf->dbuf.virt, hbq_buf->tag);
					hbq_buf->dbuf.virt, hbq_buf->tag);
+1 −0
Original line number Original line Diff line number Diff line
@@ -91,6 +91,7 @@ struct lpfc_nodelist {
#define NLP_LOGO_SND       0x100	/* sent LOGO request for this entry */
#define NLP_LOGO_SND       0x100	/* sent LOGO request for this entry */
#define NLP_RNID_SND       0x400	/* sent RNID request for this entry */
#define NLP_RNID_SND       0x400	/* sent RNID request for this entry */
#define NLP_ELS_SND_MASK   0x7e0	/* sent ELS request for this entry */
#define NLP_ELS_SND_MASK   0x7e0	/* sent ELS request for this entry */
#define NLP_DEFER_RM       0x10000	/* Remove this ndlp if no longer used */
#define NLP_DELAY_TMO      0x20000	/* delay timeout is running for node */
#define NLP_DELAY_TMO      0x20000	/* delay timeout is running for node */
#define NLP_NPR_2B_DISC    0x40000	/* node is included in num_disc_nodes */
#define NLP_NPR_2B_DISC    0x40000	/* node is included in num_disc_nodes */
#define NLP_RCV_PLOGI      0x80000	/* Rcv'ed PLOGI from remote system */
#define NLP_RCV_PLOGI      0x80000	/* Rcv'ed PLOGI from remote system */
+26 −8
Original line number Original line Diff line number Diff line
@@ -2069,9 +2069,25 @@ int
lpfc_els_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *elsiocb)
lpfc_els_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *elsiocb)
{
{
	struct lpfc_dmabuf *buf_ptr, *buf_ptr1;
	struct lpfc_dmabuf *buf_ptr, *buf_ptr1;
	struct lpfc_nodelist *ndlp;


	if (elsiocb->context1) {
	ndlp = (struct lpfc_nodelist *)elsiocb->context1;
		lpfc_nlp_put(elsiocb->context1);
	if (ndlp) {
		if (ndlp->nlp_flag & NLP_DEFER_RM) {
			lpfc_nlp_put(ndlp);

			/* If the ndlp is not being used by another discovery
			 * thread, free it.
			 */
			if (!lpfc_nlp_not_used(ndlp)) {
				/* If ndlp is being used by another discovery
				 * thread, just clear NLP_DEFER_RM
				 */
				ndlp->nlp_flag &= ~NLP_DEFER_RM;
			}
		}
		else
			lpfc_nlp_put(ndlp);
		elsiocb->context1 = NULL;
		elsiocb->context1 = NULL;
	}
	}
	/* context2  = cmd,  context2->next = rsp, context3 = bpl */
	/* context2  = cmd,  context2->next = rsp, context3 = bpl */
@@ -2130,6 +2146,7 @@ lpfc_mbx_cmpl_dflt_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
	lpfc_mbuf_free(phba, mp->virt, mp->phys);
	lpfc_mbuf_free(phba, mp->virt, mp->phys);
	kfree(mp);
	kfree(mp);
	mempool_free(pmb, phba->mbox_mem_pool);
	mempool_free(pmb, phba->mbox_mem_pool);
	if (ndlp) {
		lpfc_nlp_put(ndlp);
		lpfc_nlp_put(ndlp);


		/* This is the end of the default RPI cleanup logic for this
		/* This is the end of the default RPI cleanup logic for this
@@ -2137,6 +2154,7 @@ lpfc_mbx_cmpl_dflt_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
		 * we should free all resources associated with it.
		 * we should free all resources associated with it.
		 */
		 */
		lpfc_nlp_not_used(ndlp);
		lpfc_nlp_not_used(ndlp);
	}
	return;
	return;
}
}


Loading