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

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

[SCSI] lpfc 8.3.16: SLI Additions, updates, and code cleanup



- Remove unneeded Endian swap for Block Guard IOCB response
- Add a check for mailbox active before issuing the heartbeat command
- Correct heartbeat last_completion updates to avoid unneeded heartbeats
- Add Security crypto support to CONFIG_PORT mailbox command
- Add fips level and fips spec revision sysfs parameters
- Remove duplicate setting of ext_byte_len fields in lpfc_bsg_issue_mbox
- Switch call to memcpy_toio to __write32_copy to prevent unaligned 64 bit copy
- Change log message 0318 from an error to a warning as it is not an error
- Patch an incorrect call to lpfc_drain_txq on SLI-3 functions

Signed-off-by: default avatarAlex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 823d219f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -775,6 +775,7 @@ struct lpfc_hba {
	uint8_t temp_sensor_support;
	/* Fields used for heart beat. */
	unsigned long last_completion_time;
	unsigned long skipped_hb;
	struct timer_list hb_tmofunc;
	uint8_t hb_outstanding;
	enum hba_temp_state over_temp_state;
@@ -817,6 +818,8 @@ struct lpfc_hba {
	uint32_t iocb_cnt;
	uint32_t iocb_max;
	atomic_t sdev_cnt;
	uint8_t fips_spec_rev;
	uint8_t fips_level;
};

static inline struct Scsi_Host *
+45 −1
Original line number Diff line number Diff line
@@ -1238,6 +1238,44 @@ lpfc_poll_store(struct device *dev, struct device_attribute *attr,
	return strlen(buf);
}

/**
 * lpfc_fips_level_show - Return the current FIPS level for the HBA
 * @dev: class unused variable.
 * @attr: device attribute, not used.
 * @buf: on return contains the module description text.
 *
 * Returns: size of formatted string.
 **/
static ssize_t
lpfc_fips_level_show(struct device *dev,  struct device_attribute *attr,
		     char *buf)
{
	struct Scsi_Host  *shost = class_to_shost(dev);
	struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
	struct lpfc_hba   *phba = vport->phba;

	return snprintf(buf, PAGE_SIZE, "%d\n", phba->fips_level);
}

/**
 * lpfc_fips_rev_show - Return the FIPS Spec revision for the HBA
 * @dev: class unused variable.
 * @attr: device attribute, not used.
 * @buf: on return contains the module description text.
 *
 * Returns: size of formatted string.
 **/
static ssize_t
lpfc_fips_rev_show(struct device *dev,  struct device_attribute *attr,
		   char *buf)
{
	struct Scsi_Host  *shost = class_to_shost(dev);
	struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
	struct lpfc_hba   *phba = vport->phba;

	return snprintf(buf, PAGE_SIZE, "%d\n", phba->fips_spec_rev);
}

/**
 * lpfc_param_show - Return a cfg attribute value in decimal
 *
@@ -1676,6 +1714,8 @@ static DEVICE_ATTR(max_xri, S_IRUGO, lpfc_max_xri_show, NULL);
static DEVICE_ATTR(used_xri, S_IRUGO, lpfc_used_xri_show, NULL);
static DEVICE_ATTR(npiv_info, S_IRUGO, lpfc_npiv_info_show, NULL);
static DEVICE_ATTR(lpfc_temp_sensor, S_IRUGO, lpfc_temp_sensor_show, NULL);
static DEVICE_ATTR(lpfc_fips_level, S_IRUGO, lpfc_fips_level_show, NULL);
static DEVICE_ATTR(lpfc_fips_rev, S_IRUGO, lpfc_fips_rev_show, NULL);


static char *lpfc_soft_wwn_key = "C99G71SL8032A";
@@ -3280,7 +3320,7 @@ LPFC_ATTR_R(enable_bg, 0, 0, 1, "Enable BlockGuard Support");
#	- Default will result in registering capabilities for all profiles.
#
*/
unsigned int lpfc_prot_mask =   SHOST_DIX_TYPE0_PROTECTION;
unsigned int lpfc_prot_mask = SHOST_DIF_TYPE1_PROTECTION;

module_param(lpfc_prot_mask, uint, 0);
MODULE_PARM_DESC(lpfc_prot_mask, "host protection mask");
@@ -3385,6 +3425,8 @@ struct device_attribute *lpfc_hba_attrs[] = {
	&dev_attr_iocb_hw,
	&dev_attr_txq_hw,
	&dev_attr_txcmplq_hw,
	&dev_attr_lpfc_fips_level,
	&dev_attr_lpfc_fips_rev,
	NULL,
};

@@ -3411,6 +3453,8 @@ struct device_attribute *lpfc_vport_attrs[] = {
	&dev_attr_lpfc_max_scsicmpl_time,
	&dev_attr_lpfc_stat_data_ctrl,
	&dev_attr_lpfc_static_vport,
	&dev_attr_lpfc_fips_level,
	&dev_attr_lpfc_fips_rev,
	NULL,
};

+0 −9
Original line number Diff line number Diff line
@@ -2722,15 +2722,6 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job,
				mbox_req->inExtWLen * sizeof(uint32_t));
		}

		pmboxq->context2 = ext;
		pmboxq->in_ext_byte_len =
			mbox_req->inExtWLen *
			sizeof(uint32_t);
		pmboxq->out_ext_byte_len =
			mbox_req->outExtWLen *
			sizeof(uint32_t);
		pmboxq->mbox_offset_word =
			mbox_req->mbOffset;
		pmboxq->context2 = ext;
		pmboxq->in_ext_byte_len =
			mbox_req->inExtWLen * sizeof(uint32_t);
+1 −2
Original line number Diff line number Diff line
@@ -82,8 +82,7 @@ lpfc_memcpy_from_slim( void *dest, void __iomem *src, unsigned int bytes)
static inline void
lpfc_memcpy_to_slim( void __iomem *dest, void *src, unsigned int bytes)
{
	/* actually returns 1 byte past dest */
	memcpy_toio( dest, src, bytes);
	__iowrite32_copy(dest, src, bytes);
}

static inline void
+1 −1
Original line number Diff line number Diff line
@@ -588,7 +588,7 @@ lpfc_work_done(struct lpfc_hba *phba)
							(status &
							 HA_RXMASK));
		}
		if (pring->txq_cnt)
		if ((phba->sli_rev == LPFC_SLI_REV4) && pring->txq_cnt)
			lpfc_drain_txq(phba);
		/*
		 * Turn on Ring interrupts
Loading