lpfc 8.2.4 : Fix Unsolicited Data items
Subsystems (2)
PATCH 7/10 lpfc 8.2.4 : Fix Unsolicited Data items
Fix Drivers Unsolicited CT command handling - we did not handle multiframe
sequences well.
Fix error due to delay in replenishing buffers for unsolicited data.
Signed-off-by James Smart <[email protected]>
drivers/scsi/lpfc/lpfc_ct.c +35 -59
@@ -57,45 +57,27 @@static char *lpfc_release_version =LPFC_DRIVER_VERSION ; -/* -* lpfc_ct_unsol_event -*/ static void -lpfc_ct_unsol_buffer (struct lpfc_hba *phba,struct lpfc_iocbq *piocbq, -struct lpfc_dmabuf *mp,uint32_t size) +lpfc_ct_ignore_hbq_buffer (struct lpfc_hba *phba,struct lpfc_iocbq *piocbq, +struct lpfc_dmabuf *mp,uint32_t size) {if (!mp) { -printk (KERN_ERR "%s (%d): Unsolited CT, no buffer, " -"piocbq = %p, status = x%x, mp = %p, size = %d\n" , - __FUNCTION__, __LINE__, - piocbq, piocbq->iocb.ulpStatus, mp, size); - } - -printk (KERN_ERR "%s (%d): Ignoring unsolicted CT piocbq = %p, " -"buffer = %p, size = %d, status = x%x\n" , - __FUNCTION__, __LINE__, - piocbq, mp, size, - piocbq->iocb.ulpStatus); - +lpfc_printf_log (phba,KERN_INFO ,LOG_ELS , +"0146 Ignoring unsolicted CT No HBQ " +"status = x%x\n" , + piocbq->iocb.ulpStatus); + } +lpfc_printf_log (phba,KERN_INFO ,LOG_ELS , +"0145 Ignoring unsolicted CT HBQ Size:%d " +"status = x%x\n" , + size, piocbq->iocb.ulpStatus); }static void -lpfc_ct_ignore_hbq_buffer (struct lpfc_hba *phba,struct lpfc_iocbq *piocbq, -struct lpfc_dmabuf *mp,uint32_t size) +lpfc_ct_unsol_buffer (struct lpfc_hba *phba,struct lpfc_iocbq *piocbq, +struct lpfc_dmabuf *mp,uint32_t size) { -if (!mp) { -printk (KERN_ERR "%s (%d): Unsolited CT, no " -"HBQ buffer, piocbq = %p, status = x%x\n" , - __FUNCTION__, __LINE__, - piocbq, piocbq->iocb.ulpStatus); - }else { -lpfc_ct_unsol_buffer (phba, piocbq, mp, size); -printk (KERN_ERR "%s (%d): Ignoring unsolicted CT " -"piocbq = %p, buffer = %p, size = %d, " -"status = x%x\n" , - __FUNCTION__, __LINE__, - piocbq, mp, size, piocbq->iocb.ulpStatus); - } +lpfc_ct_ignore_hbq_buffer (phba, piocbq, mp, size); }void
@@ -109,11 +91,8 @@ lpfc_ct_unsol_event(struct lpfc_hba *phbstruct lpfc_iocbq *iocbq;dma_addr_t paddr;uint32_t size; -struct lpfc_dmabuf *bdeBuf1 = piocbq->context2; -struct lpfc_dmabuf *bdeBuf2 = piocbq->context3; - - piocbq->context2 =NULL ; - piocbq->context3 =NULL ; +struct list_head head; +struct lpfc_dmabuf *bdeBuf;if (unlikely (icmd->ulpStatus ==IOSTAT_NEED_BUFFER )) {lpfc_sli_hbqbuf_add_hbqs (phba,LPFC_ELS_HBQ );
@@ -122,7 +101,7 @@ lpfc_ct_unsol_event(struct lpfc_hba *phb/* Not enough posted buffers; Try posting more buffers */ phba->fc_stat.NoRcvBuf++;if (!(phba->sli3_options &LPFC_SLI3_HBQ_ENABLED )) -lpfc_post_buffer (phba, pring,0 ,1 ); +lpfc_post_buffer (phba, pring,2 ,1 );return ; }
@@ -133,38 +112,34 @@ lpfc_ct_unsol_event(struct lpfc_hba *phbreturn ;if (phba->sli3_options &LPFC_SLI3_HBQ_ENABLED ) { -list_for_each_entry (iocbq, &piocbq->list, list) { +INIT_LIST_HEAD (&head); +list_add_tail (&head, &piocbq->list); +list_for_each_entry (iocbq, &head, list) { icmd = &iocbq->iocb; -if (icmd->ulpBdeCount ==0 ) { -printk (KERN_ERR "%s (%d): Unsolited CT, no " -"BDE, iocbq = %p, status = x%x\n" , - __FUNCTION__, __LINE__, - iocbq, iocbq->iocb.ulpStatus); +if (icmd->ulpBdeCount ==0 )continue ; - } - + bdeBuf = iocbq->context2; + iocbq->context2 =NULL ; size = icmd->un.cont64[0 ].tus.f.bdeSize; -lpfc_ct_ignore_hbq_buffer (phba, piocbq, bdeBuf1, size); -lpfc_in_buf_free (phba, bdeBuf1); +lpfc_ct_unsol_buffer (phba, piocbq, bdeBuf, size); +lpfc_in_buf_free (phba, bdeBuf);if (icmd->ulpBdeCount ==2 ) { -lpfc_ct_ignore_hbq_buffer (phba, piocbq, bdeBuf2, - size); -lpfc_in_buf_free (phba, bdeBuf2); + bdeBuf = iocbq->context3; + iocbq->context3 =NULL ; + size = icmd->unsli3.rcvsli3.bde2.tus.f.bdeSize; +lpfc_ct_unsol_buffer (phba, piocbq, bdeBuf, + size); +lpfc_in_buf_free (phba, bdeBuf); } } +list_del (&head); }else {struct lpfc_iocbq *next;list_for_each_entry_safe (iocbq, next, &piocbq->list, list) { icmd = &iocbq->iocb; -if (icmd->ulpBdeCount ==0 ) { -printk (KERN_ERR "%s (%d): Unsolited CT, no " -"BDE, iocbq = %p, status = x%x\n" , - __FUNCTION__, __LINE__, - iocbq, iocbq->iocb.ulpStatus); -continue ; - } - +if (icmd->ulpBdeCount ==0 ) +lpfc_ct_unsol_buffer (phba, piocbq,NULL ,0 );for (i =0 ; i < icmd->ulpBdeCount; i++) { paddr =getPaddr (icmd->un.cont64[i].addrHigh, icmd->un.cont64[i].addrLow);
@@ -176,6 +151,7 @@ lpfc_ct_unsol_event(struct lpfc_hba *phb }list_del (&iocbq->list);lpfc_sli_release_iocbq (phba, iocbq); +lpfc_post_buffer (phba, pring, i,1 ); } } }
drivers/scsi/lpfc/lpfc_hw.h +29 -0
@@ -2994,6 +2994,34 @@ typedef struct {#endif }RCV_ELS_REQ64 ; +/* IOCB Command template for RCV_SEQ64 */ +struct rcv_seq64 { +struct ulp_bde64 elsReq; +uint32_t hbq_1; +uint32_t parmRo; +#ifdef __BIG_ENDIAN_BITFIELD +uint32_t rctl:8 ; +uint32_t type:8 ; +uint32_t dfctl:8 ; +uint32_t ls:1 ; +uint32_t fs:1 ; +uint32_t rsvd2:3 ; +uint32_t si:1 ; +uint32_t bc:1 ; +uint32_t rsvd3:1 ; +#else /* __LITTLE_ENDIAN_BITFIELD */ +uint32_t rsvd3:1 ; +uint32_t bc:1 ; +uint32_t si:1 ; +uint32_t rsvd2:3 ; +uint32_t fs:1 ; +uint32_t ls:1 ; +uint32_t dfctl:8 ; +uint32_t type:8 ; +uint32_t rctl:8 ; +#endif +}; +/* IOCB Command template for all 64 bit FCP Initiator commands */ typedef struct { ULP_BDL bdl;
@@ -3085,6 +3113,7 @@ typedef struct _IOCB { /* IOCB structureFCPT_FIELDS64 fcpt64;/* FCP 64 bit target template */ ASYNCSTAT_FIELDS asyncstat;/* async_status iocb */ QUE_XRI64_CX_FIELDS quexri64cx;/* que_xri64_cx fields */ +struct rcv_seq64 rcvseq64;/* RCV_SEQ64 and RCV_CONT64 */ uint32_t ulpWord[IOCB_WORD_SZ -2 ];/* generic 6 'words' */ } un;
drivers/scsi/lpfc/lpfc_sli.c +56 -53
181 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_sli.h +2 -0
@@ -33,6 +33,7 @@ typedef enum _lpfc_ctx_cmd {struct lpfc_iocbq {/* lpfc_iocbqs are used in double linked lists */ struct list_head list; +struct list_head clist;uint16_t iotag;/* pre-assigned IO tag */ uint16_t rsvd1;
@@ -160,6 +161,7 @@ struct lpfc_sli_ring {struct list_head iocb_continueq;uint16_t iocb_continueq_cnt;/* current length of queue */ uint16_t iocb_continueq_max;/* max length */ +struct list_head iocb_continue_saveq;struct lpfc_sli_ring_mask prt[LPFC_MAX_RING_MASK ];uint32_t num_mask;/* number of mask entries in prt array */