Commit d8cdd33a authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Rename mp/bmp dma buffers to rq/rsp in lpfc_fdmi_cmd

Clarify naming of the mp/bmp dma buffers:

 - Rename mp to rq as it is the request buffer

 - Rename bmp to rsp as it is the response buffer

This reduces confusion about what the buffer content is based on their
name.

Link: https://lore.kernel.org/r/20220911221505.117655-9-jsmart2021@gmail.comCo-developed-by: default avatarJustin Tee <justin.tee@broadcom.com>
Signed-off-by: default avatarJustin Tee <justin.tee@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 21828e3c
...@@ -3524,9 +3524,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -3524,9 +3524,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
int cmdcode, uint32_t new_mask) int cmdcode, uint32_t new_mask)
{ {
struct lpfc_hba *phba = vport->phba; struct lpfc_hba *phba = vport->phba;
struct lpfc_dmabuf *mp, *bmp; struct lpfc_dmabuf *rq, *rsp;
struct lpfc_sli_ct_request *CtReq; struct lpfc_sli_ct_request *CtReq;
struct ulp_bde64 *bpl; struct ulp_bde64_le *bde;
uint32_t bit_pos; uint32_t bit_pos;
uint32_t size; uint32_t size;
uint32_t rsp_size; uint32_t rsp_size;
...@@ -3546,25 +3546,25 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -3546,25 +3546,25 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
/* fill in BDEs for command */ /* fill in BDEs for command */
/* Allocate buffer for command payload */ /* Allocate buffer for command payload */
mp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); rq = kmalloc(sizeof(*rq), GFP_KERNEL);
if (!mp) if (!rq)
goto fdmi_cmd_exit; goto fdmi_cmd_exit;
mp->virt = lpfc_mbuf_alloc(phba, 0, &(mp->phys)); rq->virt = lpfc_mbuf_alloc(phba, 0, &rq->phys);
if (!mp->virt) if (!rq->virt)
goto fdmi_cmd_free_mp; goto fdmi_cmd_free_rq;
/* Allocate buffer for Buffer ptr list */ /* Allocate buffer for Buffer ptr list */
bmp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); rsp = kmalloc(sizeof(*rsp), GFP_KERNEL);
if (!bmp) if (!rsp)
goto fdmi_cmd_free_mpvirt; goto fdmi_cmd_free_rqvirt;
bmp->virt = lpfc_mbuf_alloc(phba, 0, &(bmp->phys)); rsp->virt = lpfc_mbuf_alloc(phba, 0, &rsp->phys);
if (!bmp->virt) if (!rsp->virt)
goto fdmi_cmd_free_bmp; goto fdmi_cmd_free_rsp;
INIT_LIST_HEAD(&mp->list); INIT_LIST_HEAD(&rq->list);
INIT_LIST_HEAD(&bmp->list); INIT_LIST_HEAD(&rsp->list);
/* FDMI request */ /* FDMI request */
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
...@@ -3572,7 +3572,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -3572,7 +3572,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
cmdcode, new_mask, vport->fdmi_port_mask, cmdcode, new_mask, vport->fdmi_port_mask,
vport->fc_flag, vport->port_state); vport->fc_flag, vport->port_state);
CtReq = (struct lpfc_sli_ct_request *)mp->virt; CtReq = (struct lpfc_sli_ct_request *)rq->virt;
/* First populate the CT_IU preamble */ /* First populate the CT_IU preamble */
memset(CtReq, 0, sizeof(struct lpfc_sli_ct_request)); memset(CtReq, 0, sizeof(struct lpfc_sli_ct_request));
...@@ -3730,31 +3730,32 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -3730,31 +3730,32 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY,
"0298 FDMI cmdcode x%x not supported\n", "0298 FDMI cmdcode x%x not supported\n",
cmdcode); cmdcode);
goto fdmi_cmd_free_bmpvirt; goto fdmi_cmd_free_rspvirt;
} }
CtReq->CommandResponse.bits.Size = cpu_to_be16(rsp_size); CtReq->CommandResponse.bits.Size = cpu_to_be16(rsp_size);
bpl = (struct ulp_bde64 *)bmp->virt; bde = (struct ulp_bde64_le *)rsp->virt;
bpl->addrHigh = le32_to_cpu(putPaddrHigh(mp->phys)); bde->addr_high = cpu_to_le32(putPaddrHigh(rq->phys));
bpl->addrLow = le32_to_cpu(putPaddrLow(mp->phys)); bde->addr_low = cpu_to_le32(putPaddrLow(rq->phys));
bpl->tus.f.bdeFlags = 0; bde->type_size = cpu_to_le32(ULP_BDE64_TYPE_BDE_64 <<
bpl->tus.f.bdeSize = size; ULP_BDE64_TYPE_SHIFT);
bde->type_size |= cpu_to_le32(size);
/* /*
* The lpfc_ct_cmd/lpfc_get_req shall increment ndlp reference count * The lpfc_ct_cmd/lpfc_get_req shall increment ndlp reference count
* to hold ndlp reference for the corresponding callback function. * to hold ndlp reference for the corresponding callback function.
*/ */
if (!lpfc_ct_cmd(vport, mp, bmp, ndlp, cmpl, rsp_size, 0)) if (!lpfc_ct_cmd(vport, rq, rsp, ndlp, cmpl, rsp_size, 0))
return 0; return 0;
fdmi_cmd_free_bmpvirt: fdmi_cmd_free_rspvirt:
lpfc_mbuf_free(phba, bmp->virt, bmp->phys); lpfc_mbuf_free(phba, rsp->virt, rsp->phys);
fdmi_cmd_free_bmp: fdmi_cmd_free_rsp:
kfree(bmp); kfree(rsp);
fdmi_cmd_free_mpvirt: fdmi_cmd_free_rqvirt:
lpfc_mbuf_free(phba, mp->virt, mp->phys); lpfc_mbuf_free(phba, rq->virt, rq->phys);
fdmi_cmd_free_mp: fdmi_cmd_free_rq:
kfree(mp); kfree(rq);
fdmi_cmd_exit: fdmi_cmd_exit:
/* Issue FDMI request failed */ /* Issue FDMI request failed */
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment