Re: [PATCH v2 09/11] lpfc: Correct oops on vport port resets

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

 



On 12/20/2016 12:07 AM, James Smart wrote:
> 
> Correct oops on vport port resets. Incorrect WQE type, thus the clearing
> code actually overstepped the WQE.
> 
> Signed-off-by: Dick Kennedy <dick.kennedy@xxxxxxxxxxxx>
> Signed-off-by: James Smart <james.smart@xxxxxxxxxxxx>
> ---
>  drivers/scsi/lpfc/lpfc_sli.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 47b5520..d0ffcf3 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -17219,7 +17219,8 @@ lpfc_drain_txq(struct lpfc_hba *phba)
>  	unsigned long iflags = 0;
>  	char *fail_msg = NULL;
>  	struct lpfc_sglq *sglq;
> -	union lpfc_wqe wqe;
> +	union lpfc_wqe128 wqe128;
> +	union lpfc_wqe *wqe = (union lpfc_wqe *) &wqe128;
>  	uint32_t txq_cnt = 0;
>  
>  	spin_lock_irqsave(&pring->ring_lock, iflags);
> @@ -17258,9 +17259,9 @@ lpfc_drain_txq(struct lpfc_hba *phba)
>  		piocbq->sli4_xritag = sglq->sli4_xritag;
>  		if (NO_XRI == lpfc_sli4_bpl2sgl(phba, piocbq, sglq))
>  			fail_msg = "to convert bpl to sgl";
> -		else if (lpfc_sli4_iocb2wqe(phba, piocbq, &wqe))
> +		else if (lpfc_sli4_iocb2wqe(phba, piocbq, wqe))
>  			fail_msg = "to convert iocb to wqe";
> -		else if (lpfc_sli4_wq_put(phba->sli4_hba.els_wq, &wqe))
> +		else if (lpfc_sli4_wq_put(phba->sli4_hba.els_wq, wqe))
>  			fail_msg = " - Wq is full";
>  		else
>  			lpfc_sli_ringtxcmpl_put(phba, pring, piocbq);
> 
Now that is what I call a dodgy interface.
Casting a 128-bit structure to a 64-bit structure, only to call a memset
on the 128-bit structure in lpfc_sli4_iocb2wqe() is positively evil.
Can't you clear up this mess by generally passing in a wqe128?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@xxxxxxx			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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