Re: [PATCH v2 06/14] qla2xxx: Improve T10-DIF/PI handling in driver.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2017-02-03 at 14:40 -0800, Himanshu Madhani wrote:
> +	/* Response code and sense key */
> +	((uint32_t *)ctio->u.status1.sense_data)[0] =
> +	    cpu_to_le32((0x70 << 24) | (sense_key << 8));
> +	/* Additional sense length */
> +	((uint32_t *)ctio->u.status1.sense_data)[1] = cpu_to_le32(0x0a);
> +	/* ASC and ASCQ */
> +	((uint32_t *)ctio->u.status1.sense_data)[3] =
> +	    cpu_to_le32((asc << 24) | (ascq << 16));

Please use put_unaligned_le32() instead of open-coding it.

>  struct qla_tgt_cmd {
> @@ -885,11 +895,25 @@ struct qla_tgt_cmd {
>  	struct list_head cmd_list;
>  
>  	struct atio_from_isp atio;
> -	/* t10dif */
> +
> +	/* T10-DIF */
> +#define DIF_ERR_NONE 0
> +#define DIF_ERR_GRD 1
> +#define DIF_ERR_REF 2
> +#define DIF_ERR_APP 3
> +	int8_t dif_err_code;
>  	struct scatterlist *prot_sg;
>  	uint32_t prot_sg_cnt;
> -	uint32_t blk_sz;
> +	uint32_t blk_sz, num_blks;
> +	uint8_t scsi_status, sense_key, asc, ascq;
> +
>  	struct crc_context *ctx;
> +	uint32_t	prot_op;
> +	uint32_t	prot_type;
> +	uint8_t		*cdb;
> +	uint64_t	lba;
> +	uint16_t	a_guard, e_guard, a_app_tag, e_app_tag;
> +	uint32_t	a_ref_tag, e_ref_tag;
>  
>  	uint64_t jiffies_at_alloc;
>  	uint64_t jiffies_at_free;

There are already equivalents of prot_op, prot_type, cdb and lba in struct
se_cmd. I think a few weeks ago Christoph had asked you not to duplicate
se_cmd fields into struct qla_tgt_cmd?

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux