* [PATCH v1 1/1] scsi: lpfc: Do not abuse UUID APIs @ 2023-08-07 9:58 Andy Shevchenko 2023-08-07 15:45 ` Andy Shevchenko 0 siblings, 1 reply; 5+ messages in thread From: Andy Shevchenko @ 2023-08-07 9:58 UTC (permalink / raw) To: Martin K. Petersen, Justin Tee, linux-scsi, linux-kernel Cc: James Smart, Dick Kennedy, James E.J. Bottomley, Andy Shevchenko The lpfc_vmid_host_uuid is not defined as uuid_t and its usage is not the same as for uuid_t operations (like exporting or importing). Hence replace call to uuid_is_null() by respective memchr_inv() without abusing casting. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/scsi/lpfc/lpfc_els.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 2bad9954c355..14aece44cf43 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1332,7 +1332,7 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, if (phba->cfg_vmid_priority_tagging) { sp->cmn.priority_tagging = 1; /* lpfc_vmid_host_uuid is combination of wwpn and wwnn */ - if (uuid_is_null((uuid_t *)vport->lpfc_vmid_host_uuid)) { + if (memchr_inv(vport->lpfc_vmid_host_uuid, 0, LPFC_COMPRESS_VMID_SIZE)) { memcpy(vport->lpfc_vmid_host_uuid, phba->wwpn, sizeof(phba->wwpn)); memcpy(&vport->lpfc_vmid_host_uuid[8], phba->wwnn, @@ -12331,7 +12331,7 @@ lpfc_vmid_uvem(struct lpfc_vport *vport, elsiocb->vmid_tag.vmid_context = vmid_context; pcmd = (u8 *)elsiocb->cmd_dmabuf->virt; - if (uuid_is_null((uuid_t *)vport->lpfc_vmid_host_uuid)) + if (memchr_inv(vport->lpfc_vmid_host_uuid, 0, LPFC_COMPRESS_VMID_SIZE)) memcpy(vport->lpfc_vmid_host_uuid, vmid->host_vmid, LPFC_COMPRESS_VMID_SIZE); -- 2.40.0.1.gaa8946217a0b ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] scsi: lpfc: Do not abuse UUID APIs 2023-08-07 9:58 [PATCH v1 1/1] scsi: lpfc: Do not abuse UUID APIs Andy Shevchenko @ 2023-08-07 15:45 ` Andy Shevchenko 2023-08-07 17:45 ` Justin Tee 0 siblings, 1 reply; 5+ messages in thread From: Andy Shevchenko @ 2023-08-07 15:45 UTC (permalink / raw) To: Martin K. Petersen, Justin Tee, linux-scsi, linux-kernel Cc: James Smart, Dick Kennedy, James E.J. Bottomley On Mon, Aug 07, 2023 at 12:58:23PM +0300, Andy Shevchenko wrote: > The lpfc_vmid_host_uuid is not defined as uuid_t and its usage is not > the same as for uuid_t operations (like exporting or importing). > Hence replace call to uuid_is_null() by respective memchr_inv() without > abusing casting. The v2 had been issued, this patch is wrong, sorry. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] scsi: lpfc: Do not abuse UUID APIs 2023-08-07 15:45 ` Andy Shevchenko @ 2023-08-07 17:45 ` Justin Tee 2023-08-08 13:07 ` Andy Shevchenko 0 siblings, 1 reply; 5+ messages in thread From: Justin Tee @ 2023-08-07 17:45 UTC (permalink / raw) To: Andy Shevchenko Cc: Martin K. Petersen, linux-scsi, linux-kernel, James Smart, Dick Kennedy, James E.J. Bottomley [-- Attachment #1: Type: text/plain, Size: 2809 bytes --] On Mon, Aug 7, 2023 at 8:45 AM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Mon, Aug 07, 2023 at 12:58:23PM +0300, Andy Shevchenko wrote: > > The lpfc_vmid_host_uuid is not defined as uuid_t and its usage is not > > the same as for uuid_t operations (like exporting or importing). > > Hence replace call to uuid_is_null() by respective memchr_inv() without > > abusing casting. > > The v2 had been issued, this patch is wrong, sorry. > > -- > With Best Regards, > Andy Shevchenko Hi Andy, Thanks I would prefer to use sizeof instead of LPFC_COMPRESS_VMID_SIZE. Otherwise, the change looks fine to me. diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index b5cd6d1c0a5a..3515ec819037 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1331,7 +1331,8 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, if (phba->cfg_vmid_priority_tagging) { sp->cmn.priority_tagging = 1; /* lpfc_vmid_host_uuid is combination of wwpn and wwnn */ - if (uuid_is_null((uuid_t *)vport->lpfc_vmid_host_uuid)) { + if (!memchr_inv(vport->lpfc_vmid_host_uuid, 0, + sizeof(vport->lpfc_vmid_host_uuid))) { memcpy(vport->lpfc_vmid_host_uuid, phba->wwpn, sizeof(phba->wwpn)); memcpy(&vport->lpfc_vmid_host_uuid[8], phba->wwnn, @@ -12357,7 +12358,8 @@ lpfc_vmid_uvem(struct lpfc_vport *vport, elsiocb->vmid_tag.vmid_context = vmid_context; pcmd = (u8 *)elsiocb->cmd_dmabuf->virt; - if (uuid_is_null((uuid_t *)vport->lpfc_vmid_host_uuid)) + if (!memchr_inv(vport->lpfc_vmid_host_uuid, 0, + sizeof(vport->lpfc_vmid_host_uuid)) memcpy(vport->lpfc_vmid_host_uuid, vmid->host_vmid, LPFC_COMPRESS_VMID_SIZE); Regards, Justin -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it. [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/pkcs7-signature, Size: 4203 bytes --] ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] scsi: lpfc: Do not abuse UUID APIs 2023-08-07 17:45 ` Justin Tee @ 2023-08-08 13:07 ` Andy Shevchenko 2023-08-08 18:25 ` Justin Tee 0 siblings, 1 reply; 5+ messages in thread From: Andy Shevchenko @ 2023-08-08 13:07 UTC (permalink / raw) To: Justin Tee Cc: Martin K. Petersen, linux-scsi, linux-kernel, James Smart, Dick Kennedy, James E.J. Bottomley On Mon, Aug 07, 2023 at 10:45:03AM -0700, Justin Tee wrote: > -- > This electronic communication and the information and any files transmitted > with it, or attached to it, are confidential and are intended solely for > the use of the individual or entity to whom it is addressed and may contain > information that is confidential, legally privileged, protected by privacy > laws, or otherwise restricted from disclosure to anyone else. If you are > not the intended recipient or the person responsible for delivering the > e-mail to the intended recipient, you are hereby notified that any use, > copying, distributing, dissemination, forwarding, printing, or copying of > this e-mail is strictly prohibited. If you received this e-mail in error, > please return the e-mail to the sender, delete it from your computer, and > destroy any printed copy of it. Removed from mailbox. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] scsi: lpfc: Do not abuse UUID APIs 2023-08-08 13:07 ` Andy Shevchenko @ 2023-08-08 18:25 ` Justin Tee 0 siblings, 0 replies; 5+ messages in thread From: Justin Tee @ 2023-08-08 18:25 UTC (permalink / raw) To: Andy Shevchenko Cc: Martin K. Petersen, linux-scsi, linux-kernel, James Smart, Dick Kennedy, James E.J. Bottomley [-- Attachment #1: Type: text/plain, Size: 2184 bytes --] On Tue, Aug 8, 2023 at 6:07 AM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Mon, Aug 07, 2023 at 10:45:03AM -0700, Justin Tee wrote: > > > -- > > This electronic communication and the information and any files transmitted > > with it, or attached to it, are confidential and are intended solely for > > the use of the individual or entity to whom it is addressed and may contain > > information that is confidential, legally privileged, protected by privacy > > laws, or otherwise restricted from disclosure to anyone else. If you are > > not the intended recipient or the person responsible for delivering the > > e-mail to the intended recipient, you are hereby notified that any use, > > copying, distributing, dissemination, forwarding, printing, or copying of > > this e-mail is strictly prohibited. If you received this e-mail in error, > > please return the e-mail to the sender, delete it from your computer, and > > destroy any printed copy of it. > > Removed from mailbox. > > -- > With Best Regards, > Andy Shevchenko Hi Andy, There is no need to remove from mailbox because you were the intended recipient of my previous email as well as everyone subscribed to the linux-scsi and linux-kernel mailing list (: I still prefer sizeof(vport->lpfc_vmid_host_uuid) instead of LPFC_COMPRESS_VMID_SIZE. Thanks, Justin -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it. [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/pkcs7-signature, Size: 4203 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-08-08 21:15 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-08-07 9:58 [PATCH v1 1/1] scsi: lpfc: Do not abuse UUID APIs Andy Shevchenko 2023-08-07 15:45 ` Andy Shevchenko 2023-08-07 17:45 ` Justin Tee 2023-08-08 13:07 ` Andy Shevchenko 2023-08-08 18:25 ` Justin Tee
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox