All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/16] blkcg:Support to track FC storage blk io traffic
@ 2020-12-16  5:29 ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Muneendra

[-- Attachment #1: Type: text/plain, Size: 4769 bytes --]

This Patch added a unique application identifier i.e
app_id  knob to  blkcg which allows identification of traffic
sources at an individual cgroup based Applications
(ex:virtual machine (VM))level in both host and
fabric infrastructure.

Added a new sysfs attribute appid_store to set the application identfier
in  the blkcg associted with cgroup id
/sys/class/fc/fc_udev_device/*
With this new interface the user can set the application identfier
in  the blkcg associted with cgroup id.

This capability can be utilized by multiple block transport infrastructure
like fc,iscsi,roce.

Existing FC fabric will use this feature and the description of
the use case is below.

Various virtualization technologies used in Fibre Channel
SAN deployments have created the opportunity to identify
and associate traffic with specific virtualized applications.
The concepts behind the T11 Application Services standard is
to provide the general mechanisms needed to identify
virtualized services.
It enables the Fabric and the storage targets to
identify, monitor, and handle FC traffic
based on vm tags by inserting application specific identification
into the FC frame.

The patches were cut against  5.11/scsi-queue tree

v5:
Renamed the function cgroup_get_from_kernfs_id to
cgroup_get_from_id.

Moved the input validation at the beginning of the function in 
Renamed the arguments appropriatley.

Changed Return code to non-numeric/SymbolChanged Return code
to non-numeric/Symbol

Modified the comments.

v4:
Addressed the error reported by  kernel test robot

v3:
removed RFC.

Renamed the functions and app_id to more specific
Addressed the reference leaks in blkcg_set_app_identifier
Added a new config BLK_CGROUP_FC_APPID and made changes to 
select the same under SCSI_FC_ATTRS

V2:
renamed app_identifier to app_id.
removed the  sysfs interface blkio.app_identifie under
/sys/fs/cgroup/blkio
Ported the patch on top of 5.10/scsi-queue.
Removed redundant code due to changes since last submit.
Added a fix for issuing QFPA command.



Gaurav Srivastava (12):
  lpfc: vmid: Add the datastructure for supporting VMID in lpfc
  lpfc: vmid: Supplementary data structures for vmid and APIs
  lpfc: vmid: Forward declarations for APIs
  lpfc: vmid: VMID params initialization
  lpfc: vmid: Add support for vmid in mailbox command, does vmid
    resource allocation and vmid cleanup
  lpfc: vmid: Implements ELS commands for appid patch
  lpfc: vmid: Functions to manage vmids
  lpfc: vmid: Implements CT commands for appid.
  lpfc: vmid: Appends the vmid in the wqe before sending
  lpfc: vmid: Timeout implementation for vmid
  lpfc: vmid: Adding qfpa and vmid timeout check in worker thread
  lpfc: vmid: Introducing vmid in io path.

Muneendra (4):
  cgroup: Added cgroup_get_from_id
  blkcg: Added a app identifier support for blkcg
  nvme: Added a newsysfs attribute appid_store
  scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID

 block/Kconfig                    |   9 +
 drivers/nvme/host/fc.c           |  73 +++++-
 drivers/scsi/Kconfig             |  13 ++
 drivers/scsi/lpfc/lpfc.h         | 121 ++++++++++
 drivers/scsi/lpfc/lpfc_attr.c    |  47 ++++
 drivers/scsi/lpfc/lpfc_crtn.h    |  11 +
 drivers/scsi/lpfc/lpfc_ct.c      | 249 +++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_disc.h    |   1 +
 drivers/scsi/lpfc/lpfc_els.c     | 371 ++++++++++++++++++++++++++++++-
 drivers/scsi/lpfc/lpfc_hbadisc.c | 151 +++++++++++++
 drivers/scsi/lpfc/lpfc_hw.h      | 124 ++++++++++-
 drivers/scsi/lpfc/lpfc_hw4.h     |  12 +
 drivers/scsi/lpfc/lpfc_init.c    | 108 +++++++++
 drivers/scsi/lpfc/lpfc_mbox.c    |   6 +
 drivers/scsi/lpfc/lpfc_scsi.c    | 325 +++++++++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_sli.c     |  65 +++++-
 drivers/scsi/lpfc/lpfc_sli.h     |   8 +
 include/linux/blk-cgroup.h       |  56 +++++
 include/linux/cgroup.h           |   6 +
 kernel/cgroup/cgroup.c           |  26 +++
 20 files changed, 1769 insertions(+), 13 deletions(-)

-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [PATCH v5 00/16] blkcg:Support to track FC storage blk io traffic
@ 2020-12-16  5:29 ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Muneendra


[-- Attachment #1.1: Type: text/plain, Size: 4769 bytes --]

This Patch added a unique application identifier i.e
app_id  knob to  blkcg which allows identification of traffic
sources at an individual cgroup based Applications
(ex:virtual machine (VM))level in both host and
fabric infrastructure.

Added a new sysfs attribute appid_store to set the application identfier
in  the blkcg associted with cgroup id
/sys/class/fc/fc_udev_device/*
With this new interface the user can set the application identfier
in  the blkcg associted with cgroup id.

This capability can be utilized by multiple block transport infrastructure
like fc,iscsi,roce.

Existing FC fabric will use this feature and the description of
the use case is below.

Various virtualization technologies used in Fibre Channel
SAN deployments have created the opportunity to identify
and associate traffic with specific virtualized applications.
The concepts behind the T11 Application Services standard is
to provide the general mechanisms needed to identify
virtualized services.
It enables the Fabric and the storage targets to
identify, monitor, and handle FC traffic
based on vm tags by inserting application specific identification
into the FC frame.

The patches were cut against  5.11/scsi-queue tree

v5:
Renamed the function cgroup_get_from_kernfs_id to
cgroup_get_from_id.

Moved the input validation at the beginning of the function in 
Renamed the arguments appropriatley.

Changed Return code to non-numeric/SymbolChanged Return code
to non-numeric/Symbol

Modified the comments.

v4:
Addressed the error reported by  kernel test robot

v3:
removed RFC.

Renamed the functions and app_id to more specific
Addressed the reference leaks in blkcg_set_app_identifier
Added a new config BLK_CGROUP_FC_APPID and made changes to 
select the same under SCSI_FC_ATTRS

V2:
renamed app_identifier to app_id.
removed the  sysfs interface blkio.app_identifie under
/sys/fs/cgroup/blkio
Ported the patch on top of 5.10/scsi-queue.
Removed redundant code due to changes since last submit.
Added a fix for issuing QFPA command.



Gaurav Srivastava (12):
  lpfc: vmid: Add the datastructure for supporting VMID in lpfc
  lpfc: vmid: Supplementary data structures for vmid and APIs
  lpfc: vmid: Forward declarations for APIs
  lpfc: vmid: VMID params initialization
  lpfc: vmid: Add support for vmid in mailbox command, does vmid
    resource allocation and vmid cleanup
  lpfc: vmid: Implements ELS commands for appid patch
  lpfc: vmid: Functions to manage vmids
  lpfc: vmid: Implements CT commands for appid.
  lpfc: vmid: Appends the vmid in the wqe before sending
  lpfc: vmid: Timeout implementation for vmid
  lpfc: vmid: Adding qfpa and vmid timeout check in worker thread
  lpfc: vmid: Introducing vmid in io path.

Muneendra (4):
  cgroup: Added cgroup_get_from_id
  blkcg: Added a app identifier support for blkcg
  nvme: Added a newsysfs attribute appid_store
  scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID

 block/Kconfig                    |   9 +
 drivers/nvme/host/fc.c           |  73 +++++-
 drivers/scsi/Kconfig             |  13 ++
 drivers/scsi/lpfc/lpfc.h         | 121 ++++++++++
 drivers/scsi/lpfc/lpfc_attr.c    |  47 ++++
 drivers/scsi/lpfc/lpfc_crtn.h    |  11 +
 drivers/scsi/lpfc/lpfc_ct.c      | 249 +++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_disc.h    |   1 +
 drivers/scsi/lpfc/lpfc_els.c     | 371 ++++++++++++++++++++++++++++++-
 drivers/scsi/lpfc/lpfc_hbadisc.c | 151 +++++++++++++
 drivers/scsi/lpfc/lpfc_hw.h      | 124 ++++++++++-
 drivers/scsi/lpfc/lpfc_hw4.h     |  12 +
 drivers/scsi/lpfc/lpfc_init.c    | 108 +++++++++
 drivers/scsi/lpfc/lpfc_mbox.c    |   6 +
 drivers/scsi/lpfc/lpfc_scsi.c    | 325 +++++++++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_sli.c     |  65 +++++-
 drivers/scsi/lpfc/lpfc_sli.h     |   8 +
 include/linux/blk-cgroup.h       |  56 +++++
 include/linux/cgroup.h           |   6 +
 kernel/cgroup/cgroup.c           |  26 +++
 20 files changed, 1769 insertions(+), 13 deletions(-)

-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [PATCH v5 01/16] cgroup: Added cgroup_get_from_id
  2020-12-16  5:29 ` Muneendra
  (?)
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Muneendra

[-- Attachment #1: Type: text/plain, Size: 3332 bytes --]

Added a new function cgroup_get_from_id  to retrieve the cgroup
associated with cgroup id.
Exported the same as this can be used by blk-cgorup.c

Added function declaration of cgroup_get_from_id in cgorup.h

This patch also exported the function cgroup_get_e_css
as this is getting used in blk-cgroup.h

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
renamed the function cgroup_get_from_kernfs_id to
cgroup_get_from_id

v4:
No change

v3:
Exported the cgroup_get_e_css

v2:
New patch
---
 include/linux/cgroup.h |  6 ++++++
 kernel/cgroup/cgroup.c | 26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 618838c48313..da31b14db198 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -696,6 +696,7 @@ static inline void cgroup_kthread_ready(void)
 }
 
 void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen);
+struct cgroup *cgroup_get_from_id(u64 id);
 #else /* !CONFIG_CGROUPS */
 
 struct cgroup_subsys_state;
@@ -743,6 +744,11 @@ static inline bool task_under_cgroup_hierarchy(struct task_struct *task,
 
 static inline void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
 {}
+
+static struct cgroup *cgroup_get_from_id(u64 id)
+{
+	return NULL;
+}
 #endif /* !CONFIG_CGROUPS */
 
 #ifdef CONFIG_CGROUPS
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index e41c21819ba0..34ebfbeba098 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -580,6 +580,7 @@ struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgrp,
 	rcu_read_unlock();
 	return css;
 }
+EXPORT_SYMBOL_GPL(cgroup_get_e_css);
 
 static void cgroup_get_live(struct cgroup *cgrp)
 {
@@ -5805,6 +5806,31 @@ void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
 	kernfs_put(kn);
 }
 
+/*
+ * cgroup_get_from_id : get the cgroup associated with cgroup id
+ * @id: cgroup id
+ * On success it returns the cgrp on failure it returns NULL
+ */
+struct cgroup *cgroup_get_from_id(u64 id)
+{
+	struct kernfs_node *kn;
+	struct cgroup *cgrp = NULL;
+
+	mutex_lock(&cgroup_mutex);
+	kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id);
+	if (!kn)
+		goto out_unlock;
+
+	cgrp = kn->priv;
+	if (cgroup_is_dead(cgrp) || !cgroup_tryget(cgrp))
+		cgrp = NULL;
+	kernfs_put(kn);
+out_unlock:
+	mutex_unlock(&cgroup_mutex);
+	return cgrp;
+}
+EXPORT_SYMBOL_GPL(cgroup_get_from_id);
+
 /*
  * proc_cgroup_show()
  *  - Print task's cgroup paths into seq_file, one line for each hierarchy
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 01/16] cgroup: Added cgroup_get_from_id
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Muneendra

[-- Attachment #1: Type: text/plain, Size: 3332 bytes --]

Added a new function cgroup_get_from_id  to retrieve the cgroup
associated with cgroup id.
Exported the same as this can be used by blk-cgorup.c

Added function declaration of cgroup_get_from_id in cgorup.h

This patch also exported the function cgroup_get_e_css
as this is getting used in blk-cgroup.h

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
renamed the function cgroup_get_from_kernfs_id to
cgroup_get_from_id

v4:
No change

v3:
Exported the cgroup_get_e_css

v2:
New patch
---
 include/linux/cgroup.h |  6 ++++++
 kernel/cgroup/cgroup.c | 26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 618838c48313..da31b14db198 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -696,6 +696,7 @@ static inline void cgroup_kthread_ready(void)
 }
 
 void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen);
+struct cgroup *cgroup_get_from_id(u64 id);
 #else /* !CONFIG_CGROUPS */
 
 struct cgroup_subsys_state;
@@ -743,6 +744,11 @@ static inline bool task_under_cgroup_hierarchy(struct task_struct *task,
 
 static inline void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
 {}
+
+static struct cgroup *cgroup_get_from_id(u64 id)
+{
+	return NULL;
+}
 #endif /* !CONFIG_CGROUPS */
 
 #ifdef CONFIG_CGROUPS
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index e41c21819ba0..34ebfbeba098 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -580,6 +580,7 @@ struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgrp,
 	rcu_read_unlock();
 	return css;
 }
+EXPORT_SYMBOL_GPL(cgroup_get_e_css);
 
 static void cgroup_get_live(struct cgroup *cgrp)
 {
@@ -5805,6 +5806,31 @@ void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
 	kernfs_put(kn);
 }
 
+/*
+ * cgroup_get_from_id : get the cgroup associated with cgroup id
+ * @id: cgroup id
+ * On success it returns the cgrp on failure it returns NULL
+ */
+struct cgroup *cgroup_get_from_id(u64 id)
+{
+	struct kernfs_node *kn;
+	struct cgroup *cgrp = NULL;
+
+	mutex_lock(&cgroup_mutex);
+	kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id);
+	if (!kn)
+		goto out_unlock;
+
+	cgrp = kn->priv;
+	if (cgroup_is_dead(cgrp) || !cgroup_tryget(cgrp))
+		cgrp = NULL;
+	kernfs_put(kn);
+out_unlock:
+	mutex_unlock(&cgroup_mutex);
+	return cgrp;
+}
+EXPORT_SYMBOL_GPL(cgroup_get_from_id);
+
 /*
  * proc_cgroup_show()
  *  - Print task's cgroup paths into seq_file, one line for each hierarchy
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 01/16] cgroup: Added cgroup_get_from_id
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Muneendra


[-- Attachment #1.1: Type: text/plain, Size: 3332 bytes --]

Added a new function cgroup_get_from_id  to retrieve the cgroup
associated with cgroup id.
Exported the same as this can be used by blk-cgorup.c

Added function declaration of cgroup_get_from_id in cgorup.h

This patch also exported the function cgroup_get_e_css
as this is getting used in blk-cgroup.h

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
renamed the function cgroup_get_from_kernfs_id to
cgroup_get_from_id

v4:
No change

v3:
Exported the cgroup_get_e_css

v2:
New patch
---
 include/linux/cgroup.h |  6 ++++++
 kernel/cgroup/cgroup.c | 26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 618838c48313..da31b14db198 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -696,6 +696,7 @@ static inline void cgroup_kthread_ready(void)
 }
 
 void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen);
+struct cgroup *cgroup_get_from_id(u64 id);
 #else /* !CONFIG_CGROUPS */
 
 struct cgroup_subsys_state;
@@ -743,6 +744,11 @@ static inline bool task_under_cgroup_hierarchy(struct task_struct *task,
 
 static inline void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
 {}
+
+static struct cgroup *cgroup_get_from_id(u64 id)
+{
+	return NULL;
+}
 #endif /* !CONFIG_CGROUPS */
 
 #ifdef CONFIG_CGROUPS
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index e41c21819ba0..34ebfbeba098 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -580,6 +580,7 @@ struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgrp,
 	rcu_read_unlock();
 	return css;
 }
+EXPORT_SYMBOL_GPL(cgroup_get_e_css);
 
 static void cgroup_get_live(struct cgroup *cgrp)
 {
@@ -5805,6 +5806,31 @@ void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
 	kernfs_put(kn);
 }
 
+/*
+ * cgroup_get_from_id : get the cgroup associated with cgroup id
+ * @id: cgroup id
+ * On success it returns the cgrp on failure it returns NULL
+ */
+struct cgroup *cgroup_get_from_id(u64 id)
+{
+	struct kernfs_node *kn;
+	struct cgroup *cgrp = NULL;
+
+	mutex_lock(&cgroup_mutex);
+	kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id);
+	if (!kn)
+		goto out_unlock;
+
+	cgrp = kn->priv;
+	if (cgroup_is_dead(cgrp) || !cgroup_tryget(cgrp))
+		cgrp = NULL;
+	kernfs_put(kn);
+out_unlock:
+	mutex_unlock(&cgroup_mutex);
+	return cgrp;
+}
+EXPORT_SYMBOL_GPL(cgroup_get_from_id);
+
 /*
  * proc_cgroup_show()
  *  - Print task's cgroup paths into seq_file, one line for each hierarchy
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 02/16] blkcg: Added a app identifier support for blkcg
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Muneendra

[-- Attachment #1: Type: text/plain, Size: 4982 bytes --]

This Patch added a unique application identifier i.e
fc_app_id  member in blkcg which allows identification of traffic
sources at an individual cgroup based Applications
(ex:virtual machine (VM))level in both host and
fabric infrastructure.

Added a new function blkcg_get_fc_appid to
grab the app identifier associated with a bio.

Added a new function blkcg_set_fc_appid to
set the app identifier in a blkcgrp associated with cgroup id

Added a new config BLK_CGROUP_FC_APPID and moved the changes
under this config

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
Renamed the arguments appropriatley
Renamed APPID_LEN  to FC_APPID_LEN
Moved the input validation at the begining of the function
Modified the comments

v4:
No change

v3:
Renamed the functions and app_id to more specific

Addressed the reference leaks in blkcg_set_app_identifier

Added a new config BLK_CGROUP_FC_APPID and moved the changes
under this config

Added blkcg_get_fc_appid,blkcg_set_fc_appid as inline functions

v2:
renamed app_identifier to app_id
removed the  sysfs interface blkio.app_identifie under
---
 block/Kconfig              |  9 ++++++
 include/linux/blk-cgroup.h | 56 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/block/Kconfig b/block/Kconfig
index a2297edfdde8..1920388fb0e9 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -144,6 +144,15 @@ config BLK_CGROUP_IOLATENCY
 
 	Note, this is an experimental interface and could be changed someday.
 
+config BLK_CGROUP_FC_APPID
+	bool "Enable support to track FC io Traffic across cgroup applications"
+	depends on BLK_CGROUP=y
+	help
+	Enabling this option enables the support to track FC io traffic across
+	cgroup applications.It enables the Fabric and the storage targets to
+	identify, monitor, and handle FC traffic based on vm tags by inserting
+	application specific identification into the FC frame.
+
 config BLK_CGROUP_IOCOST
 	bool "Enable support for cost model based cgroup IO controller"
 	depends on BLK_CGROUP=y
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index c8fc9792ac77..216ca0d5eda7 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -30,6 +30,8 @@
 
 /* Max limits for throttle policy */
 #define THROTL_IOPS_MAX		UINT_MAX
+#define FC_APPID_LEN              129
+
 
 #ifdef CONFIG_BLK_CGROUP
 
@@ -55,6 +57,9 @@ struct blkcg {
 	struct blkcg_policy_data	*cpd[BLKCG_MAX_POLS];
 
 	struct list_head		all_blkcgs_node;
+#ifdef CONFIG_BLK_CGROUP_FC_APPID
+	char                            fc_app_id[FC_APPID_LEN];
+#endif
 #ifdef CONFIG_CGROUP_WRITEBACK
 	struct list_head		cgwb_list;
 #endif
@@ -660,4 +665,55 @@ static inline void blk_cgroup_bio_start(struct bio *bio) { }
 
 #endif	/* CONFIG_BLOCK */
 #endif	/* CONFIG_BLK_CGROUP */
+
+#ifdef CONFIG_BLK_CGROUP_FC_APPID
+/*
+ * Sets the fc_app_id field associted to blkcg
+ * @app_id: application identifier
+ * @cgrp_id: cgroup id
+ * @app_id_len: size of application identifier
+ */
+static inline int blkcg_set_fc_appid(char *app_id, u64 cgrp_id, size_t app_id_len)
+{
+	struct cgroup *cgrp;
+	struct cgroup_subsys_state *css;
+	struct blkcg *blkcg;
+	int ret  = 0;
+
+	if (app_id_len > FC_APPID_LEN)
+		return -EINVAL;
+
+	cgrp = cgroup_get_from_id(cgrp_id);
+	if (!cgrp)
+		return -ENOENT;
+	css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
+	if (!css) {
+		ret = -ENOENT;
+		goto out_cgrp_put;
+	}
+	blkcg = css_to_blkcg(css);
+	strlcpy(blkcg->fc_app_id, app_id, app_id_len);
+	css_put(css);
+out_cgrp_put:
+	cgroup_put(cgrp);
+	return ret;
+}
+
+/**
+ * blkcg_get_fc_appid - get the fc app identifier associated with a bio
+ * @bio: target bio
+ *
+ * On success it returns the fc_app_id on failure it returns NULL
+ */
+static inline char *blkcg_get_fc_appid(struct bio *bio)
+{
+	if (bio && bio->bi_blkg &&
+		(bio->bi_blkg->blkcg->fc_app_id[0] != '\0'))
+		return bio->bi_blkg->blkcg->fc_app_id;
+	return NULL;
+}
+#else
+static inline int blkcg_set_fc_appid(char *buf, u64 id, size_t len) { return -EINVAL; }
+static inline char *blkcg_get_fc_appid(struct bio *bio) { return NULL; }
+#endif /*CONFIG_BLK_CGROUP_FC_APPID*/
 #endif	/* _BLK_CGROUP_H */
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 02/16] blkcg: Added a app identifier support for blkcg
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Muneendra


[-- Attachment #1.1: Type: text/plain, Size: 4982 bytes --]

This Patch added a unique application identifier i.e
fc_app_id  member in blkcg which allows identification of traffic
sources at an individual cgroup based Applications
(ex:virtual machine (VM))level in both host and
fabric infrastructure.

Added a new function blkcg_get_fc_appid to
grab the app identifier associated with a bio.

Added a new function blkcg_set_fc_appid to
set the app identifier in a blkcgrp associated with cgroup id

Added a new config BLK_CGROUP_FC_APPID and moved the changes
under this config

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
Renamed the arguments appropriatley
Renamed APPID_LEN  to FC_APPID_LEN
Moved the input validation at the begining of the function
Modified the comments

v4:
No change

v3:
Renamed the functions and app_id to more specific

Addressed the reference leaks in blkcg_set_app_identifier

Added a new config BLK_CGROUP_FC_APPID and moved the changes
under this config

Added blkcg_get_fc_appid,blkcg_set_fc_appid as inline functions

v2:
renamed app_identifier to app_id
removed the  sysfs interface blkio.app_identifie under
---
 block/Kconfig              |  9 ++++++
 include/linux/blk-cgroup.h | 56 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/block/Kconfig b/block/Kconfig
index a2297edfdde8..1920388fb0e9 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -144,6 +144,15 @@ config BLK_CGROUP_IOLATENCY
 
 	Note, this is an experimental interface and could be changed someday.
 
+config BLK_CGROUP_FC_APPID
+	bool "Enable support to track FC io Traffic across cgroup applications"
+	depends on BLK_CGROUP=y
+	help
+	Enabling this option enables the support to track FC io traffic across
+	cgroup applications.It enables the Fabric and the storage targets to
+	identify, monitor, and handle FC traffic based on vm tags by inserting
+	application specific identification into the FC frame.
+
 config BLK_CGROUP_IOCOST
 	bool "Enable support for cost model based cgroup IO controller"
 	depends on BLK_CGROUP=y
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index c8fc9792ac77..216ca0d5eda7 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -30,6 +30,8 @@
 
 /* Max limits for throttle policy */
 #define THROTL_IOPS_MAX		UINT_MAX
+#define FC_APPID_LEN              129
+
 
 #ifdef CONFIG_BLK_CGROUP
 
@@ -55,6 +57,9 @@ struct blkcg {
 	struct blkcg_policy_data	*cpd[BLKCG_MAX_POLS];
 
 	struct list_head		all_blkcgs_node;
+#ifdef CONFIG_BLK_CGROUP_FC_APPID
+	char                            fc_app_id[FC_APPID_LEN];
+#endif
 #ifdef CONFIG_CGROUP_WRITEBACK
 	struct list_head		cgwb_list;
 #endif
@@ -660,4 +665,55 @@ static inline void blk_cgroup_bio_start(struct bio *bio) { }
 
 #endif	/* CONFIG_BLOCK */
 #endif	/* CONFIG_BLK_CGROUP */
+
+#ifdef CONFIG_BLK_CGROUP_FC_APPID
+/*
+ * Sets the fc_app_id field associted to blkcg
+ * @app_id: application identifier
+ * @cgrp_id: cgroup id
+ * @app_id_len: size of application identifier
+ */
+static inline int blkcg_set_fc_appid(char *app_id, u64 cgrp_id, size_t app_id_len)
+{
+	struct cgroup *cgrp;
+	struct cgroup_subsys_state *css;
+	struct blkcg *blkcg;
+	int ret  = 0;
+
+	if (app_id_len > FC_APPID_LEN)
+		return -EINVAL;
+
+	cgrp = cgroup_get_from_id(cgrp_id);
+	if (!cgrp)
+		return -ENOENT;
+	css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
+	if (!css) {
+		ret = -ENOENT;
+		goto out_cgrp_put;
+	}
+	blkcg = css_to_blkcg(css);
+	strlcpy(blkcg->fc_app_id, app_id, app_id_len);
+	css_put(css);
+out_cgrp_put:
+	cgroup_put(cgrp);
+	return ret;
+}
+
+/**
+ * blkcg_get_fc_appid - get the fc app identifier associated with a bio
+ * @bio: target bio
+ *
+ * On success it returns the fc_app_id on failure it returns NULL
+ */
+static inline char *blkcg_get_fc_appid(struct bio *bio)
+{
+	if (bio && bio->bi_blkg &&
+		(bio->bi_blkg->blkcg->fc_app_id[0] != '\0'))
+		return bio->bi_blkg->blkcg->fc_app_id;
+	return NULL;
+}
+#else
+static inline int blkcg_set_fc_appid(char *buf, u64 id, size_t len) { return -EINVAL; }
+static inline char *blkcg_get_fc_appid(struct bio *bio) { return NULL; }
+#endif /*CONFIG_BLK_CGROUP_FC_APPID*/
 #endif	/* _BLK_CGROUP_H */
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 03/16] nvme: Added a newsysfs attribute appid_store
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Muneendra

[-- Attachment #1: Type: text/plain, Size: 4111 bytes --]

Added a new sysfs attribute appid_store under
/sys/class/fc/fc_udev_device/*

With this new interface the user can set the application identfier
in  the blkcg associted with cgroup id.

Once the application identifer has set with this interface it allows
identification of traffic sources at an individual cgroup based
Applications (ex:virtual machine (VM))level in both host and
fabric infrastructure(FC).

Below is the interface provided to set the app_id

echo "<cgroupid>:<appid>" >> /sys/class/fc/fc_udev_device/appid_store
echo "457E:100000109b521d27" >> /sys/class/fc/fc_udev_device/appid_store

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
Replaced APPID_LEN with FC_APPID_LEN

v4:
No change

v3:
Replaced blkcg_set_app_identifier function with blkcg_set_fc_appid

v2:
New Patch
---
 drivers/nvme/host/fc.c | 73 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 72 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 3c002bdcace3..ed689ba773b1 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -9,7 +9,7 @@
 #include <uapi/scsi/fc/fc_els.h>
 #include <linux/delay.h>
 #include <linux/overflow.h>
-
+#include <linux/blk-cgroup.h>
 #include "nvme.h"
 #include "fabrics.h"
 #include <linux/nvme-fc-driver.h>
@@ -3821,10 +3821,81 @@ static ssize_t nvme_fc_nvme_discovery_store(struct device *dev,
 
 	return count;
 }
+
+/*parse the Cgroup id from a buf and returns the length of cgrpid*/
+static int fc_parse_cgrpid(const char *buf, u64 *id)
+{
+	char cgrp_id[16+1];
+	int cgrpid_len, j;
+
+	memset(cgrp_id, 0x0, sizeof(cgrp_id));
+	for (cgrpid_len = 0, j = 0; cgrpid_len < 17; cgrpid_len++) {
+		if (buf[cgrpid_len] != ':')
+			cgrp_id[cgrpid_len] = buf[cgrpid_len];
+		else {
+			j = 1;
+			break;
+		}
+	}
+	if (!j)
+		return -EINVAL;
+	if (kstrtou64(cgrp_id, 16, id) < 0)
+		return -EINVAL;
+	return cgrpid_len;
+}
+
+/*
+ * fc_update_appid :parses and updates the appid in the blkcg associated with
+ * cgroupid.
+ * @buf: buf contains both cgrpid and appid info
+ * @count: size of the buffer
+ */
+static int fc_update_appid(const char *buf, size_t count)
+{
+	u64 cgrp_id;
+	int appid_len = 0;
+	int cgrpid_len = 0;
+	char app_id[FC_APPID_LEN];
+	int ret = 0;
+
+	if (buf[count-1] == '\n')
+		count--;
+
+	if ((count > (16+1+FC_APPID_LEN)) || (!strchr(buf, ':')))
+		return -EINVAL;
+
+	cgrpid_len = fc_parse_cgrpid(buf, &cgrp_id);
+	if (cgrpid_len < 0)
+		return -EINVAL;
+	/*appid len is count - cgrpid_len -1 (: + \n) */
+	appid_len = count - cgrpid_len - 1;
+	if (appid_len > FC_APPID_LEN)
+		return -EINVAL;
+
+	memset(app_id, 0x0, sizeof(app_id));
+	memcpy(app_id, &buf[cgrpid_len+1], appid_len);
+	ret = blkcg_set_fc_appid(app_id, cgrp_id, sizeof(app_id));
+	if (ret < 0)
+		return ret;
+	return count;
+}
+
+static ssize_t fc_appid_store(struct device *dev,
+		struct device_attribute *attr, const char *buf, size_t count)
+{
+	int ret  = 0;
+
+	ret = fc_update_appid(buf, count);
+	if (ret < 0)
+		return -EINVAL;
+	return count;
+}
 static DEVICE_ATTR(nvme_discovery, 0200, NULL, nvme_fc_nvme_discovery_store);
+static DEVICE_ATTR(appid_store, 0200, NULL, fc_appid_store);
 
 static struct attribute *nvme_fc_attrs[] = {
 	&dev_attr_nvme_discovery.attr,
+	&dev_attr_appid_store.attr,
 	NULL
 };
 
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 03/16] nvme: Added a newsysfs attribute appid_store
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Muneendra


[-- Attachment #1.1: Type: text/plain, Size: 4111 bytes --]

Added a new sysfs attribute appid_store under
/sys/class/fc/fc_udev_device/*

With this new interface the user can set the application identfier
in  the blkcg associted with cgroup id.

Once the application identifer has set with this interface it allows
identification of traffic sources at an individual cgroup based
Applications (ex:virtual machine (VM))level in both host and
fabric infrastructure(FC).

Below is the interface provided to set the app_id

echo "<cgroupid>:<appid>" >> /sys/class/fc/fc_udev_device/appid_store
echo "457E:100000109b521d27" >> /sys/class/fc/fc_udev_device/appid_store

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
Replaced APPID_LEN with FC_APPID_LEN

v4:
No change

v3:
Replaced blkcg_set_app_identifier function with blkcg_set_fc_appid

v2:
New Patch
---
 drivers/nvme/host/fc.c | 73 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 72 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 3c002bdcace3..ed689ba773b1 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -9,7 +9,7 @@
 #include <uapi/scsi/fc/fc_els.h>
 #include <linux/delay.h>
 #include <linux/overflow.h>
-
+#include <linux/blk-cgroup.h>
 #include "nvme.h"
 #include "fabrics.h"
 #include <linux/nvme-fc-driver.h>
@@ -3821,10 +3821,81 @@ static ssize_t nvme_fc_nvme_discovery_store(struct device *dev,
 
 	return count;
 }
+
+/*parse the Cgroup id from a buf and returns the length of cgrpid*/
+static int fc_parse_cgrpid(const char *buf, u64 *id)
+{
+	char cgrp_id[16+1];
+	int cgrpid_len, j;
+
+	memset(cgrp_id, 0x0, sizeof(cgrp_id));
+	for (cgrpid_len = 0, j = 0; cgrpid_len < 17; cgrpid_len++) {
+		if (buf[cgrpid_len] != ':')
+			cgrp_id[cgrpid_len] = buf[cgrpid_len];
+		else {
+			j = 1;
+			break;
+		}
+	}
+	if (!j)
+		return -EINVAL;
+	if (kstrtou64(cgrp_id, 16, id) < 0)
+		return -EINVAL;
+	return cgrpid_len;
+}
+
+/*
+ * fc_update_appid :parses and updates the appid in the blkcg associated with
+ * cgroupid.
+ * @buf: buf contains both cgrpid and appid info
+ * @count: size of the buffer
+ */
+static int fc_update_appid(const char *buf, size_t count)
+{
+	u64 cgrp_id;
+	int appid_len = 0;
+	int cgrpid_len = 0;
+	char app_id[FC_APPID_LEN];
+	int ret = 0;
+
+	if (buf[count-1] == '\n')
+		count--;
+
+	if ((count > (16+1+FC_APPID_LEN)) || (!strchr(buf, ':')))
+		return -EINVAL;
+
+	cgrpid_len = fc_parse_cgrpid(buf, &cgrp_id);
+	if (cgrpid_len < 0)
+		return -EINVAL;
+	/*appid len is count - cgrpid_len -1 (: + \n) */
+	appid_len = count - cgrpid_len - 1;
+	if (appid_len > FC_APPID_LEN)
+		return -EINVAL;
+
+	memset(app_id, 0x0, sizeof(app_id));
+	memcpy(app_id, &buf[cgrpid_len+1], appid_len);
+	ret = blkcg_set_fc_appid(app_id, cgrp_id, sizeof(app_id));
+	if (ret < 0)
+		return ret;
+	return count;
+}
+
+static ssize_t fc_appid_store(struct device *dev,
+		struct device_attribute *attr, const char *buf, size_t count)
+{
+	int ret  = 0;
+
+	ret = fc_update_appid(buf, count);
+	if (ret < 0)
+		return -EINVAL;
+	return count;
+}
 static DEVICE_ATTR(nvme_discovery, 0200, NULL, nvme_fc_nvme_discovery_store);
+static DEVICE_ATTR(appid_store, 0200, NULL, fc_appid_store);
 
 static struct attribute *nvme_fc_attrs[] = {
 	&dev_attr_nvme_discovery.attr,
+	&dev_attr_appid_store.attr,
 	NULL
 };
 
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 04/16] lpfc: vmid: Add the datastructure for supporting VMID in lpfc
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 6170 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch adds the primary datastructures needed to implement VMID in lpfc
driver. It maintains the capability, current state, hash table for the
vmid/appid along with other information.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No Change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
Removed unused variable.
---
 drivers/scsi/lpfc/lpfc.h | 97 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index a54c8da30273..ab61352363d4 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -303,6 +303,63 @@ struct lpfc_stats {
 struct lpfc_hba;
 
 
+#define LPFC_VMID_TIMER   300	/* timer interval in seconds. */
+
+#define LPFC_MAX_VMID_SIZE      256
+#define LPFC_COMPRESS_VMID_SIZE 16
+
+union lpfc_vmid_io_tag {
+	u32 app_id;	/* App Id vmid */
+	u8 cs_ctl_vmid;	/* Priority tag vmid */
+};
+
+#define JIFFIES_PER_HR	(HZ * 60 * 60)
+
+struct lpfc_vmid {
+	u8 flag;
+#define LPFC_VMID_SLOT_FREE     0x0
+#define LPFC_VMID_SLOT_USED     0x1
+#define LPFC_VMID_REQ_REGISTER  0x2
+#define LPFC_VMID_REGISTERED    0x4
+#define LPFC_VMID_DE_REGISTER   0x8
+	u8 host_vmid[LPFC_MAX_VMID_SIZE];
+	union lpfc_vmid_io_tag un;
+	u64 io_rd_cnt;
+	u64 io_wr_cnt;
+	u8 vmid_len;
+	u8 delete_inactive; /* Delete if inactive flag 0 = no, 1 = yes */
+	u32 hash_index;
+	u64 __percpu *last_io_time;
+};
+
+#define lpfc_vmid_is_type_priority_tag(vport)\
+	(vport->vmid_priority_tagging ? 1 : 0)
+
+#define LPFC_VMID_HASH_SIZE     256
+#define LPFC_VMID_HASH_MASK     255
+#define LPFC_VMID_HASH_SHIFT    6
+
+struct lpfc_vmid_context {
+	struct lpfc_vmid *vmp;
+	struct lpfc_nodelist *nlp;
+	u8 instantiated;
+};
+
+struct lpfc_vmid_priority_range {
+	u8 low;
+	u8 high;
+	u8 qos;
+};
+
+struct lpfc_vmid_priority_info {
+	u32 num_descriptors;
+	struct lpfc_vmid_priority_range *vmid_range;
+};
+
+#define QFPA_EVEN_ONLY 0x01
+#define QFPA_ODD_ONLY  0x02
+#define QFPA_EVEN_ODD  0x03
+
 enum discovery_state {
 	LPFC_VPORT_UNKNOWN     =  0,    /* vport state is unknown */
 	LPFC_VPORT_FAILED      =  1,    /* vport has failed */
@@ -442,6 +499,9 @@ struct lpfc_vport {
 #define WORKER_RAMP_DOWN_QUEUE         0x800	/* hba: Decrease Q depth */
 #define WORKER_RAMP_UP_QUEUE           0x1000	/* hba: Increase Q depth */
 #define WORKER_SERVICE_TXQ             0x2000	/* hba: IOCBs on the txq */
+#define WORKER_CHECK_INACTIVE_VMID     0x4000	/* hba: check inactive vmids */
+#define WORKER_CHECK_VMID_ISSUE_QFPA   0x8000	/* vport: Check if qfpa need */
+						/* to issue */
 
 	struct timer_list els_tmofunc;
 	struct timer_list delayed_disc_tmo;
@@ -452,6 +512,8 @@ struct lpfc_vport {
 #define FC_LOADING		0x1	/* HBA in process of loading drvr */
 #define FC_UNLOADING		0x2	/* HBA in process of unloading drvr */
 #define FC_ALLOW_FDMI		0x4	/* port is ready for FDMI requests */
+#define FC_ALLOW_VMID		0x8	/* Allow VMID IO's */
+#define FC_DEREGISTER_ALL_APP_ID	0x10	/* Deregister all vmid's */
 	/* Vport Config Parameters */
 	uint32_t cfg_scan_down;
 	uint32_t cfg_lun_queue_depth;
@@ -470,9 +532,36 @@ struct lpfc_vport {
 	uint32_t cfg_tgt_queue_depth;
 	uint32_t cfg_first_burst_size;
 	uint32_t dev_loss_tmo_changed;
+	/* VMID parameters */
+	u8 lpfc_vmid_host_uuid[LPFC_COMPRESS_VMID_SIZE];
+	u32 max_vmid;	/* maximum VMIDs allowed per port */
+	u32 cur_vmid_cnt;	/* Current VMID count */
+#define LPFC_MIN_VMID	4
+#define LPFC_MAX_VMID	255
+	u32 vmid_inactivity_timeout;	/* Time after which the VMID */
+						/* deregisters from switch */
+	u32 vmid_priority_tagging;
+#define LPFC_VMID_PRIO_TAG_DISABLE	0 /* Disable */
+#define LPFC_VMID_PRIO_TAG_SUP_TARGETS	1 /* Allow supported targets only */
+#define LPFC_VMID_PRIO_TAG_ALL_TARGETS	2 /* Allow all targets */
+	unsigned long *vmid_priority_range;
+#define LPFC_VMID_MAX_PRIORITY_RANGE    256
+#define LPFC_VMID_PRIORITY_BITMAP_SIZE  32
+	u8 vmid_flag;
+#define LPFC_VMID_IN_USE		0x1
+#define LPFC_VMID_ISSUE_QFPA		0x2
+#define LPFC_VMID_QFPA_CMPL		0x4
+#define LPFC_VMID_QOS_ENABLED		0x8
+#define LPFC_VMID_TIMER_ENBLD		0x10
+	struct fc_qfpa_res *qfpa_res;
 
 	struct fc_vport *fc_vport;
 
+	struct lpfc_vmid *vmid;
+	struct lpfc_vmid *hash_table[LPFC_VMID_HASH_SIZE];
+	rwlock_t vmid_lock;
+	struct lpfc_vmid_priority_info vmid_priority;
+
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
 	struct dentry *debug_disc_trc;
 	struct dentry *debug_nodelist;
@@ -934,6 +1023,13 @@ struct lpfc_hba {
 	struct nvmet_fc_target_port *targetport;
 	lpfc_vpd_t vpd;		/* vital product data */
 
+	u32 cfg_max_vmid;	/* maximum VMIDs allowed per port */
+	u32 cfg_vmid_app_header;
+#define LPFC_VMID_APP_HEADER_DISABLE	0
+#define LPFC_VMID_APP_HEADER_ENABLE	1
+	u32 cfg_vmid_priority_tagging;
+	u32 cfg_vmid_inactivity_timeout;	/* Time after which the VMID */
+						/*  deregisters from switch */
 	struct pci_dev *pcidev;
 	struct list_head      work_list;
 	uint32_t              work_ha;      /* Host Attention Bits for WT */
@@ -1175,6 +1271,7 @@ struct lpfc_hba {
 	struct list_head ct_ev_waiters;
 	struct unsol_rcv_ct_ctx ct_ctx[LPFC_CT_CTX_MAX];
 	uint32_t ctx_idx;
+	struct timer_list inactive_vmid_poll;
 
 	/* RAS Support */
 	struct lpfc_ras_fwlog ras_fwlog;
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 04/16] lpfc: vmid: Add the datastructure for supporting VMID in lpfc
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 6170 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch adds the primary datastructures needed to implement VMID in lpfc
driver. It maintains the capability, current state, hash table for the
vmid/appid along with other information.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No Change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
Removed unused variable.
---
 drivers/scsi/lpfc/lpfc.h | 97 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index a54c8da30273..ab61352363d4 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -303,6 +303,63 @@ struct lpfc_stats {
 struct lpfc_hba;
 
 
+#define LPFC_VMID_TIMER   300	/* timer interval in seconds. */
+
+#define LPFC_MAX_VMID_SIZE      256
+#define LPFC_COMPRESS_VMID_SIZE 16
+
+union lpfc_vmid_io_tag {
+	u32 app_id;	/* App Id vmid */
+	u8 cs_ctl_vmid;	/* Priority tag vmid */
+};
+
+#define JIFFIES_PER_HR	(HZ * 60 * 60)
+
+struct lpfc_vmid {
+	u8 flag;
+#define LPFC_VMID_SLOT_FREE     0x0
+#define LPFC_VMID_SLOT_USED     0x1
+#define LPFC_VMID_REQ_REGISTER  0x2
+#define LPFC_VMID_REGISTERED    0x4
+#define LPFC_VMID_DE_REGISTER   0x8
+	u8 host_vmid[LPFC_MAX_VMID_SIZE];
+	union lpfc_vmid_io_tag un;
+	u64 io_rd_cnt;
+	u64 io_wr_cnt;
+	u8 vmid_len;
+	u8 delete_inactive; /* Delete if inactive flag 0 = no, 1 = yes */
+	u32 hash_index;
+	u64 __percpu *last_io_time;
+};
+
+#define lpfc_vmid_is_type_priority_tag(vport)\
+	(vport->vmid_priority_tagging ? 1 : 0)
+
+#define LPFC_VMID_HASH_SIZE     256
+#define LPFC_VMID_HASH_MASK     255
+#define LPFC_VMID_HASH_SHIFT    6
+
+struct lpfc_vmid_context {
+	struct lpfc_vmid *vmp;
+	struct lpfc_nodelist *nlp;
+	u8 instantiated;
+};
+
+struct lpfc_vmid_priority_range {
+	u8 low;
+	u8 high;
+	u8 qos;
+};
+
+struct lpfc_vmid_priority_info {
+	u32 num_descriptors;
+	struct lpfc_vmid_priority_range *vmid_range;
+};
+
+#define QFPA_EVEN_ONLY 0x01
+#define QFPA_ODD_ONLY  0x02
+#define QFPA_EVEN_ODD  0x03
+
 enum discovery_state {
 	LPFC_VPORT_UNKNOWN     =  0,    /* vport state is unknown */
 	LPFC_VPORT_FAILED      =  1,    /* vport has failed */
@@ -442,6 +499,9 @@ struct lpfc_vport {
 #define WORKER_RAMP_DOWN_QUEUE         0x800	/* hba: Decrease Q depth */
 #define WORKER_RAMP_UP_QUEUE           0x1000	/* hba: Increase Q depth */
 #define WORKER_SERVICE_TXQ             0x2000	/* hba: IOCBs on the txq */
+#define WORKER_CHECK_INACTIVE_VMID     0x4000	/* hba: check inactive vmids */
+#define WORKER_CHECK_VMID_ISSUE_QFPA   0x8000	/* vport: Check if qfpa need */
+						/* to issue */
 
 	struct timer_list els_tmofunc;
 	struct timer_list delayed_disc_tmo;
@@ -452,6 +512,8 @@ struct lpfc_vport {
 #define FC_LOADING		0x1	/* HBA in process of loading drvr */
 #define FC_UNLOADING		0x2	/* HBA in process of unloading drvr */
 #define FC_ALLOW_FDMI		0x4	/* port is ready for FDMI requests */
+#define FC_ALLOW_VMID		0x8	/* Allow VMID IO's */
+#define FC_DEREGISTER_ALL_APP_ID	0x10	/* Deregister all vmid's */
 	/* Vport Config Parameters */
 	uint32_t cfg_scan_down;
 	uint32_t cfg_lun_queue_depth;
@@ -470,9 +532,36 @@ struct lpfc_vport {
 	uint32_t cfg_tgt_queue_depth;
 	uint32_t cfg_first_burst_size;
 	uint32_t dev_loss_tmo_changed;
+	/* VMID parameters */
+	u8 lpfc_vmid_host_uuid[LPFC_COMPRESS_VMID_SIZE];
+	u32 max_vmid;	/* maximum VMIDs allowed per port */
+	u32 cur_vmid_cnt;	/* Current VMID count */
+#define LPFC_MIN_VMID	4
+#define LPFC_MAX_VMID	255
+	u32 vmid_inactivity_timeout;	/* Time after which the VMID */
+						/* deregisters from switch */
+	u32 vmid_priority_tagging;
+#define LPFC_VMID_PRIO_TAG_DISABLE	0 /* Disable */
+#define LPFC_VMID_PRIO_TAG_SUP_TARGETS	1 /* Allow supported targets only */
+#define LPFC_VMID_PRIO_TAG_ALL_TARGETS	2 /* Allow all targets */
+	unsigned long *vmid_priority_range;
+#define LPFC_VMID_MAX_PRIORITY_RANGE    256
+#define LPFC_VMID_PRIORITY_BITMAP_SIZE  32
+	u8 vmid_flag;
+#define LPFC_VMID_IN_USE		0x1
+#define LPFC_VMID_ISSUE_QFPA		0x2
+#define LPFC_VMID_QFPA_CMPL		0x4
+#define LPFC_VMID_QOS_ENABLED		0x8
+#define LPFC_VMID_TIMER_ENBLD		0x10
+	struct fc_qfpa_res *qfpa_res;
 
 	struct fc_vport *fc_vport;
 
+	struct lpfc_vmid *vmid;
+	struct lpfc_vmid *hash_table[LPFC_VMID_HASH_SIZE];
+	rwlock_t vmid_lock;
+	struct lpfc_vmid_priority_info vmid_priority;
+
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
 	struct dentry *debug_disc_trc;
 	struct dentry *debug_nodelist;
@@ -934,6 +1023,13 @@ struct lpfc_hba {
 	struct nvmet_fc_target_port *targetport;
 	lpfc_vpd_t vpd;		/* vital product data */
 
+	u32 cfg_max_vmid;	/* maximum VMIDs allowed per port */
+	u32 cfg_vmid_app_header;
+#define LPFC_VMID_APP_HEADER_DISABLE	0
+#define LPFC_VMID_APP_HEADER_ENABLE	1
+	u32 cfg_vmid_priority_tagging;
+	u32 cfg_vmid_inactivity_timeout;	/* Time after which the VMID */
+						/*  deregisters from switch */
 	struct pci_dev *pcidev;
 	struct list_head      work_list;
 	uint32_t              work_ha;      /* Host Attention Bits for WT */
@@ -1175,6 +1271,7 @@ struct lpfc_hba {
 	struct list_head ct_ev_waiters;
 	struct unsol_rcv_ct_ctx ct_ctx[LPFC_CT_CTX_MAX];
 	uint32_t ctx_idx;
+	struct timer_list inactive_vmid_poll;
 
 	/* RAS Support */
 	struct lpfc_ras_fwlog ras_fwlog;
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 05/16] lpfc: vmid: Supplementary data structures for vmid and APIs
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 10381 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch adds additional data structures for supporting the
two versions of vmid implementation. First type uses app header
while the other types uses priority tagging mechanism.
These data structures are used mostly for ELS and
CT commands for the two vmid implementation.

The API determines if VMID is enabled by the user or not.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Merged the patch5 of v4 to this patch
Uniform data type naming scheme

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc.h      |  24 +++++++
 drivers/scsi/lpfc/lpfc_disc.h |   1 +
 drivers/scsi/lpfc/lpfc_hw.h   | 124 ++++++++++++++++++++++++++++++++--
 drivers/scsi/lpfc/lpfc_sli.h  |   8 +++
 4 files changed, 153 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index ab61352363d4..6d9617c47db0 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -1513,3 +1513,27 @@ static const char *routine(enum enum_name table_key)			\
 	}								\
 	return name;							\
 }
+
+/**
+ * lpfc_is_vmid_enabled - returns if VMID is enabled for either switch types
+ * @phba: Pointer to HBA context object.
+ *
+ * Relationship between the enable, target support and if vmid tag is required
+ * for the particular combination
+ * ---------------------------------------------------
+ * Switch    Enable Flag  Target Support  VMID Needed
+ * ---------------------------------------------------
+ * App Id     0              NA              N
+ * App Id     1               0              N
+ * App Id     1               1              Y
+ * Pr Tag     0              NA              N
+ * Pr Tag     1               0              N
+ * Pr Tag     1               1              Y
+ * Pr Tag     2               *              Y
+ ---------------------------------------------------
+ *
+ **/
+static inline int lpfc_is_vmid_enabled(struct lpfc_hba *phba)
+{
+	return phba->cfg_vmid_app_header || phba->cfg_vmid_priority_tagging;
+}
diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h
index ea07afcb750a..25d119c005dd 100644
--- a/drivers/scsi/lpfc/lpfc_disc.h
+++ b/drivers/scsi/lpfc/lpfc_disc.h
@@ -117,6 +117,7 @@ struct lpfc_nodelist {
 	uint8_t         nlp_fcp_info;	        /* class info, bits 0-3 */
 #define NLP_FCP_2_DEVICE   0x10			/* FCP-2 device */
 	u8		nlp_nvme_info;	        /* NVME NSLER Support */
+	uint8_t		vmid_support;		/* destination VMID support */
 #define NLP_NVME_NSLER     0x1			/* NVME NSLER device */
 
 	struct timer_list   nlp_delayfunc;	/* Used for delayed ELS cmds */
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 42682d95af52..4a5a85ed42ec 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -275,6 +275,7 @@ struct lpfc_sli_ct_request {
 #define  SLI_CT_ACCESS_DENIED             0x10
 #define  SLI_CT_INVALID_PORT_ID           0x11
 #define  SLI_CT_DATABASE_EMPTY            0x12
+#define  SLI_CT_APP_ID_NOT_AVAILABLE      0x40
 
 /*
  * Name Server Command Codes
@@ -400,16 +401,16 @@ struct csp {
 	uint16_t altBbCredit:1;	/* FC Word 1, bit 27 */
 	uint16_t edtovResolution:1;	/* FC Word 1, bit 26 */
 	uint16_t multicast:1;	/* FC Word 1, bit 25 */
-	uint16_t broadcast:1;	/* FC Word 1, bit 24 */
+	uint16_t app_hdr_support:1;	/* FC Word 1, bit 24 */
 
-	uint16_t huntgroup:1;	/* FC Word 1, bit 23 */
+	uint16_t priority_tagging:1;	/* FC Word 1, bit 23 */
 	uint16_t simplex:1;	/* FC Word 1, bit 22 */
 	uint16_t word1Reserved1:3;	/* FC Word 1, bit 21:19 */
 	uint16_t dhd:1;		/* FC Word 1, bit 18 */
 	uint16_t contIncSeqCnt:1;	/* FC Word 1, bit 17 */
 	uint16_t payloadlength:1;	/* FC Word 1, bit 16 */
 #else	/*  __LITTLE_ENDIAN_BITFIELD */
-	uint16_t broadcast:1;	/* FC Word 1, bit 24 */
+	uint16_t app_hdr_support:1;	/* FC Word 1, bit 24 */
 	uint16_t multicast:1;	/* FC Word 1, bit 25 */
 	uint16_t edtovResolution:1;	/* FC Word 1, bit 26 */
 	uint16_t altBbCredit:1;	/* FC Word 1, bit 27 */
@@ -423,7 +424,7 @@ struct csp {
 	uint16_t dhd:1;		/* FC Word 1, bit 18 */
 	uint16_t word1Reserved1:3;	/* FC Word 1, bit 21:19 */
 	uint16_t simplex:1;	/* FC Word 1, bit 22 */
-	uint16_t huntgroup:1;	/* FC Word 1, bit 23 */
+	uint16_t priority_tagging:1;	/* FC Word 1, bit 23 */
 #endif
 
 	uint8_t bbRcvSizeMsb;	/* Upper nibble is reserved */
@@ -607,6 +608,8 @@ struct fc_vft_header {
 #define ELS_CMD_LIRR      0x7A000000
 #define ELS_CMD_LCB	  0x81000000
 #define ELS_CMD_FPIN	  0x16000000
+#define ELS_CMD_QFPA      0xB0000000
+#define ELS_CMD_UVEM      0xB1000000
 #else	/*  __LITTLE_ENDIAN_BITFIELD */
 #define ELS_CMD_MASK      0xffff
 #define ELS_RSP_MASK      0xff
@@ -649,6 +652,8 @@ struct fc_vft_header {
 #define ELS_CMD_LIRR      0x7A
 #define ELS_CMD_LCB	  0x81
 #define ELS_CMD_FPIN	  ELS_FPIN
+#define ELS_CMD_QFPA      0xB0
+#define ELS_CMD_UVEM      0xB1
 #endif
 
 /*
@@ -1317,6 +1322,117 @@ struct fc_rdp_res_frame {
 };
 
 
+/* UVEM */
+
+#define LPFC_UVEM_SIZE 60
+#define LPFC_UVEM_VEM_ID_DESC_SIZE 16
+#define LPFC_UVEM_VE_MAP_DESC_SIZE 20
+
+#define VEM_ID_DESC_TAG  0x0001000A
+struct lpfc_vem_id_desc {
+	uint32_t tag;
+	uint32_t length;
+	uint8_t vem_id[16];
+};
+
+#define LPFC_QFPA_SIZE	4
+
+#define INSTANTIATED_VE_DESC_TAG  0x0001000B
+struct instantiated_ve_desc {
+	uint32_t tag;
+	uint32_t length;
+	uint8_t global_vem_id[16];
+	uint32_t word6;
+#define lpfc_instantiated_local_id_SHIFT   0
+#define lpfc_instantiated_local_id_MASK    0x000000ff
+#define lpfc_instantiated_local_id_WORD    word6
+#define lpfc_instantiated_nport_id_SHIFT   8
+#define lpfc_instantiated_nport_id_MASK    0x00ffffff
+#define lpfc_instantiated_nport_id_WORD    word6
+};
+
+#define DEINSTANTIATED_VE_DESC_TAG  0x0001000C
+struct deinstantiated_ve_desc {
+	uint32_t tag;
+	uint32_t length;
+	uint8_t global_vem_id[16];
+	uint32_t word6;
+#define lpfc_deinstantiated_nport_id_SHIFT   0
+#define lpfc_deinstantiated_nport_id_MASK    0x000000ff
+#define lpfc_deinstantiated_nport_id_WORD    word6
+#define lpfc_deinstantiated_local_id_SHIFT   24
+#define lpfc_deinstantiated_local_id_MASK    0x00ffffff
+#define lpfc_deinstantiated_local_id_WORD    word6
+};
+
+/* Query Fabric Priority Allocation Response */
+#define LPFC_PRIORITY_RANGE_DESC_SIZE 12
+
+struct priority_range_desc {
+	uint32_t tag;
+	uint32_t length;
+	uint8_t lo_range;
+	uint8_t hi_range;
+	uint8_t qos_priority;
+	uint8_t local_ve_id;
+};
+
+struct fc_qfpa_res {
+	uint32_t reply_sequence;	/* LS_ACC or LS_RJT */
+	uint32_t length;	/* FC Word 1    */
+	struct priority_range_desc desc[1];
+};
+
+/* Application Server command code */
+/* VMID               */
+
+#define SLI_CT_APP_SEV_Subtypes     0x20	/* Application Server subtype */
+
+#define SLI_CTAS_GAPPIA_ENT    0x0100	/* Get Application Identifier */
+#define SLI_CTAS_GALLAPPIA     0x0101	/* Get All Application Identifier */
+#define SLI_CTAS_GALLAPPIA_ID  0x0102	/* Get All Application Identifier */
+					/* for Nport */
+#define SLI_CTAS_GAPPIA_IDAPP  0x0103	/* Get Application Identifier */
+					/* for Nport */
+#define SLI_CTAS_RAPP_IDENT    0x0200	/* Register Application Identifier */
+#define SLI_CTAS_DAPP_IDENT    0x0300	/* Deregister Application */
+					/* Identifier */
+#define SLI_CTAS_DALLAPP_ID    0x0301	/* Deregister All Application */
+					/* Identifier */
+
+struct entity_id_object {
+	uint8_t entity_id_len;
+	uint8_t entity_id[255];	/* VM UUID */
+};
+
+struct app_id_object {
+	uint32_t port_id;
+	uint32_t app_id;
+	struct entity_id_object obj;
+};
+
+struct lpfc_vmid_rapp_ident_list {
+	uint32_t no_of_objects;
+	struct entity_id_object obj[1];
+};
+
+struct lpfc_vmid_dapp_ident_list {
+	uint32_t no_of_objects;
+	struct entity_id_object obj[1];
+};
+
+#define GALLAPPIA_ID_LAST  0x80
+struct lpfc_vmid_gallapp_ident_list {
+	uint8_t control;
+	uint8_t reserved[3];
+	struct app_id_object app_id;
+};
+
+#define RAPP_IDENT_OFFSET  (offsetof(struct lpfc_sli_ct_request, un) + 4)
+#define DAPP_IDENT_OFFSET  (offsetof(struct lpfc_sli_ct_request, un) + 4)
+#define GALLAPPIA_ID_SIZE  (offsetof(struct lpfc_sli_ct_request, un) + 4)
+#define DALLAPP_ID_SIZE    (offsetof(struct lpfc_sli_ct_request, un) + 4)
+
 /******** FDMI ********/
 
 /* lpfc_sli_ct_request defines the CT_IU preamble for FDMI commands */
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h
index 4f6936014ff5..ff5a2a492405 100644
--- a/drivers/scsi/lpfc/lpfc_sli.h
+++ b/drivers/scsi/lpfc/lpfc_sli.h
@@ -35,6 +35,12 @@ typedef enum _lpfc_ctx_cmd {
 	LPFC_CTX_HOST
 } lpfc_ctx_cmd;
 
+union lpfc_vmid_iocb_tag {
+	uint32_t app_id;
+	uint8_t cs_ctl_vmid;
+	struct lpfc_vmid_context *vmid_context;	/* UVEM context information */
+};
+
 struct lpfc_cq_event {
 	struct list_head list;
 	uint16_t hdwq;
@@ -100,6 +106,7 @@ struct lpfc_iocbq {
 #define LPFC_IO_NVME	        0x200000 /* NVME FCP command */
 #define LPFC_IO_NVME_LS		0x400000 /* NVME LS command */
 #define LPFC_IO_NVMET		0x800000 /* NVMET command */
+#define LPFC_IO_VMID            0x1000000 /* VMID tagged IO */
 
 	uint32_t drvrTimeout;	/* driver timeout in seconds */
 	struct lpfc_vport *vport;/* virtual port pointer */
@@ -114,6 +121,7 @@ struct lpfc_iocbq {
 		struct lpfc_node_rrq *rrq;
 	} context_un;
 
+	union lpfc_vmid_iocb_tag vmid_tag;
 	void (*fabric_iocb_cmpl)(struct lpfc_hba *, struct lpfc_iocbq *,
 			   struct lpfc_iocbq *);
 	void (*wait_iocb_cmpl)(struct lpfc_hba *, struct lpfc_iocbq *,
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 05/16] lpfc: vmid: Supplementary data structures for vmid and APIs
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 10381 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch adds additional data structures for supporting the
two versions of vmid implementation. First type uses app header
while the other types uses priority tagging mechanism.
These data structures are used mostly for ELS and
CT commands for the two vmid implementation.

The API determines if VMID is enabled by the user or not.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Merged the patch5 of v4 to this patch
Uniform data type naming scheme

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc.h      |  24 +++++++
 drivers/scsi/lpfc/lpfc_disc.h |   1 +
 drivers/scsi/lpfc/lpfc_hw.h   | 124 ++++++++++++++++++++++++++++++++--
 drivers/scsi/lpfc/lpfc_sli.h  |   8 +++
 4 files changed, 153 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index ab61352363d4..6d9617c47db0 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -1513,3 +1513,27 @@ static const char *routine(enum enum_name table_key)			\
 	}								\
 	return name;							\
 }
+
+/**
+ * lpfc_is_vmid_enabled - returns if VMID is enabled for either switch types
+ * @phba: Pointer to HBA context object.
+ *
+ * Relationship between the enable, target support and if vmid tag is required
+ * for the particular combination
+ * ---------------------------------------------------
+ * Switch    Enable Flag  Target Support  VMID Needed
+ * ---------------------------------------------------
+ * App Id     0              NA              N
+ * App Id     1               0              N
+ * App Id     1               1              Y
+ * Pr Tag     0              NA              N
+ * Pr Tag     1               0              N
+ * Pr Tag     1               1              Y
+ * Pr Tag     2               *              Y
+ ---------------------------------------------------
+ *
+ **/
+static inline int lpfc_is_vmid_enabled(struct lpfc_hba *phba)
+{
+	return phba->cfg_vmid_app_header || phba->cfg_vmid_priority_tagging;
+}
diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h
index ea07afcb750a..25d119c005dd 100644
--- a/drivers/scsi/lpfc/lpfc_disc.h
+++ b/drivers/scsi/lpfc/lpfc_disc.h
@@ -117,6 +117,7 @@ struct lpfc_nodelist {
 	uint8_t         nlp_fcp_info;	        /* class info, bits 0-3 */
 #define NLP_FCP_2_DEVICE   0x10			/* FCP-2 device */
 	u8		nlp_nvme_info;	        /* NVME NSLER Support */
+	uint8_t		vmid_support;		/* destination VMID support */
 #define NLP_NVME_NSLER     0x1			/* NVME NSLER device */
 
 	struct timer_list   nlp_delayfunc;	/* Used for delayed ELS cmds */
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 42682d95af52..4a5a85ed42ec 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -275,6 +275,7 @@ struct lpfc_sli_ct_request {
 #define  SLI_CT_ACCESS_DENIED             0x10
 #define  SLI_CT_INVALID_PORT_ID           0x11
 #define  SLI_CT_DATABASE_EMPTY            0x12
+#define  SLI_CT_APP_ID_NOT_AVAILABLE      0x40
 
 /*
  * Name Server Command Codes
@@ -400,16 +401,16 @@ struct csp {
 	uint16_t altBbCredit:1;	/* FC Word 1, bit 27 */
 	uint16_t edtovResolution:1;	/* FC Word 1, bit 26 */
 	uint16_t multicast:1;	/* FC Word 1, bit 25 */
-	uint16_t broadcast:1;	/* FC Word 1, bit 24 */
+	uint16_t app_hdr_support:1;	/* FC Word 1, bit 24 */
 
-	uint16_t huntgroup:1;	/* FC Word 1, bit 23 */
+	uint16_t priority_tagging:1;	/* FC Word 1, bit 23 */
 	uint16_t simplex:1;	/* FC Word 1, bit 22 */
 	uint16_t word1Reserved1:3;	/* FC Word 1, bit 21:19 */
 	uint16_t dhd:1;		/* FC Word 1, bit 18 */
 	uint16_t contIncSeqCnt:1;	/* FC Word 1, bit 17 */
 	uint16_t payloadlength:1;	/* FC Word 1, bit 16 */
 #else	/*  __LITTLE_ENDIAN_BITFIELD */
-	uint16_t broadcast:1;	/* FC Word 1, bit 24 */
+	uint16_t app_hdr_support:1;	/* FC Word 1, bit 24 */
 	uint16_t multicast:1;	/* FC Word 1, bit 25 */
 	uint16_t edtovResolution:1;	/* FC Word 1, bit 26 */
 	uint16_t altBbCredit:1;	/* FC Word 1, bit 27 */
@@ -423,7 +424,7 @@ struct csp {
 	uint16_t dhd:1;		/* FC Word 1, bit 18 */
 	uint16_t word1Reserved1:3;	/* FC Word 1, bit 21:19 */
 	uint16_t simplex:1;	/* FC Word 1, bit 22 */
-	uint16_t huntgroup:1;	/* FC Word 1, bit 23 */
+	uint16_t priority_tagging:1;	/* FC Word 1, bit 23 */
 #endif
 
 	uint8_t bbRcvSizeMsb;	/* Upper nibble is reserved */
@@ -607,6 +608,8 @@ struct fc_vft_header {
 #define ELS_CMD_LIRR      0x7A000000
 #define ELS_CMD_LCB	  0x81000000
 #define ELS_CMD_FPIN	  0x16000000
+#define ELS_CMD_QFPA      0xB0000000
+#define ELS_CMD_UVEM      0xB1000000
 #else	/*  __LITTLE_ENDIAN_BITFIELD */
 #define ELS_CMD_MASK      0xffff
 #define ELS_RSP_MASK      0xff
@@ -649,6 +652,8 @@ struct fc_vft_header {
 #define ELS_CMD_LIRR      0x7A
 #define ELS_CMD_LCB	  0x81
 #define ELS_CMD_FPIN	  ELS_FPIN
+#define ELS_CMD_QFPA      0xB0
+#define ELS_CMD_UVEM      0xB1
 #endif
 
 /*
@@ -1317,6 +1322,117 @@ struct fc_rdp_res_frame {
 };
 
 
+/* UVEM */
+
+#define LPFC_UVEM_SIZE 60
+#define LPFC_UVEM_VEM_ID_DESC_SIZE 16
+#define LPFC_UVEM_VE_MAP_DESC_SIZE 20
+
+#define VEM_ID_DESC_TAG  0x0001000A
+struct lpfc_vem_id_desc {
+	uint32_t tag;
+	uint32_t length;
+	uint8_t vem_id[16];
+};
+
+#define LPFC_QFPA_SIZE	4
+
+#define INSTANTIATED_VE_DESC_TAG  0x0001000B
+struct instantiated_ve_desc {
+	uint32_t tag;
+	uint32_t length;
+	uint8_t global_vem_id[16];
+	uint32_t word6;
+#define lpfc_instantiated_local_id_SHIFT   0
+#define lpfc_instantiated_local_id_MASK    0x000000ff
+#define lpfc_instantiated_local_id_WORD    word6
+#define lpfc_instantiated_nport_id_SHIFT   8
+#define lpfc_instantiated_nport_id_MASK    0x00ffffff
+#define lpfc_instantiated_nport_id_WORD    word6
+};
+
+#define DEINSTANTIATED_VE_DESC_TAG  0x0001000C
+struct deinstantiated_ve_desc {
+	uint32_t tag;
+	uint32_t length;
+	uint8_t global_vem_id[16];
+	uint32_t word6;
+#define lpfc_deinstantiated_nport_id_SHIFT   0
+#define lpfc_deinstantiated_nport_id_MASK    0x000000ff
+#define lpfc_deinstantiated_nport_id_WORD    word6
+#define lpfc_deinstantiated_local_id_SHIFT   24
+#define lpfc_deinstantiated_local_id_MASK    0x00ffffff
+#define lpfc_deinstantiated_local_id_WORD    word6
+};
+
+/* Query Fabric Priority Allocation Response */
+#define LPFC_PRIORITY_RANGE_DESC_SIZE 12
+
+struct priority_range_desc {
+	uint32_t tag;
+	uint32_t length;
+	uint8_t lo_range;
+	uint8_t hi_range;
+	uint8_t qos_priority;
+	uint8_t local_ve_id;
+};
+
+struct fc_qfpa_res {
+	uint32_t reply_sequence;	/* LS_ACC or LS_RJT */
+	uint32_t length;	/* FC Word 1    */
+	struct priority_range_desc desc[1];
+};
+
+/* Application Server command code */
+/* VMID               */
+
+#define SLI_CT_APP_SEV_Subtypes     0x20	/* Application Server subtype */
+
+#define SLI_CTAS_GAPPIA_ENT    0x0100	/* Get Application Identifier */
+#define SLI_CTAS_GALLAPPIA     0x0101	/* Get All Application Identifier */
+#define SLI_CTAS_GALLAPPIA_ID  0x0102	/* Get All Application Identifier */
+					/* for Nport */
+#define SLI_CTAS_GAPPIA_IDAPP  0x0103	/* Get Application Identifier */
+					/* for Nport */
+#define SLI_CTAS_RAPP_IDENT    0x0200	/* Register Application Identifier */
+#define SLI_CTAS_DAPP_IDENT    0x0300	/* Deregister Application */
+					/* Identifier */
+#define SLI_CTAS_DALLAPP_ID    0x0301	/* Deregister All Application */
+					/* Identifier */
+
+struct entity_id_object {
+	uint8_t entity_id_len;
+	uint8_t entity_id[255];	/* VM UUID */
+};
+
+struct app_id_object {
+	uint32_t port_id;
+	uint32_t app_id;
+	struct entity_id_object obj;
+};
+
+struct lpfc_vmid_rapp_ident_list {
+	uint32_t no_of_objects;
+	struct entity_id_object obj[1];
+};
+
+struct lpfc_vmid_dapp_ident_list {
+	uint32_t no_of_objects;
+	struct entity_id_object obj[1];
+};
+
+#define GALLAPPIA_ID_LAST  0x80
+struct lpfc_vmid_gallapp_ident_list {
+	uint8_t control;
+	uint8_t reserved[3];
+	struct app_id_object app_id;
+};
+
+#define RAPP_IDENT_OFFSET  (offsetof(struct lpfc_sli_ct_request, un) + 4)
+#define DAPP_IDENT_OFFSET  (offsetof(struct lpfc_sli_ct_request, un) + 4)
+#define GALLAPPIA_ID_SIZE  (offsetof(struct lpfc_sli_ct_request, un) + 4)
+#define DALLAPP_ID_SIZE    (offsetof(struct lpfc_sli_ct_request, un) + 4)
+
 /******** FDMI ********/
 
 /* lpfc_sli_ct_request defines the CT_IU preamble for FDMI commands */
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h
index 4f6936014ff5..ff5a2a492405 100644
--- a/drivers/scsi/lpfc/lpfc_sli.h
+++ b/drivers/scsi/lpfc/lpfc_sli.h
@@ -35,6 +35,12 @@ typedef enum _lpfc_ctx_cmd {
 	LPFC_CTX_HOST
 } lpfc_ctx_cmd;
 
+union lpfc_vmid_iocb_tag {
+	uint32_t app_id;
+	uint8_t cs_ctl_vmid;
+	struct lpfc_vmid_context *vmid_context;	/* UVEM context information */
+};
+
 struct lpfc_cq_event {
 	struct list_head list;
 	uint16_t hdwq;
@@ -100,6 +106,7 @@ struct lpfc_iocbq {
 #define LPFC_IO_NVME	        0x200000 /* NVME FCP command */
 #define LPFC_IO_NVME_LS		0x400000 /* NVME LS command */
 #define LPFC_IO_NVMET		0x800000 /* NVMET command */
+#define LPFC_IO_VMID            0x1000000 /* VMID tagged IO */
 
 	uint32_t drvrTimeout;	/* driver timeout in seconds */
 	struct lpfc_vport *vport;/* virtual port pointer */
@@ -114,6 +121,7 @@ struct lpfc_iocbq {
 		struct lpfc_node_rrq *rrq;
 	} context_un;
 
+	union lpfc_vmid_iocb_tag vmid_tag;
 	void (*fabric_iocb_cmpl)(struct lpfc_hba *, struct lpfc_iocbq *,
 			   struct lpfc_iocbq *);
 	void (*wait_iocb_cmpl)(struct lpfc_hba *, struct lpfc_iocbq *,
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 06/16] lpfc: vmid: Forward declarations for APIs
  2020-12-16  5:29 ` Muneendra
  (?)
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 2194 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch contains the forward declarations of commonly used APIs which
are used outside the scope of the file.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_crtn.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index f78e52a18b0b..7eb0200ecaa8 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -606,3 +606,14 @@ extern unsigned long lpfc_no_hba_reset[];
 extern union lpfc_wqe128 lpfc_iread_cmd_template;
 extern union lpfc_wqe128 lpfc_iwrite_cmd_template;
 extern union lpfc_wqe128 lpfc_icmnd_cmd_template;
+
+/* vmid interface */
+int lpfc_vmid_uvem(struct lpfc_vport *vport, struct lpfc_vmid *vmid, bool ins);
+uint32_t lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport);
+int lpfc_vmid_cmd(struct lpfc_vport *vport,
+		  int cmdcode, struct lpfc_vmid *vmid);
+int lpfc_vmid_hash_fn(char *vmid, int len);
+struct lpfc_vmid *lpfc_get_vmid_from_hastable(struct lpfc_vport *vport,
+					      uint32_t hash, uint8_t *buf);
+void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport);
+int lpfc_issue_els_qfpa(struct lpfc_vport *vport);
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 06/16] lpfc: vmid: Forward declarations for APIs
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 2194 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch contains the forward declarations of commonly used APIs which
are used outside the scope of the file.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_crtn.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index f78e52a18b0b..7eb0200ecaa8 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -606,3 +606,14 @@ extern unsigned long lpfc_no_hba_reset[];
 extern union lpfc_wqe128 lpfc_iread_cmd_template;
 extern union lpfc_wqe128 lpfc_iwrite_cmd_template;
 extern union lpfc_wqe128 lpfc_icmnd_cmd_template;
+
+/* vmid interface */
+int lpfc_vmid_uvem(struct lpfc_vport *vport, struct lpfc_vmid *vmid, bool ins);
+uint32_t lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport);
+int lpfc_vmid_cmd(struct lpfc_vport *vport,
+		  int cmdcode, struct lpfc_vmid *vmid);
+int lpfc_vmid_hash_fn(char *vmid, int len);
+struct lpfc_vmid *lpfc_get_vmid_from_hastable(struct lpfc_vport *vport,
+					      uint32_t hash, uint8_t *buf);
+void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport);
+int lpfc_issue_els_qfpa(struct lpfc_vport *vport);
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 06/16] lpfc: vmid: Forward declarations for APIs
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 2194 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch contains the forward declarations of commonly used APIs which
are used outside the scope of the file.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_crtn.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index f78e52a18b0b..7eb0200ecaa8 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -606,3 +606,14 @@ extern unsigned long lpfc_no_hba_reset[];
 extern union lpfc_wqe128 lpfc_iread_cmd_template;
 extern union lpfc_wqe128 lpfc_iwrite_cmd_template;
 extern union lpfc_wqe128 lpfc_icmnd_cmd_template;
+
+/* vmid interface */
+int lpfc_vmid_uvem(struct lpfc_vport *vport, struct lpfc_vmid *vmid, bool ins);
+uint32_t lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport);
+int lpfc_vmid_cmd(struct lpfc_vport *vport,
+		  int cmdcode, struct lpfc_vmid *vmid);
+int lpfc_vmid_hash_fn(char *vmid, int len);
+struct lpfc_vmid *lpfc_get_vmid_from_hastable(struct lpfc_vport *vport,
+					      uint32_t hash, uint8_t *buf);
+void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport);
+int lpfc_issue_els_qfpa(struct lpfc_vport *vport);
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 07/16] lpfc: vmid: VMID params initialization
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 3945 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch initializes the VMID parameters like the type of vmid, max
number of vmids supported and timeout value for the vmid registration
based on the user input.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_attr.c | 47 +++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 4528166dee36..d8cca950fa3b 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -6151,6 +6151,44 @@ LPFC_ATTR_RW(enable_dpp, 1, 0, 1, "Enable Direct Packet Push");
  */
 LPFC_ATTR_R(enable_mi, 1, 0, 1, "Enable MI");
 
+/*
+ * lpfc_max_vmid: Maximum number of VMs to be tagged. This is valid only if
+ * either vmid_app_header or vmid_priority_tagging is enabled.
+ *       4 - 255  = vmid support enabled for 4-255 VMs
+ *       Value range is [4,255].
+ */
+LPFC_ATTR_RW(max_vmid, LPFC_MIN_VMID, LPFC_MIN_VMID, LPFC_MAX_VMID,
+	     "Maximum number of VMs supported");
+
+/*
+ * lpfc_vmid_inactivity_timeout: Inactivity timeout duration in hours
+ *       0  = Timeout is disabled
+ * Value range is [0,24].
+ */
+LPFC_ATTR_RW(vmid_inactivity_timeout, 4, 0, 24,
+	     "Inactivity timeout in hours");
+
+/*
+ * lpfc_vmid_app_header: Enable App Header VMID support
+ *       0  = Support is disabled (default)
+ *       1  = Support is enabled
+ * Value range is [0,1].
+ */
+LPFC_ATTR_RW(vmid_app_header, LPFC_VMID_APP_HEADER_DISABLE,
+	     LPFC_VMID_APP_HEADER_DISABLE, LPFC_VMID_APP_HEADER_ENABLE,
+	     "Enable App Header VMID support");
+
+/*
+ * lpfc_vmid_priority_tagging: Enable Priority Tagging VMID support
+ *       0  = Support is disabled (default)
+ *       1  = Support is enabled
+ * Value range is [0,1]..
+ */
+LPFC_ATTR_RW(vmid_priority_tagging, LPFC_VMID_PRIO_TAG_DISABLE,
+	     LPFC_VMID_PRIO_TAG_DISABLE,
+	     LPFC_VMID_PRIO_TAG_ALL_TARGETS,
+	     "Enable Priority Tagging VMID support");
+
 struct device_attribute *lpfc_hba_attrs[] = {
 	&dev_attr_nvme_info,
 	&dev_attr_scsi_stat,
@@ -6269,6 +6307,10 @@ struct device_attribute *lpfc_hba_attrs[] = {
 	&dev_attr_lpfc_enable_bbcr,
 	&dev_attr_lpfc_enable_dpp,
 	&dev_attr_lpfc_enable_mi,
+	&dev_attr_lpfc_max_vmid,
+	&dev_attr_lpfc_vmid_inactivity_timeout,
+	&dev_attr_lpfc_vmid_app_header,
+	&dev_attr_lpfc_vmid_priority_tagging,
 	NULL,
 };
 
@@ -7328,6 +7370,11 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
 	lpfc_enable_hba_heartbeat_init(phba, lpfc_enable_hba_heartbeat);
 
 	lpfc_EnableXLane_init(phba, lpfc_EnableXLane);
+	/* VMID Inits */
+	lpfc_max_vmid_init(phba, lpfc_max_vmid);
+	lpfc_vmid_inactivity_timeout_init(phba, lpfc_vmid_inactivity_timeout);
+	lpfc_vmid_app_header_init(phba, lpfc_vmid_app_header);
+	lpfc_vmid_priority_tagging_init(phba, lpfc_vmid_priority_tagging);
 	if (phba->sli_rev != LPFC_SLI_REV4)
 		phba->cfg_EnableXLane = 0;
 	lpfc_XLanePriority_init(phba, lpfc_XLanePriority);
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 07/16] lpfc: vmid: VMID params initialization
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 3945 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch initializes the VMID parameters like the type of vmid, max
number of vmids supported and timeout value for the vmid registration
based on the user input.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_attr.c | 47 +++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 4528166dee36..d8cca950fa3b 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -6151,6 +6151,44 @@ LPFC_ATTR_RW(enable_dpp, 1, 0, 1, "Enable Direct Packet Push");
  */
 LPFC_ATTR_R(enable_mi, 1, 0, 1, "Enable MI");
 
+/*
+ * lpfc_max_vmid: Maximum number of VMs to be tagged. This is valid only if
+ * either vmid_app_header or vmid_priority_tagging is enabled.
+ *       4 - 255  = vmid support enabled for 4-255 VMs
+ *       Value range is [4,255].
+ */
+LPFC_ATTR_RW(max_vmid, LPFC_MIN_VMID, LPFC_MIN_VMID, LPFC_MAX_VMID,
+	     "Maximum number of VMs supported");
+
+/*
+ * lpfc_vmid_inactivity_timeout: Inactivity timeout duration in hours
+ *       0  = Timeout is disabled
+ * Value range is [0,24].
+ */
+LPFC_ATTR_RW(vmid_inactivity_timeout, 4, 0, 24,
+	     "Inactivity timeout in hours");
+
+/*
+ * lpfc_vmid_app_header: Enable App Header VMID support
+ *       0  = Support is disabled (default)
+ *       1  = Support is enabled
+ * Value range is [0,1].
+ */
+LPFC_ATTR_RW(vmid_app_header, LPFC_VMID_APP_HEADER_DISABLE,
+	     LPFC_VMID_APP_HEADER_DISABLE, LPFC_VMID_APP_HEADER_ENABLE,
+	     "Enable App Header VMID support");
+
+/*
+ * lpfc_vmid_priority_tagging: Enable Priority Tagging VMID support
+ *       0  = Support is disabled (default)
+ *       1  = Support is enabled
+ * Value range is [0,1]..
+ */
+LPFC_ATTR_RW(vmid_priority_tagging, LPFC_VMID_PRIO_TAG_DISABLE,
+	     LPFC_VMID_PRIO_TAG_DISABLE,
+	     LPFC_VMID_PRIO_TAG_ALL_TARGETS,
+	     "Enable Priority Tagging VMID support");
+
 struct device_attribute *lpfc_hba_attrs[] = {
 	&dev_attr_nvme_info,
 	&dev_attr_scsi_stat,
@@ -6269,6 +6307,10 @@ struct device_attribute *lpfc_hba_attrs[] = {
 	&dev_attr_lpfc_enable_bbcr,
 	&dev_attr_lpfc_enable_dpp,
 	&dev_attr_lpfc_enable_mi,
+	&dev_attr_lpfc_max_vmid,
+	&dev_attr_lpfc_vmid_inactivity_timeout,
+	&dev_attr_lpfc_vmid_app_header,
+	&dev_attr_lpfc_vmid_priority_tagging,
 	NULL,
 };
 
@@ -7328,6 +7370,11 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
 	lpfc_enable_hba_heartbeat_init(phba, lpfc_enable_hba_heartbeat);
 
 	lpfc_EnableXLane_init(phba, lpfc_EnableXLane);
+	/* VMID Inits */
+	lpfc_max_vmid_init(phba, lpfc_max_vmid);
+	lpfc_vmid_inactivity_timeout_init(phba, lpfc_vmid_inactivity_timeout);
+	lpfc_vmid_app_header_init(phba, lpfc_vmid_app_header);
+	lpfc_vmid_priority_tagging_init(phba, lpfc_vmid_priority_tagging);
 	if (phba->sli_rev != LPFC_SLI_REV4)
 		phba->cfg_EnableXLane = 0;
 	lpfc_XLanePriority_init(phba, lpfc_XLanePriority);
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 8750 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch does the following -
1.adds supporting datastructures for mailbox command which helps in
determining if the firmware supports appid or not.
2.This patch allocates the resource for vmid and checks if the firmware
supports the feature or not.
3.The patch cleans up the vmid resources and stops the timer.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Merged patches 8 and 11 of v4 to this patch
Changed Return code to non-numeric/Symbol

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_hw4.h  | 12 +++++++
 drivers/scsi/lpfc/lpfc_init.c | 68 +++++++++++++++++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_mbox.c |  6 ++++
 drivers/scsi/lpfc/lpfc_scsi.c | 21 +++++++++++
 drivers/scsi/lpfc/lpfc_sli.c  |  9 +++++
 5 files changed, 116 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
index 541b9aef6bfe..5fdafc92fc2d 100644
--- a/drivers/scsi/lpfc/lpfc_hw4.h
+++ b/drivers/scsi/lpfc/lpfc_hw4.h
@@ -272,6 +272,9 @@ struct lpfc_sli4_flags {
 #define lpfc_vfi_rsrc_rdy_MASK		0x00000001
 #define lpfc_vfi_rsrc_rdy_WORD		word0
 #define LPFC_VFI_RSRC_RDY		1
+#define lpfc_ftr_ashdr_SHIFT            4
+#define lpfc_ftr_ashdr_MASK             0x00000001
+#define lpfc_ftr_ashdr_WORD             word0
 };
 
 struct sli4_bls_rsp {
@@ -2943,6 +2946,9 @@ struct lpfc_mbx_request_features {
 #define lpfc_mbx_rq_ftr_rq_mrqp_SHIFT		16
 #define lpfc_mbx_rq_ftr_rq_mrqp_MASK		0x00000001
 #define lpfc_mbx_rq_ftr_rq_mrqp_WORD		word2
+#define lpfc_mbx_rq_ftr_rq_ashdr_SHIFT          17
+#define lpfc_mbx_rq_ftr_rq_ashdr_MASK           0x00000001
+#define lpfc_mbx_rq_ftr_rq_ashdr_WORD           word2
 	uint32_t word3;
 #define lpfc_mbx_rq_ftr_rsp_iaab_SHIFT		0
 #define lpfc_mbx_rq_ftr_rsp_iaab_MASK		0x00000001
@@ -2974,6 +2980,9 @@ struct lpfc_mbx_request_features {
 #define lpfc_mbx_rq_ftr_rsp_mrqp_SHIFT		16
 #define lpfc_mbx_rq_ftr_rsp_mrqp_MASK		0x00000001
 #define lpfc_mbx_rq_ftr_rsp_mrqp_WORD		word3
+#define lpfc_mbx_rq_ftr_rsp_ashdr_SHIFT         17
+#define lpfc_mbx_rq_ftr_rsp_ashdr_MASK          0x00000001
+#define lpfc_mbx_rq_ftr_rsp_ashdr_WORD          word3
 };
 
 struct lpfc_mbx_supp_pages {
@@ -4391,6 +4400,9 @@ struct wqe_common {
 #define wqe_xchg_WORD         word10
 #define LPFC_SCSI_XCHG	      0x0
 #define LPFC_NVME_XCHG	      0x1
+#define wqe_appid_SHIFT       5
+#define wqe_appid_MASK        0x00000001
+#define wqe_appid_WORD        word10
 #define wqe_oas_SHIFT         6
 #define wqe_oas_MASK          0x00000001
 #define wqe_oas_WORD          word10
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index ac67f420ec26..8318dfdc7d87 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -2843,6 +2843,10 @@ lpfc_cleanup(struct lpfc_vport *vport)
 	if (phba->link_state > LPFC_LINK_DOWN)
 		lpfc_port_link_failure(vport);
 
+	/* cleanup vmid resources */
+	if (lpfc_is_vmid_enabled(phba))
+		lpfc_vmid_vport_cleanup(vport);
+
 	list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
 		if (vport->port_type != LPFC_PHYSICAL_PORT &&
 		    ndlp->nlp_DID == Fabric_DID) {
@@ -4269,6 +4273,62 @@ lpfc_get_wwpn(struct lpfc_hba *phba)
 		return rol64(wwn, 32);
 }
 
+/**
+ * lpfc_vmid_res_alloc - Allocates resources for VMID
+ * @phba: pointer to lpfc hba data structure.
+ * @vport: pointer to vport data structure
+ *
+ * This routine allocated the resources needed for the vmid.
+ *
+ * Return codes
+ *	0 on Succeess
+ *	Non-0 on Failure
+ */
+u8
+lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
+{
+	u16 i;
+
+	/* vmid feature is supported only on SLI4 */
+	if (phba->sli_rev == LPFC_SLI_REV3) {
+		phba->cfg_vmid_app_header = 0;
+		phba->cfg_vmid_priority_tagging = 0;
+	}
+
+	/* if enabled, then allocated the resources */
+	if (lpfc_is_vmid_enabled(phba)) {
+		vport->vmid =
+		    kmalloc_array(phba->cfg_max_vmid, sizeof(struct lpfc_vmid),
+				  GFP_KERNEL);
+		if (!vport->vmid)
+			return FAILURE;
+
+		memset(vport->vmid, 0,
+		       phba->cfg_max_vmid * sizeof(struct lpfc_vmid));
+
+		rwlock_init(&vport->vmid_lock);
+
+		/* setting the VMID parameters for the vport */
+		vport->vmid_priority_tagging = phba->cfg_vmid_priority_tagging;
+		vport->vmid_inactivity_timeout =
+		    phba->cfg_vmid_inactivity_timeout;
+		vport->max_vmid = phba->cfg_max_vmid;
+		vport->cur_vmid_cnt = 0;
+
+		for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
+			vport->hash_table[i] = NULL;
+
+		vport->vmid_priority_range = bitmap_zalloc
+			(LPFC_VMID_MAX_PRIORITY_RANGE, GFP_KERNEL);
+
+		if (!vport->vmid_priority_range) {
+			kfree(vport->vmid);
+			return FAILURE;
+		}
+	}
+	return 0;
+}
+
 /**
  * lpfc_create_port - Create an FC port
  * @phba: pointer to lpfc hba data structure.
@@ -4421,6 +4481,12 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)
 			vport->port_type, shost->sg_tablesize,
 			phba->cfg_scsi_seg_cnt, phba->cfg_sg_seg_cnt);
 
+	/* allocate the resources for vmid */
+	rc = lpfc_vmid_res_alloc(phba, vport);
+
+	if (rc)
+		goto out;
+
 	/* Initialize all internally managed lists. */
 	INIT_LIST_HEAD(&vport->fc_nodes);
 	INIT_LIST_HEAD(&vport->rcv_buffer_list);
@@ -4445,6 +4511,8 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)
 	return vport;
 
 out_put_shost:
+	kfree(vport->vmid);
+	bitmap_free(vport->vmid_priority_range);
 	scsi_host_put(shost);
 out:
 	return NULL;
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index 3414ffcb26fe..78a9b9baecf3 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -2100,6 +2100,12 @@ lpfc_request_features(struct lpfc_hba *phba, struct lpfcMboxq *mboxq)
 		bf_set(lpfc_mbx_rq_ftr_rq_iaab, &mboxq->u.mqe.un.req_ftrs, 0);
 		bf_set(lpfc_mbx_rq_ftr_rq_iaar, &mboxq->u.mqe.un.req_ftrs, 0);
 	}
+
+	/* Enable Application Services Header for apphedr VMID */
+	if (phba->cfg_vmid_app_header) {
+		bf_set(lpfc_mbx_rq_ftr_rq_ashdr, &mboxq->u.mqe.un.req_ftrs, 1);
+		bf_set(lpfc_ftr_ashdr, &phba->sli4_hba.sli4_flags, 1);
+	}
 	return;
 }
 
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 3b989f720937..b79b6f03cdb6 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5370,6 +5370,27 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	return 0;
 }
 
+/*
+ * lpfc_vmid_vport_cleanup - cleans up the resources associated with a vports
+ * @vport: The virtual port for which this call is being executed.
+ */
+void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport)
+{
+	/* delete the timer */
+	if (vport->port_type == LPFC_PHYSICAL_PORT)
+		del_timer_sync(&vport->phba->inactive_vmid_poll);
+
+	/* free the resources */
+	kfree(vport->qfpa_res);
+	kfree(vport->vmid_priority.vmid_range);
+	kfree(vport->vmid);
+
+	/* reset variables */
+	vport->qfpa_res = NULL;
+	vport->vmid_priority.vmid_range = NULL;
+	vport->vmid = NULL;
+	vport->cur_vmid_cnt = 0;
+}
 
 /**
  * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 95caad764fb7..f9b6e32db618 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -7696,6 +7696,15 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
 		goto out_free_mbox;
 	}
 
+	/* Disable vmid if app header is not supported */
+	if (phba->cfg_vmid_app_header && !(bf_get(lpfc_mbx_rq_ftr_rsp_ashdr,
+						  &mqe->un.req_ftrs))) {
+		bf_set(lpfc_ftr_ashdr, &phba->sli4_hba.sli4_flags, 0);
+		phba->cfg_vmid_app_header = 0;
+		lpfc_printf_log(phba, KERN_DEBUG, LOG_SLI,
+				"1242 vmid feature not supported");
+	}
+
 	/*
 	 * The port must support FCP initiator mode as this is the
 	 * only mode running in the host.
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 8750 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch does the following -
1.adds supporting datastructures for mailbox command which helps in
determining if the firmware supports appid or not.
2.This patch allocates the resource for vmid and checks if the firmware
supports the feature or not.
3.The patch cleans up the vmid resources and stops the timer.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Merged patches 8 and 11 of v4 to this patch
Changed Return code to non-numeric/Symbol

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_hw4.h  | 12 +++++++
 drivers/scsi/lpfc/lpfc_init.c | 68 +++++++++++++++++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_mbox.c |  6 ++++
 drivers/scsi/lpfc/lpfc_scsi.c | 21 +++++++++++
 drivers/scsi/lpfc/lpfc_sli.c  |  9 +++++
 5 files changed, 116 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
index 541b9aef6bfe..5fdafc92fc2d 100644
--- a/drivers/scsi/lpfc/lpfc_hw4.h
+++ b/drivers/scsi/lpfc/lpfc_hw4.h
@@ -272,6 +272,9 @@ struct lpfc_sli4_flags {
 #define lpfc_vfi_rsrc_rdy_MASK		0x00000001
 #define lpfc_vfi_rsrc_rdy_WORD		word0
 #define LPFC_VFI_RSRC_RDY		1
+#define lpfc_ftr_ashdr_SHIFT            4
+#define lpfc_ftr_ashdr_MASK             0x00000001
+#define lpfc_ftr_ashdr_WORD             word0
 };
 
 struct sli4_bls_rsp {
@@ -2943,6 +2946,9 @@ struct lpfc_mbx_request_features {
 #define lpfc_mbx_rq_ftr_rq_mrqp_SHIFT		16
 #define lpfc_mbx_rq_ftr_rq_mrqp_MASK		0x00000001
 #define lpfc_mbx_rq_ftr_rq_mrqp_WORD		word2
+#define lpfc_mbx_rq_ftr_rq_ashdr_SHIFT          17
+#define lpfc_mbx_rq_ftr_rq_ashdr_MASK           0x00000001
+#define lpfc_mbx_rq_ftr_rq_ashdr_WORD           word2
 	uint32_t word3;
 #define lpfc_mbx_rq_ftr_rsp_iaab_SHIFT		0
 #define lpfc_mbx_rq_ftr_rsp_iaab_MASK		0x00000001
@@ -2974,6 +2980,9 @@ struct lpfc_mbx_request_features {
 #define lpfc_mbx_rq_ftr_rsp_mrqp_SHIFT		16
 #define lpfc_mbx_rq_ftr_rsp_mrqp_MASK		0x00000001
 #define lpfc_mbx_rq_ftr_rsp_mrqp_WORD		word3
+#define lpfc_mbx_rq_ftr_rsp_ashdr_SHIFT         17
+#define lpfc_mbx_rq_ftr_rsp_ashdr_MASK          0x00000001
+#define lpfc_mbx_rq_ftr_rsp_ashdr_WORD          word3
 };
 
 struct lpfc_mbx_supp_pages {
@@ -4391,6 +4400,9 @@ struct wqe_common {
 #define wqe_xchg_WORD         word10
 #define LPFC_SCSI_XCHG	      0x0
 #define LPFC_NVME_XCHG	      0x1
+#define wqe_appid_SHIFT       5
+#define wqe_appid_MASK        0x00000001
+#define wqe_appid_WORD        word10
 #define wqe_oas_SHIFT         6
 #define wqe_oas_MASK          0x00000001
 #define wqe_oas_WORD          word10
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index ac67f420ec26..8318dfdc7d87 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -2843,6 +2843,10 @@ lpfc_cleanup(struct lpfc_vport *vport)
 	if (phba->link_state > LPFC_LINK_DOWN)
 		lpfc_port_link_failure(vport);
 
+	/* cleanup vmid resources */
+	if (lpfc_is_vmid_enabled(phba))
+		lpfc_vmid_vport_cleanup(vport);
+
 	list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
 		if (vport->port_type != LPFC_PHYSICAL_PORT &&
 		    ndlp->nlp_DID == Fabric_DID) {
@@ -4269,6 +4273,62 @@ lpfc_get_wwpn(struct lpfc_hba *phba)
 		return rol64(wwn, 32);
 }
 
+/**
+ * lpfc_vmid_res_alloc - Allocates resources for VMID
+ * @phba: pointer to lpfc hba data structure.
+ * @vport: pointer to vport data structure
+ *
+ * This routine allocated the resources needed for the vmid.
+ *
+ * Return codes
+ *	0 on Succeess
+ *	Non-0 on Failure
+ */
+u8
+lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
+{
+	u16 i;
+
+	/* vmid feature is supported only on SLI4 */
+	if (phba->sli_rev == LPFC_SLI_REV3) {
+		phba->cfg_vmid_app_header = 0;
+		phba->cfg_vmid_priority_tagging = 0;
+	}
+
+	/* if enabled, then allocated the resources */
+	if (lpfc_is_vmid_enabled(phba)) {
+		vport->vmid =
+		    kmalloc_array(phba->cfg_max_vmid, sizeof(struct lpfc_vmid),
+				  GFP_KERNEL);
+		if (!vport->vmid)
+			return FAILURE;
+
+		memset(vport->vmid, 0,
+		       phba->cfg_max_vmid * sizeof(struct lpfc_vmid));
+
+		rwlock_init(&vport->vmid_lock);
+
+		/* setting the VMID parameters for the vport */
+		vport->vmid_priority_tagging = phba->cfg_vmid_priority_tagging;
+		vport->vmid_inactivity_timeout =
+		    phba->cfg_vmid_inactivity_timeout;
+		vport->max_vmid = phba->cfg_max_vmid;
+		vport->cur_vmid_cnt = 0;
+
+		for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
+			vport->hash_table[i] = NULL;
+
+		vport->vmid_priority_range = bitmap_zalloc
+			(LPFC_VMID_MAX_PRIORITY_RANGE, GFP_KERNEL);
+
+		if (!vport->vmid_priority_range) {
+			kfree(vport->vmid);
+			return FAILURE;
+		}
+	}
+	return 0;
+}
+
 /**
  * lpfc_create_port - Create an FC port
  * @phba: pointer to lpfc hba data structure.
@@ -4421,6 +4481,12 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)
 			vport->port_type, shost->sg_tablesize,
 			phba->cfg_scsi_seg_cnt, phba->cfg_sg_seg_cnt);
 
+	/* allocate the resources for vmid */
+	rc = lpfc_vmid_res_alloc(phba, vport);
+
+	if (rc)
+		goto out;
+
 	/* Initialize all internally managed lists. */
 	INIT_LIST_HEAD(&vport->fc_nodes);
 	INIT_LIST_HEAD(&vport->rcv_buffer_list);
@@ -4445,6 +4511,8 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)
 	return vport;
 
 out_put_shost:
+	kfree(vport->vmid);
+	bitmap_free(vport->vmid_priority_range);
 	scsi_host_put(shost);
 out:
 	return NULL;
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index 3414ffcb26fe..78a9b9baecf3 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -2100,6 +2100,12 @@ lpfc_request_features(struct lpfc_hba *phba, struct lpfcMboxq *mboxq)
 		bf_set(lpfc_mbx_rq_ftr_rq_iaab, &mboxq->u.mqe.un.req_ftrs, 0);
 		bf_set(lpfc_mbx_rq_ftr_rq_iaar, &mboxq->u.mqe.un.req_ftrs, 0);
 	}
+
+	/* Enable Application Services Header for apphedr VMID */
+	if (phba->cfg_vmid_app_header) {
+		bf_set(lpfc_mbx_rq_ftr_rq_ashdr, &mboxq->u.mqe.un.req_ftrs, 1);
+		bf_set(lpfc_ftr_ashdr, &phba->sli4_hba.sli4_flags, 1);
+	}
 	return;
 }
 
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 3b989f720937..b79b6f03cdb6 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5370,6 +5370,27 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	return 0;
 }
 
+/*
+ * lpfc_vmid_vport_cleanup - cleans up the resources associated with a vports
+ * @vport: The virtual port for which this call is being executed.
+ */
+void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport)
+{
+	/* delete the timer */
+	if (vport->port_type == LPFC_PHYSICAL_PORT)
+		del_timer_sync(&vport->phba->inactive_vmid_poll);
+
+	/* free the resources */
+	kfree(vport->qfpa_res);
+	kfree(vport->vmid_priority.vmid_range);
+	kfree(vport->vmid);
+
+	/* reset variables */
+	vport->qfpa_res = NULL;
+	vport->vmid_priority.vmid_range = NULL;
+	vport->vmid = NULL;
+	vport->cur_vmid_cnt = 0;
+}
 
 /**
  * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 95caad764fb7..f9b6e32db618 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -7696,6 +7696,15 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
 		goto out_free_mbox;
 	}
 
+	/* Disable vmid if app header is not supported */
+	if (phba->cfg_vmid_app_header && !(bf_get(lpfc_mbx_rq_ftr_rsp_ashdr,
+						  &mqe->un.req_ftrs))) {
+		bf_set(lpfc_ftr_ashdr, &phba->sli4_hba.sli4_flags, 0);
+		phba->cfg_vmid_app_header = 0;
+		lpfc_printf_log(phba, KERN_DEBUG, LOG_SLI,
+				"1242 vmid feature not supported");
+	}
+
 	/*
 	 * The port must support FCP initiator mode as this is the
 	 * only mode running in the host.
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 14906 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch implements ELS command like QFPA and UVEM for the priority
tagging appid support. Other supporting functions are also part of this
patch.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Changed Return code to non-numeric/Symbol.
Addressed the review comments by Hannes

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_els.c | 371 ++++++++++++++++++++++++++++++++++-
 1 file changed, 364 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 96c087b8b474..fae390b29a71 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -25,6 +25,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/delay.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_device.h>
@@ -55,6 +56,8 @@ static int lpfc_issue_els_fdisc(struct lpfc_vport *vport,
 				struct lpfc_nodelist *ndlp, uint8_t retry);
 static int lpfc_issue_fabric_iocb(struct lpfc_hba *phba,
 				  struct lpfc_iocbq *iocb);
+static void lpfc_cmpl_els_uvem(struct lpfc_hba *, struct lpfc_iocbq *,
+			       struct lpfc_iocbq *);
 
 static int lpfc_max_els_tries = 3;
 
@@ -312,12 +315,12 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
 	if (expectRsp) {
 		/* Xmit ELS command <elsCmd> to remote NPORT <did> */
 		lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
-				 "0116 Xmit ELS command x%x to remote "
-				 "NPORT x%x I/O tag: x%x, port state:x%x "
-				 "rpi x%x fc_flag:x%x\n",
+				 "0116 Xmit ELS command x%x to remote\n"
+				 "NPORT x%x I/O tag: x%x, port state:x%x\n"
+				 "rpi x%x fc_flag:x%x nlp_flag:x%x vport:x%p\n",
 				 elscmd, did, elsiocb->iotag,
 				 vport->port_state, ndlp->nlp_rpi,
-				 vport->fc_flag);
+				 vport->fc_flag, ndlp->nlp_flag, vport);
 	} else {
 		/* Xmit ELS response <elsCmd> to remote NPORT <did> */
 		lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
@@ -1111,12 +1114,16 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 
 	/* FLOGI completes successfully */
 	lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
-			 "0101 FLOGI completes successfully, I/O tag:x%x, "
-			 "xri x%x Data: x%x x%x x%x x%x x%x %x\n",
+			 "0101 FLOGI completes successfully, I/O tag:x%x,\n"
+			 "xri x%x Data: x%x x%x x%x x%x x%x %x %x\n",
 			 cmdiocb->iotag, cmdiocb->sli4_xritag,
 			 irsp->un.ulpWord[4], sp->cmn.e_d_tov,
 			 sp->cmn.w2.r_a_tov, sp->cmn.edtovResolution,
-			 vport->port_state, vport->fc_flag);
+			 vport->port_state, vport->fc_flag,
+			 sp->cmn.priority_tagging);
+
+	if (sp->cmn.priority_tagging)
+		vport->vmid_flag |= LPFC_VMID_ISSUE_QFPA;
 
 	if (vport->port_state == LPFC_FLOGI) {
 		/*
@@ -1298,6 +1305,18 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
 	if (sp->cmn.fcphHigh < FC_PH3)
 		sp->cmn.fcphHigh = FC_PH3;
 
+	/* to deterine if switch supports priority tagging */
+	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)) {
+			memcpy(vport->lpfc_vmid_host_uuid, phba->wwpn,
+			       sizeof(phba->wwpn));
+			memcpy(&vport->lpfc_vmid_host_uuid[8], phba->wwnn,
+			       sizeof(phba->wwnn));
+		}
+	}
+
 	if  (phba->sli_rev == LPFC_SLI_REV4) {
 		if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) ==
 		    LPFC_SLI_INTF_IF_TYPE_0) {
@@ -1928,6 +1947,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 	struct lpfc_nodelist *ndlp, *free_ndlp;
 	struct lpfc_dmabuf *prsp;
 	int disc;
+	struct serv_parm *sp = NULL;
 
 	/* we pass cmdiocb to state machine which needs rspiocb as well */
 	cmdiocb->context_un.rsp_iocb = rspiocb;
@@ -2018,6 +2038,23 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 				   cmdiocb->context2)->list.next,
 				  struct lpfc_dmabuf, list);
 		ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp);
+
+		sp = (struct serv_parm *)((u8 *)prsp->virt +
+					  sizeof(u32));
+
+		ndlp->vmid_support = 0;
+		if ((phba->cfg_vmid_app_header && sp->cmn.app_hdr_support) ||
+		    (phba->cfg_vmid_priority_tagging &&
+		     sp->cmn.priority_tagging)) {
+			lpfc_printf_log(phba, KERN_DEBUG, LOG_ELS,
+					"4018 app_hdr_support %d tagging %d DID x%x",
+					sp->cmn.app_hdr_support,
+					sp->cmn.priority_tagging,
+					ndlp->nlp_DID);
+			/* if the dest port supports VMID, mark it in ndlp */
+			ndlp->vmid_support = 1;
+		}
+
 		lpfc_disc_state_machine(vport, ndlp, cmdiocb,
 					NLP_EVT_CMPL_PLOGI);
 	}
@@ -2142,6 +2179,14 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry)
 	memset(sp->un.vendorVersion, 0, sizeof(sp->un.vendorVersion));
 	sp->cmn.bbRcvSizeMsb &= 0xF;
 
+	/* check if the destination port supports VMID */
+	ndlp->vmid_support = 0;
+	if (vport->vmid_priority_tagging)
+		sp->cmn.priority_tagging = 1;
+	else if (phba->cfg_vmid_app_header &&
+		 bf_get(lpfc_ftr_ashdr, &phba->sli4_hba.sli4_flags))
+		sp->cmn.app_hdr_support = 1;
+
 	lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
 		"Issue PLOGI:     did:x%x",
 		did, 0, 0);
@@ -10306,3 +10351,315 @@ lpfc_sli_abts_recover_port(struct lpfc_vport *vport,
 	lpfc_unreg_rpi(vport, ndlp);
 }
 
+void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
+{
+	bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE);
+}
+
+void
+lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
+{
+	u32 i;
+
+	if ((min > max) || (max > LPFC_VMID_MAX_PRIORITY_RANGE))
+		return;
+
+	for (i = min; i <= max; i++)
+		set_bit(i, vport->vmid_priority_range);
+}
+
+void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
+{
+	set_bit(ctcl_vmid, vport->vmid_priority_range);
+}
+
+u32 lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport)
+{
+	u32 i;
+
+	i = find_first_bit(vport->vmid_priority_range,
+			   LPFC_VMID_MAX_PRIORITY_RANGE);
+
+	if (i == LPFC_VMID_MAX_PRIORITY_RANGE)
+		return 0;
+
+	clear_bit(i, vport->vmid_priority_range);
+	return i;
+}
+
+#define MAX_PRIORITY_DESC	255
+
+static void
+lpfc_cmpl_els_qfpa(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
+		   struct lpfc_iocbq *rspiocb)
+{
+	struct lpfc_vport *vport = cmdiocb->vport;
+	struct priority_range_desc *desc;
+	struct lpfc_dmabuf *prsp = NULL;
+	struct lpfc_vmid_priority_range *vmid_range = NULL;
+	u32 *data;
+	struct lpfc_dmabuf *dmabuf = cmdiocb->context2;
+	IOCB_t *irsp = &rspiocb->iocb;
+	u8 *pcmd;
+	u32 len, i;
+	struct lpfc_nodelist *ndlp;
+
+	prsp = list_get_first(&dmabuf->list, struct lpfc_dmabuf, list);
+	if (!prsp)
+		goto out;
+
+	ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
+	pcmd = prsp->virt;
+	data = (u32 *)pcmd;
+	if (data[0] == ELS_CMD_LS_RJT) {
+		lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
+				 "6528 QFPA LS_RJT %x  %x ", data[0], data[1]);
+		goto out;
+	}
+	if (irsp->ulpStatus) {
+		lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
+				 "6529 QFPA failed with status %x  %x ",
+				 irsp->ulpStatus, irsp->un.ulpWord[4]);
+		goto out;
+	}
+
+	if (!vport->qfpa_res) {
+		vport->qfpa_res = kmalloc(FCELSSIZE, GFP_KERNEL);
+		if (!vport->qfpa_res)
+			goto out;
+		memset(vport->qfpa_res, 0, FCELSSIZE);
+	}
+
+	len = *((u32 *)(pcmd + 4));
+	len = be32_to_cpu(len);
+	memcpy(vport->qfpa_res, pcmd, len + 8);
+	len = len / LPFC_PRIORITY_RANGE_DESC_SIZE;
+
+	desc = (struct priority_range_desc *)(pcmd + 8);
+	vmid_range = vport->vmid_priority.vmid_range;
+	if (!vmid_range) {
+		vmid_range = kmalloc_array(MAX_PRIORITY_DESC,
+					   sizeof
+					   (struct lpfc_vmid_priority_range),
+					   GFP_KERNEL);
+		if (!vmid_range)
+			goto out;
+		memset(vmid_range, 0, MAX_PRIORITY_DESC *
+		       sizeof(struct lpfc_vmid_priority_range));
+		vport->vmid_priority.vmid_range = vmid_range;
+	}
+	vport->vmid_priority.num_descriptors = len;
+
+	for (i = 0; i < len; i++, vmid_range++, desc++) {
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS,
+				 "6539 vmid values low=%d, high=%d, qos=%d,\n"
+				 " local ve id=%d\n", desc->lo_range,
+				 desc->hi_range, desc->qos_priority,
+				 desc->local_ve_id);
+
+		vmid_range->low = desc->lo_range << 1;
+		if (desc->local_ve_id == QFPA_ODD_ONLY)
+			vmid_range->low++;
+		if (desc->qos_priority)
+			vport->vmid_flag |= LPFC_VMID_QOS_ENABLED;
+		vmid_range->qos = desc->qos_priority;
+
+		vmid_range->high = desc->hi_range << 1;
+		if ((desc->local_ve_id == QFPA_ODD_ONLY) ||
+		    (desc->local_ve_id == QFPA_EVEN_ODD))
+			vmid_range->high++;
+	}
+	lpfc_init_cs_ctl_bitmap(vport);
+	for (i = 0; i < vport->vmid_priority.num_descriptors; i++) {
+		lpfc_vmid_set_cs_ctl_range(vport,
+				vport->vmid_priority.vmid_range[i].low,
+				vport->vmid_priority.vmid_range[i].high);
+	}
+
+	vport->vmid_flag |= LPFC_VMID_QFPA_CMPL;
+ out:
+	lpfc_els_free_iocb(phba, cmdiocb);
+	lpfc_nlp_put(ndlp);
+}
+
+int lpfc_issue_els_qfpa(struct lpfc_vport *vport)
+{
+	struct lpfc_hba *phba = vport->phba;
+	IOCB_t *icmd;
+	struct lpfc_nodelist *ndlp;
+	struct lpfc_iocbq *elsiocb;
+	struct lpfc_sli *psli;
+	u8 *pcmd;
+	int ret;
+
+	psli = &phba->sli;
+
+	ndlp = lpfc_findnode_did(phba->pport, Fabric_DID);
+	if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
+		return FAILURE;
+
+	if (!ndlp)
+		return FAILURE;
+
+	elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_QFPA_SIZE, 2, ndlp,
+				     ndlp->nlp_DID, ELS_CMD_QFPA);
+	if (!elsiocb)
+		return FAILURE;
+
+	icmd = &elsiocb->iocb;
+	pcmd = (u8 *)(((struct lpfc_dmabuf *)elsiocb->context2)->virt);
+
+	*((u32 *)(pcmd)) = ELS_CMD_QFPA;
+	pcmd += 4;
+
+	elsiocb->iocb_cmpl = lpfc_cmpl_els_qfpa;
+
+	elsiocb->context1 = lpfc_nlp_get(ndlp);
+	if (!elsiocb->context1)
+		return FAILURE;
+
+	ret = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 2);
+	if (ret != IOCB_SUCCESS) {
+		lpfc_nlp_put(ndlp);
+		lpfc_els_free_iocb(phba, elsiocb);
+		return FAILURE;
+	}
+	vport->vmid_flag &= ~LPFC_VMID_QOS_ENABLED;
+	return 0;
+}
+
+int
+lpfc_vmid_uvem(struct lpfc_vport *vport,
+	       struct lpfc_vmid *vmid, bool instantiated)
+{
+	struct lpfc_vem_id_desc *vem_id_desc;
+	struct lpfc_nodelist *ndlp;
+	IOCB_t *icmd;
+	struct lpfc_iocbq *elsiocb;
+	struct instantiated_ve_desc *inst_desc;
+	struct lpfc_vmid_context *vmid_context;
+	u8 *pcmd;
+	u32 *len;
+	int ret = 0;
+
+	ndlp = lpfc_findnode_did(vport, Fabric_DID);
+	if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
+		return FAILURE;
+
+	vmid_context = kmalloc(sizeof(*vmid_context), GFP_KERNEL);
+	if (!vmid_context)
+		return FAILURE;
+	elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_UVEM_SIZE, 2,
+				     ndlp, Fabric_DID, ELS_CMD_UVEM);
+	if (!elsiocb)
+		goto out;
+
+	lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS,
+			 "3427 %s %d", vmid->host_vmid, instantiated);
+	vmid_context->vmp = vmid;
+	vmid_context->nlp = ndlp;
+	vmid_context->instantiated = instantiated;
+	elsiocb->vmid_tag.vmid_context = vmid_context;
+	icmd = &elsiocb->iocb;
+	pcmd = (u8 *)(((struct lpfc_dmabuf *)elsiocb->context2)->virt);
+
+	if (uuid_is_null((uuid_t *)vport->lpfc_vmid_host_uuid))
+		memcpy(vport->lpfc_vmid_host_uuid, vmid->host_vmid,
+		       LPFC_COMPRESS_VMID_SIZE);
+
+	*((u32 *)(pcmd)) = ELS_CMD_UVEM;
+	len = (u32 *)(pcmd + 4);
+	*len = cpu_to_be32(LPFC_UVEM_SIZE - 8);
+
+	vem_id_desc = (struct lpfc_vem_id_desc *)(pcmd + 8);
+	vem_id_desc->tag = be32_to_cpu(VEM_ID_DESC_TAG);
+	vem_id_desc->length = be32_to_cpu(LPFC_UVEM_VEM_ID_DESC_SIZE);
+	memcpy(vem_id_desc->vem_id, vport->lpfc_vmid_host_uuid,
+	       LPFC_COMPRESS_VMID_SIZE);
+
+	inst_desc = (struct instantiated_ve_desc *)(pcmd + 32);
+	inst_desc->tag = be32_to_cpu(INSTANTIATED_VE_DESC_TAG);
+	inst_desc->length = be32_to_cpu(LPFC_UVEM_VE_MAP_DESC_SIZE);
+	memcpy(inst_desc->global_vem_id, vmid->host_vmid,
+	       LPFC_COMPRESS_VMID_SIZE);
+
+	bf_set(lpfc_instantiated_nport_id, inst_desc, vport->fc_myDID);
+	bf_set(lpfc_instantiated_local_id, inst_desc,
+	       vmid->un.cs_ctl_vmid);
+	if (instantiated) {
+		inst_desc->tag = be32_to_cpu(INSTANTIATED_VE_DESC_TAG);
+	} else {
+		inst_desc->tag = be32_to_cpu(DEINSTANTIATED_VE_DESC_TAG);
+		lpfc_vmid_put_cs_ctl(vport, vmid->un.cs_ctl_vmid);
+	}
+	inst_desc->word6 = cpu_to_be32(inst_desc->word6);
+
+	elsiocb->iocb_cmpl = lpfc_cmpl_els_uvem;
+
+	elsiocb->context1 = lpfc_nlp_get(ndlp);
+	if (!elsiocb->context1)
+		return FAILURE;
+
+	ret = lpfc_sli_issue_iocb(vport->phba, LPFC_ELS_RING, elsiocb, 0);
+	if (ret != IOCB_SUCCESS) {
+		lpfc_els_free_iocb(vport->phba, elsiocb);
+		goto out;
+	}
+
+	return 0;
+ out:
+	kfree(vmid_context);
+	return FAILURE;
+}
+
+static void
+lpfc_cmpl_els_uvem(struct lpfc_hba *phba, struct lpfc_iocbq *icmdiocb,
+		   struct lpfc_iocbq *rspiocb)
+{
+	struct lpfc_vport *vport = icmdiocb->vport;
+	struct lpfc_dmabuf *prsp = NULL;
+	struct lpfc_vmid_context *vmid_context =
+	    icmdiocb->vmid_tag.vmid_context;
+	struct lpfc_nodelist *ndlp = icmdiocb->context1;
+	u8 *pcmd;
+	u32 *data;
+	IOCB_t *irsp = &rspiocb->iocb;
+	struct lpfc_dmabuf *dmabuf = icmdiocb->context2;
+	struct lpfc_vmid *vmid;
+
+	vmid = vmid_context->vmp;
+	if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
+		ndlp = NULL;
+
+	prsp = list_get_first(&dmabuf->list, struct lpfc_dmabuf, list);
+	if (!prsp)
+		goto out;
+	pcmd = prsp->virt;
+	data = (u32 *)pcmd;
+	if (data[0] == ELS_CMD_LS_RJT) {
+		lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
+				 "4532 UVEM LS_RJT %x %x ", data[0], data[1]);
+		goto out;
+	}
+	if (irsp->ulpStatus) {
+		lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
+				 "4533 UVEM error status %x: %x ",
+				 irsp->ulpStatus, irsp->un.ulpWord[4]);
+		goto out;
+	}
+	spin_lock(&phba->hbalock);
+	/* Set IN USE flag */
+	vport->vmid_flag |= LPFC_VMID_IN_USE;
+	phba->pport->vmid_flag |= LPFC_VMID_IN_USE;
+	spin_unlock(&phba->hbalock);
+
+	if (vmid_context->instantiated) {
+		vmid->flag |= LPFC_VMID_REGISTERED;
+		vmid->flag &= ~LPFC_VMID_REQ_REGISTER;
+	}
+
+ out:
+	kfree(vmid_context);
+	lpfc_els_free_iocb(phba, icmdiocb);
+	lpfc_nlp_put(ndlp);
+}
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 14906 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch implements ELS command like QFPA and UVEM for the priority
tagging appid support. Other supporting functions are also part of this
patch.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Changed Return code to non-numeric/Symbol.
Addressed the review comments by Hannes

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_els.c | 371 ++++++++++++++++++++++++++++++++++-
 1 file changed, 364 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 96c087b8b474..fae390b29a71 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -25,6 +25,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/delay.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_device.h>
@@ -55,6 +56,8 @@ static int lpfc_issue_els_fdisc(struct lpfc_vport *vport,
 				struct lpfc_nodelist *ndlp, uint8_t retry);
 static int lpfc_issue_fabric_iocb(struct lpfc_hba *phba,
 				  struct lpfc_iocbq *iocb);
+static void lpfc_cmpl_els_uvem(struct lpfc_hba *, struct lpfc_iocbq *,
+			       struct lpfc_iocbq *);
 
 static int lpfc_max_els_tries = 3;
 
@@ -312,12 +315,12 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
 	if (expectRsp) {
 		/* Xmit ELS command <elsCmd> to remote NPORT <did> */
 		lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
-				 "0116 Xmit ELS command x%x to remote "
-				 "NPORT x%x I/O tag: x%x, port state:x%x "
-				 "rpi x%x fc_flag:x%x\n",
+				 "0116 Xmit ELS command x%x to remote\n"
+				 "NPORT x%x I/O tag: x%x, port state:x%x\n"
+				 "rpi x%x fc_flag:x%x nlp_flag:x%x vport:x%p\n",
 				 elscmd, did, elsiocb->iotag,
 				 vport->port_state, ndlp->nlp_rpi,
-				 vport->fc_flag);
+				 vport->fc_flag, ndlp->nlp_flag, vport);
 	} else {
 		/* Xmit ELS response <elsCmd> to remote NPORT <did> */
 		lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
@@ -1111,12 +1114,16 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 
 	/* FLOGI completes successfully */
 	lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
-			 "0101 FLOGI completes successfully, I/O tag:x%x, "
-			 "xri x%x Data: x%x x%x x%x x%x x%x %x\n",
+			 "0101 FLOGI completes successfully, I/O tag:x%x,\n"
+			 "xri x%x Data: x%x x%x x%x x%x x%x %x %x\n",
 			 cmdiocb->iotag, cmdiocb->sli4_xritag,
 			 irsp->un.ulpWord[4], sp->cmn.e_d_tov,
 			 sp->cmn.w2.r_a_tov, sp->cmn.edtovResolution,
-			 vport->port_state, vport->fc_flag);
+			 vport->port_state, vport->fc_flag,
+			 sp->cmn.priority_tagging);
+
+	if (sp->cmn.priority_tagging)
+		vport->vmid_flag |= LPFC_VMID_ISSUE_QFPA;
 
 	if (vport->port_state == LPFC_FLOGI) {
 		/*
@@ -1298,6 +1305,18 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
 	if (sp->cmn.fcphHigh < FC_PH3)
 		sp->cmn.fcphHigh = FC_PH3;
 
+	/* to deterine if switch supports priority tagging */
+	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)) {
+			memcpy(vport->lpfc_vmid_host_uuid, phba->wwpn,
+			       sizeof(phba->wwpn));
+			memcpy(&vport->lpfc_vmid_host_uuid[8], phba->wwnn,
+			       sizeof(phba->wwnn));
+		}
+	}
+
 	if  (phba->sli_rev == LPFC_SLI_REV4) {
 		if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) ==
 		    LPFC_SLI_INTF_IF_TYPE_0) {
@@ -1928,6 +1947,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 	struct lpfc_nodelist *ndlp, *free_ndlp;
 	struct lpfc_dmabuf *prsp;
 	int disc;
+	struct serv_parm *sp = NULL;
 
 	/* we pass cmdiocb to state machine which needs rspiocb as well */
 	cmdiocb->context_un.rsp_iocb = rspiocb;
@@ -2018,6 +2038,23 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 				   cmdiocb->context2)->list.next,
 				  struct lpfc_dmabuf, list);
 		ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp);
+
+		sp = (struct serv_parm *)((u8 *)prsp->virt +
+					  sizeof(u32));
+
+		ndlp->vmid_support = 0;
+		if ((phba->cfg_vmid_app_header && sp->cmn.app_hdr_support) ||
+		    (phba->cfg_vmid_priority_tagging &&
+		     sp->cmn.priority_tagging)) {
+			lpfc_printf_log(phba, KERN_DEBUG, LOG_ELS,
+					"4018 app_hdr_support %d tagging %d DID x%x",
+					sp->cmn.app_hdr_support,
+					sp->cmn.priority_tagging,
+					ndlp->nlp_DID);
+			/* if the dest port supports VMID, mark it in ndlp */
+			ndlp->vmid_support = 1;
+		}
+
 		lpfc_disc_state_machine(vport, ndlp, cmdiocb,
 					NLP_EVT_CMPL_PLOGI);
 	}
@@ -2142,6 +2179,14 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry)
 	memset(sp->un.vendorVersion, 0, sizeof(sp->un.vendorVersion));
 	sp->cmn.bbRcvSizeMsb &= 0xF;
 
+	/* check if the destination port supports VMID */
+	ndlp->vmid_support = 0;
+	if (vport->vmid_priority_tagging)
+		sp->cmn.priority_tagging = 1;
+	else if (phba->cfg_vmid_app_header &&
+		 bf_get(lpfc_ftr_ashdr, &phba->sli4_hba.sli4_flags))
+		sp->cmn.app_hdr_support = 1;
+
 	lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
 		"Issue PLOGI:     did:x%x",
 		did, 0, 0);
@@ -10306,3 +10351,315 @@ lpfc_sli_abts_recover_port(struct lpfc_vport *vport,
 	lpfc_unreg_rpi(vport, ndlp);
 }
 
+void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
+{
+	bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE);
+}
+
+void
+lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
+{
+	u32 i;
+
+	if ((min > max) || (max > LPFC_VMID_MAX_PRIORITY_RANGE))
+		return;
+
+	for (i = min; i <= max; i++)
+		set_bit(i, vport->vmid_priority_range);
+}
+
+void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
+{
+	set_bit(ctcl_vmid, vport->vmid_priority_range);
+}
+
+u32 lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport)
+{
+	u32 i;
+
+	i = find_first_bit(vport->vmid_priority_range,
+			   LPFC_VMID_MAX_PRIORITY_RANGE);
+
+	if (i == LPFC_VMID_MAX_PRIORITY_RANGE)
+		return 0;
+
+	clear_bit(i, vport->vmid_priority_range);
+	return i;
+}
+
+#define MAX_PRIORITY_DESC	255
+
+static void
+lpfc_cmpl_els_qfpa(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
+		   struct lpfc_iocbq *rspiocb)
+{
+	struct lpfc_vport *vport = cmdiocb->vport;
+	struct priority_range_desc *desc;
+	struct lpfc_dmabuf *prsp = NULL;
+	struct lpfc_vmid_priority_range *vmid_range = NULL;
+	u32 *data;
+	struct lpfc_dmabuf *dmabuf = cmdiocb->context2;
+	IOCB_t *irsp = &rspiocb->iocb;
+	u8 *pcmd;
+	u32 len, i;
+	struct lpfc_nodelist *ndlp;
+
+	prsp = list_get_first(&dmabuf->list, struct lpfc_dmabuf, list);
+	if (!prsp)
+		goto out;
+
+	ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
+	pcmd = prsp->virt;
+	data = (u32 *)pcmd;
+	if (data[0] == ELS_CMD_LS_RJT) {
+		lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
+				 "6528 QFPA LS_RJT %x  %x ", data[0], data[1]);
+		goto out;
+	}
+	if (irsp->ulpStatus) {
+		lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
+				 "6529 QFPA failed with status %x  %x ",
+				 irsp->ulpStatus, irsp->un.ulpWord[4]);
+		goto out;
+	}
+
+	if (!vport->qfpa_res) {
+		vport->qfpa_res = kmalloc(FCELSSIZE, GFP_KERNEL);
+		if (!vport->qfpa_res)
+			goto out;
+		memset(vport->qfpa_res, 0, FCELSSIZE);
+	}
+
+	len = *((u32 *)(pcmd + 4));
+	len = be32_to_cpu(len);
+	memcpy(vport->qfpa_res, pcmd, len + 8);
+	len = len / LPFC_PRIORITY_RANGE_DESC_SIZE;
+
+	desc = (struct priority_range_desc *)(pcmd + 8);
+	vmid_range = vport->vmid_priority.vmid_range;
+	if (!vmid_range) {
+		vmid_range = kmalloc_array(MAX_PRIORITY_DESC,
+					   sizeof
+					   (struct lpfc_vmid_priority_range),
+					   GFP_KERNEL);
+		if (!vmid_range)
+			goto out;
+		memset(vmid_range, 0, MAX_PRIORITY_DESC *
+		       sizeof(struct lpfc_vmid_priority_range));
+		vport->vmid_priority.vmid_range = vmid_range;
+	}
+	vport->vmid_priority.num_descriptors = len;
+
+	for (i = 0; i < len; i++, vmid_range++, desc++) {
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS,
+				 "6539 vmid values low=%d, high=%d, qos=%d,\n"
+				 " local ve id=%d\n", desc->lo_range,
+				 desc->hi_range, desc->qos_priority,
+				 desc->local_ve_id);
+
+		vmid_range->low = desc->lo_range << 1;
+		if (desc->local_ve_id == QFPA_ODD_ONLY)
+			vmid_range->low++;
+		if (desc->qos_priority)
+			vport->vmid_flag |= LPFC_VMID_QOS_ENABLED;
+		vmid_range->qos = desc->qos_priority;
+
+		vmid_range->high = desc->hi_range << 1;
+		if ((desc->local_ve_id == QFPA_ODD_ONLY) ||
+		    (desc->local_ve_id == QFPA_EVEN_ODD))
+			vmid_range->high++;
+	}
+	lpfc_init_cs_ctl_bitmap(vport);
+	for (i = 0; i < vport->vmid_priority.num_descriptors; i++) {
+		lpfc_vmid_set_cs_ctl_range(vport,
+				vport->vmid_priority.vmid_range[i].low,
+				vport->vmid_priority.vmid_range[i].high);
+	}
+
+	vport->vmid_flag |= LPFC_VMID_QFPA_CMPL;
+ out:
+	lpfc_els_free_iocb(phba, cmdiocb);
+	lpfc_nlp_put(ndlp);
+}
+
+int lpfc_issue_els_qfpa(struct lpfc_vport *vport)
+{
+	struct lpfc_hba *phba = vport->phba;
+	IOCB_t *icmd;
+	struct lpfc_nodelist *ndlp;
+	struct lpfc_iocbq *elsiocb;
+	struct lpfc_sli *psli;
+	u8 *pcmd;
+	int ret;
+
+	psli = &phba->sli;
+
+	ndlp = lpfc_findnode_did(phba->pport, Fabric_DID);
+	if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
+		return FAILURE;
+
+	if (!ndlp)
+		return FAILURE;
+
+	elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_QFPA_SIZE, 2, ndlp,
+				     ndlp->nlp_DID, ELS_CMD_QFPA);
+	if (!elsiocb)
+		return FAILURE;
+
+	icmd = &elsiocb->iocb;
+	pcmd = (u8 *)(((struct lpfc_dmabuf *)elsiocb->context2)->virt);
+
+	*((u32 *)(pcmd)) = ELS_CMD_QFPA;
+	pcmd += 4;
+
+	elsiocb->iocb_cmpl = lpfc_cmpl_els_qfpa;
+
+	elsiocb->context1 = lpfc_nlp_get(ndlp);
+	if (!elsiocb->context1)
+		return FAILURE;
+
+	ret = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 2);
+	if (ret != IOCB_SUCCESS) {
+		lpfc_nlp_put(ndlp);
+		lpfc_els_free_iocb(phba, elsiocb);
+		return FAILURE;
+	}
+	vport->vmid_flag &= ~LPFC_VMID_QOS_ENABLED;
+	return 0;
+}
+
+int
+lpfc_vmid_uvem(struct lpfc_vport *vport,
+	       struct lpfc_vmid *vmid, bool instantiated)
+{
+	struct lpfc_vem_id_desc *vem_id_desc;
+	struct lpfc_nodelist *ndlp;
+	IOCB_t *icmd;
+	struct lpfc_iocbq *elsiocb;
+	struct instantiated_ve_desc *inst_desc;
+	struct lpfc_vmid_context *vmid_context;
+	u8 *pcmd;
+	u32 *len;
+	int ret = 0;
+
+	ndlp = lpfc_findnode_did(vport, Fabric_DID);
+	if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
+		return FAILURE;
+
+	vmid_context = kmalloc(sizeof(*vmid_context), GFP_KERNEL);
+	if (!vmid_context)
+		return FAILURE;
+	elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_UVEM_SIZE, 2,
+				     ndlp, Fabric_DID, ELS_CMD_UVEM);
+	if (!elsiocb)
+		goto out;
+
+	lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS,
+			 "3427 %s %d", vmid->host_vmid, instantiated);
+	vmid_context->vmp = vmid;
+	vmid_context->nlp = ndlp;
+	vmid_context->instantiated = instantiated;
+	elsiocb->vmid_tag.vmid_context = vmid_context;
+	icmd = &elsiocb->iocb;
+	pcmd = (u8 *)(((struct lpfc_dmabuf *)elsiocb->context2)->virt);
+
+	if (uuid_is_null((uuid_t *)vport->lpfc_vmid_host_uuid))
+		memcpy(vport->lpfc_vmid_host_uuid, vmid->host_vmid,
+		       LPFC_COMPRESS_VMID_SIZE);
+
+	*((u32 *)(pcmd)) = ELS_CMD_UVEM;
+	len = (u32 *)(pcmd + 4);
+	*len = cpu_to_be32(LPFC_UVEM_SIZE - 8);
+
+	vem_id_desc = (struct lpfc_vem_id_desc *)(pcmd + 8);
+	vem_id_desc->tag = be32_to_cpu(VEM_ID_DESC_TAG);
+	vem_id_desc->length = be32_to_cpu(LPFC_UVEM_VEM_ID_DESC_SIZE);
+	memcpy(vem_id_desc->vem_id, vport->lpfc_vmid_host_uuid,
+	       LPFC_COMPRESS_VMID_SIZE);
+
+	inst_desc = (struct instantiated_ve_desc *)(pcmd + 32);
+	inst_desc->tag = be32_to_cpu(INSTANTIATED_VE_DESC_TAG);
+	inst_desc->length = be32_to_cpu(LPFC_UVEM_VE_MAP_DESC_SIZE);
+	memcpy(inst_desc->global_vem_id, vmid->host_vmid,
+	       LPFC_COMPRESS_VMID_SIZE);
+
+	bf_set(lpfc_instantiated_nport_id, inst_desc, vport->fc_myDID);
+	bf_set(lpfc_instantiated_local_id, inst_desc,
+	       vmid->un.cs_ctl_vmid);
+	if (instantiated) {
+		inst_desc->tag = be32_to_cpu(INSTANTIATED_VE_DESC_TAG);
+	} else {
+		inst_desc->tag = be32_to_cpu(DEINSTANTIATED_VE_DESC_TAG);
+		lpfc_vmid_put_cs_ctl(vport, vmid->un.cs_ctl_vmid);
+	}
+	inst_desc->word6 = cpu_to_be32(inst_desc->word6);
+
+	elsiocb->iocb_cmpl = lpfc_cmpl_els_uvem;
+
+	elsiocb->context1 = lpfc_nlp_get(ndlp);
+	if (!elsiocb->context1)
+		return FAILURE;
+
+	ret = lpfc_sli_issue_iocb(vport->phba, LPFC_ELS_RING, elsiocb, 0);
+	if (ret != IOCB_SUCCESS) {
+		lpfc_els_free_iocb(vport->phba, elsiocb);
+		goto out;
+	}
+
+	return 0;
+ out:
+	kfree(vmid_context);
+	return FAILURE;
+}
+
+static void
+lpfc_cmpl_els_uvem(struct lpfc_hba *phba, struct lpfc_iocbq *icmdiocb,
+		   struct lpfc_iocbq *rspiocb)
+{
+	struct lpfc_vport *vport = icmdiocb->vport;
+	struct lpfc_dmabuf *prsp = NULL;
+	struct lpfc_vmid_context *vmid_context =
+	    icmdiocb->vmid_tag.vmid_context;
+	struct lpfc_nodelist *ndlp = icmdiocb->context1;
+	u8 *pcmd;
+	u32 *data;
+	IOCB_t *irsp = &rspiocb->iocb;
+	struct lpfc_dmabuf *dmabuf = icmdiocb->context2;
+	struct lpfc_vmid *vmid;
+
+	vmid = vmid_context->vmp;
+	if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
+		ndlp = NULL;
+
+	prsp = list_get_first(&dmabuf->list, struct lpfc_dmabuf, list);
+	if (!prsp)
+		goto out;
+	pcmd = prsp->virt;
+	data = (u32 *)pcmd;
+	if (data[0] == ELS_CMD_LS_RJT) {
+		lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
+				 "4532 UVEM LS_RJT %x %x ", data[0], data[1]);
+		goto out;
+	}
+	if (irsp->ulpStatus) {
+		lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
+				 "4533 UVEM error status %x: %x ",
+				 irsp->ulpStatus, irsp->un.ulpWord[4]);
+		goto out;
+	}
+	spin_lock(&phba->hbalock);
+	/* Set IN USE flag */
+	vport->vmid_flag |= LPFC_VMID_IN_USE;
+	phba->pport->vmid_flag |= LPFC_VMID_IN_USE;
+	spin_unlock(&phba->hbalock);
+
+	if (vmid_context->instantiated) {
+		vmid->flag |= LPFC_VMID_REGISTERED;
+		vmid->flag &= ~LPFC_VMID_REQ_REGISTER;
+	}
+
+ out:
+	kfree(vmid_context);
+	lpfc_els_free_iocb(phba, icmdiocb);
+	lpfc_nlp_put(ndlp);
+}
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 5608 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch contains the routines to save, retrieve and remove the vmids
from the data structure. A hash table is used to save the vmids and
the corresponding UUIDs associated with the application/VMs.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Changed Return code to non-numeric/Symbol

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_scsi.c | 139 ++++++++++++++++++++++++++++++++++
 1 file changed, 139 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index b79b6f03cdb6..6a6a9a314368 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -28,6 +28,7 @@
 #include <asm/unaligned.h>
 #include <linux/t10-pi.h>
 #include <linux/crc-t10dif.h>
+#include <linux/blk-cgroup.h>
 #include <net/checksum.h>
 
 #include <scsi/scsi.h>
@@ -5131,6 +5132,144 @@ void lpfc_poll_timeout(struct timer_list *t)
 	}
 }
 
+/*
+ * lpfc_get_vmid_from_hastable - search the UUID in the hash table
+ * @vport: The virtual port for which this call is being executed.
+ * @hash: calculated hash value
+ * @buf: uuid associated with the VE
+ * Returns the vmid entry associated with the UUID
+ * Make sure to acquire the appropriate lock before invoking this routine.
+ */
+struct lpfc_vmid *lpfc_get_vmid_from_hastable(struct lpfc_vport *vport,
+					      u32 hash, u8 *buf)
+{
+	struct lpfc_vmid *vmp;
+	u16 count = 0;
+
+	while (count < LPFC_VMID_HASH_SIZE) {
+		vmp = vport->hash_table[hash];
+		if (vmp) {
+			if (strncmp(&vmp->host_vmid[0], buf, 16) == 0)
+				return vmp;
+		} else {
+			return NULL;
+		}
+		/* search the next available slot and continue till entry */
+		/* is found */
+		count++;
+		hash++;
+
+		/* or the end is reached */
+		if (hash == LPFC_VMID_HASH_SIZE)
+			hash = 0;
+	}
+	return NULL;
+}
+
+/*
+ * lpfc_put_vmid_from_hastable - put the VMID in the hash table
+ * @vport: The virtual port for which this call is being executed.
+ * @hash - calculated hash value
+ * @vmp: Pointer to a VMID entry representing a VM sending IO
+ *
+ * This routine will insert the newly acquired vmid entity in the hash table.
+ * Make sure to acquire the appropriate lock before invoking this routine.
+ */
+int
+lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
+			   struct lpfc_vmid *vmp)
+{
+	int count = 0;
+
+	while (count < LPFC_VMID_HASH_SIZE) {
+		if (!vport->hash_table[hash]) {
+			vport->hash_table[hash] = vmp;
+			vmp->hash_index = hash;
+			return FAILURE;
+		}
+		/* if the slot is already occupied, a collision has occurred. */
+		/* Store in the next available slot */
+		count++;
+		hash++;
+		/* table is full */
+		if (hash == LPFC_VMID_HASH_SIZE)
+			hash = 0;
+	}
+	return 0;
+}
+
+/*
+ * lpfc_vmid_hash_fn- creates a hash value of the UUID
+ * @uuid: uuid associated with the VE
+ * @len: length of the UUID
+ * Returns the calculated hash value
+ */
+int lpfc_vmid_hash_fn(char *vmid, int len)
+{
+	int c;
+	int hash = 0;
+
+	if (len == 0)
+		return 0;
+	while (len--) {
+		c = *vmid++;
+		if (c >= 'A' && c <= 'Z')
+			c += 'a' - 'A';
+
+		hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
+			(c >> LPFC_VMID_HASH_SHIFT)) * 19;
+	}
+
+	return hash & LPFC_VMID_HASH_MASK;
+}
+
+/*
+ * lpfc_vmid_update_entry - update the vmid entry in the hash table
+ * @vport: The virtual port for which this call is being executed.
+ * @cmd: address of scsi cmmd descriptor
+ * @vmp: Pointer to a VMID entry representing a VM sending IO
+ * @tag: VMID tag
+ */
+void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
+				   *cmd, struct lpfc_vmid *vmp,
+				   union lpfc_vmid_io_tag *tag)
+{
+	u64 *lta;
+
+	if (vport->vmid_priority_tagging)
+		tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
+	else
+		tag->app_id = vmp->un.app_id;
+
+	if (cmd->sc_data_direction == DMA_TO_DEVICE)
+		vmp->io_wr_cnt++;
+	else
+		vmp->io_rd_cnt++;
+
+	/* update the last access timestamp in the table */
+	lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
+	*lta = jiffies;
+}
+
+void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
+{
+	u32 hash;
+	struct lpfc_vmid *pvmid;
+
+	if (vport->port_type == LPFC_PHYSICAL_PORT) {
+		vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
+	} else {
+		hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
+		pvmid =
+		    lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
+						vmid->host_vmid);
+		if (!pvmid)
+			vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
+		else
+			vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
+	}
+}
+
 /**
  * lpfc_queuecommand - scsi_host_template queuecommand entry point
  * @shost: kernel scsi host pointer.
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 5608 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch contains the routines to save, retrieve and remove the vmids
from the data structure. A hash table is used to save the vmids and
the corresponding UUIDs associated with the application/VMs.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Changed Return code to non-numeric/Symbol

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_scsi.c | 139 ++++++++++++++++++++++++++++++++++
 1 file changed, 139 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index b79b6f03cdb6..6a6a9a314368 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -28,6 +28,7 @@
 #include <asm/unaligned.h>
 #include <linux/t10-pi.h>
 #include <linux/crc-t10dif.h>
+#include <linux/blk-cgroup.h>
 #include <net/checksum.h>
 
 #include <scsi/scsi.h>
@@ -5131,6 +5132,144 @@ void lpfc_poll_timeout(struct timer_list *t)
 	}
 }
 
+/*
+ * lpfc_get_vmid_from_hastable - search the UUID in the hash table
+ * @vport: The virtual port for which this call is being executed.
+ * @hash: calculated hash value
+ * @buf: uuid associated with the VE
+ * Returns the vmid entry associated with the UUID
+ * Make sure to acquire the appropriate lock before invoking this routine.
+ */
+struct lpfc_vmid *lpfc_get_vmid_from_hastable(struct lpfc_vport *vport,
+					      u32 hash, u8 *buf)
+{
+	struct lpfc_vmid *vmp;
+	u16 count = 0;
+
+	while (count < LPFC_VMID_HASH_SIZE) {
+		vmp = vport->hash_table[hash];
+		if (vmp) {
+			if (strncmp(&vmp->host_vmid[0], buf, 16) == 0)
+				return vmp;
+		} else {
+			return NULL;
+		}
+		/* search the next available slot and continue till entry */
+		/* is found */
+		count++;
+		hash++;
+
+		/* or the end is reached */
+		if (hash == LPFC_VMID_HASH_SIZE)
+			hash = 0;
+	}
+	return NULL;
+}
+
+/*
+ * lpfc_put_vmid_from_hastable - put the VMID in the hash table
+ * @vport: The virtual port for which this call is being executed.
+ * @hash - calculated hash value
+ * @vmp: Pointer to a VMID entry representing a VM sending IO
+ *
+ * This routine will insert the newly acquired vmid entity in the hash table.
+ * Make sure to acquire the appropriate lock before invoking this routine.
+ */
+int
+lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
+			   struct lpfc_vmid *vmp)
+{
+	int count = 0;
+
+	while (count < LPFC_VMID_HASH_SIZE) {
+		if (!vport->hash_table[hash]) {
+			vport->hash_table[hash] = vmp;
+			vmp->hash_index = hash;
+			return FAILURE;
+		}
+		/* if the slot is already occupied, a collision has occurred. */
+		/* Store in the next available slot */
+		count++;
+		hash++;
+		/* table is full */
+		if (hash == LPFC_VMID_HASH_SIZE)
+			hash = 0;
+	}
+	return 0;
+}
+
+/*
+ * lpfc_vmid_hash_fn- creates a hash value of the UUID
+ * @uuid: uuid associated with the VE
+ * @len: length of the UUID
+ * Returns the calculated hash value
+ */
+int lpfc_vmid_hash_fn(char *vmid, int len)
+{
+	int c;
+	int hash = 0;
+
+	if (len == 0)
+		return 0;
+	while (len--) {
+		c = *vmid++;
+		if (c >= 'A' && c <= 'Z')
+			c += 'a' - 'A';
+
+		hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
+			(c >> LPFC_VMID_HASH_SHIFT)) * 19;
+	}
+
+	return hash & LPFC_VMID_HASH_MASK;
+}
+
+/*
+ * lpfc_vmid_update_entry - update the vmid entry in the hash table
+ * @vport: The virtual port for which this call is being executed.
+ * @cmd: address of scsi cmmd descriptor
+ * @vmp: Pointer to a VMID entry representing a VM sending IO
+ * @tag: VMID tag
+ */
+void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
+				   *cmd, struct lpfc_vmid *vmp,
+				   union lpfc_vmid_io_tag *tag)
+{
+	u64 *lta;
+
+	if (vport->vmid_priority_tagging)
+		tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
+	else
+		tag->app_id = vmp->un.app_id;
+
+	if (cmd->sc_data_direction == DMA_TO_DEVICE)
+		vmp->io_wr_cnt++;
+	else
+		vmp->io_rd_cnt++;
+
+	/* update the last access timestamp in the table */
+	lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
+	*lta = jiffies;
+}
+
+void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
+{
+	u32 hash;
+	struct lpfc_vmid *pvmid;
+
+	if (vport->port_type == LPFC_PHYSICAL_PORT) {
+		vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
+	} else {
+		hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
+		pvmid =
+		    lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
+						vmid->host_vmid);
+		if (!pvmid)
+			vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
+		else
+			vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
+	}
+}
+
 /**
  * lpfc_queuecommand - scsi_host_template queuecommand entry point
  * @shost: kernel scsi host pointer.
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid.
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 9426 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

The patch implements CT commands for registering and deregistering the
appid for the application. Also, a small change in decrementing the ndlp
ref counter has been added.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
Removed redundant code due to changes since last submit
---
 drivers/scsi/lpfc/lpfc_ct.c | 249 ++++++++++++++++++++++++++++++++++++
 1 file changed, 249 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index dd0b432f7ac5..5099c46f4c4e 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -3744,3 +3744,252 @@ lpfc_decode_firmware_rev(struct lpfc_hba *phba, char *fwrevision, int flag)
 	}
 	return;
 }
+
+void
+lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
+		      struct lpfc_iocbq *rspiocb)
+{
+	struct lpfc_vport *vport = cmdiocb->vport;
+	struct lpfc_dmabuf *inp = cmdiocb->context1;
+	struct lpfc_dmabuf *outp = cmdiocb->context2;
+	struct lpfc_sli_ct_request *ctcmd = inp->virt;
+	struct lpfc_sli_ct_request *ctrsp = outp->virt;
+	u16 rsp = ctrsp->CommandResponse.bits.CmdRsp;
+	struct app_id_object *app;
+	u32 cmd, hash;
+	struct lpfc_vmid *vmp;
+	u8 *data = outp->virt;
+	int i;
+
+	cmd = be16_to_cpu(ctcmd->CommandResponse.bits.CmdRsp);
+	if (cmd == SLI_CTAS_DALLAPP_ID)
+		lpfc_ct_free_iocb(phba, cmdiocb);
+
+	if (lpfc_els_chk_latt(vport) || rspiocb->iocb.ulpStatus) {
+		if (cmd != SLI_CTAS_DALLAPP_ID)
+			return;
+	}
+	/* Check for a CT LS_RJT response */
+	if (rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
+		if (cmd != SLI_CTAS_DALLAPP_ID)
+			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+					 "3306 VMID FS_RJT Data: x%x  %x %x\n",
+				 cmd, ctrsp->ReasonCode, ctrsp->Explanation);
+		if ((cmd != SLI_CTAS_DALLAPP_ID) ||
+		    (ctrsp->ReasonCode != SLI_CT_UNABLE_TO_PERFORM_REQ) ||
+		    (ctrsp->Explanation != SLI_CT_APP_ID_NOT_AVAILABLE)) {
+			/* If DALLAPP_ID failed retry later */
+			if (cmd == SLI_CTAS_DALLAPP_ID)
+				vport->load_flag |= FC_DEREGISTER_ALL_APP_ID;
+			return;
+		}
+	}
+
+	switch (cmd) {
+	case SLI_CTAS_RAPP_IDENT:
+		app = (struct app_id_object *)(RAPP_IDENT_OFFSET + data);
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "6712 RAPP_IDENT app id %d  port id %x id\n"
+				 "len %d\n", be32_to_cpu(app->app_id),
+				 be32_to_cpu(app->port_id),
+				 app->obj.entity_id_len);
+
+		if (app->obj.entity_id_len == 0 || app->port_id == 0)
+			return;
+
+		hash = lpfc_vmid_hash_fn(app->obj.entity_id,
+					 app->obj.entity_id_len);
+		vmp = lpfc_get_vmid_from_hastable(vport, hash,
+						  app->obj.entity_id);
+		if (vmp) {
+			vmp->un.app_id = be32_to_cpu(app->app_id);
+			vmp->flag |= LPFC_VMID_REGISTERED;
+			vmp->flag &= ~LPFC_VMID_REQ_REGISTER;
+			/* Set IN USE flag */
+			vport->vmid_flag |= LPFC_VMID_IN_USE;
+		} else {
+			lpfc_printf_vlog(vport, KERN_DEBUG,
+					 LOG_DISCOVERY, "6901 No entry found\n"
+					 "%s hash %d\n", app->obj.entity_id,
+					 hash);
+		}
+		break;
+	case SLI_CTAS_DAPP_IDENT:
+		app = (struct app_id_object *)(DAPP_IDENT_OFFSET + data);
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "6713 DAPP_IDENT app id %d  port id %x",
+				 cpu_to_be32(app->app_id),
+				 cpu_to_be32(app->port_id));
+		break;
+	case SLI_CTAS_DALLAPP_ID:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "8856 Deregistered all app ids");
+		for (i = 0; i < phba->cfg_max_vmid; i++) {
+			vmp = &vport->vmid[i];
+			if (vmp->flag != LPFC_VMID_SLOT_FREE)
+				memset(vmp, 0, sizeof(struct lpfc_vmid));
+		}
+		for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
+			vport->hash_table[i] = NULL;
+		vport->load_flag |= FC_ALLOW_VMID;
+		break;
+	default:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "8857 Invalid command code");
+	}
+}
+
+/**
+ * lpfc_vmid_cmd - Build and send a FDMI cmd to the specified NPort
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @ndlp: ndlp to send FDMI cmd to (if NULL use FDMI_DID)
+ * cmdcode: FDMI command to send
+ * mask: Mask of HBA or PORT Attributes to send
+ *
+ * Builds and sends a FDMI command using the CT subsystem.
+ */
+int
+lpfc_vmid_cmd(struct lpfc_vport *vport,
+	      int cmdcode, struct lpfc_vmid *vmid)
+{
+	struct lpfc_hba *phba = vport->phba;
+	struct lpfc_dmabuf *mp, *bmp;
+	struct lpfc_sli_ct_request *ctreq;
+	struct ulp_bde64 *bpl;
+	u32 size;
+	u32 rsp_size;
+	u8 *data;
+	struct lpfc_vmid_rapp_ident_list *rap;
+	struct lpfc_vmid_dapp_ident_list *dap;
+	u8 retry = 0;
+	struct lpfc_nodelist *ndlp;
+
+	void (*cmpl)(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
+		     struct lpfc_iocbq *rspiocb);
+
+	ndlp = lpfc_findnode_did(vport, FDMI_DID);
+	if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
+		return 0;
+
+	cmpl = lpfc_cmpl_ct_cmd_vmid;
+
+	/* fill in BDEs for command */
+	/* Allocate buffer for command payload */
+	mp = kmalloc(sizeof(*mp), GFP_KERNEL);
+	if (!mp)
+		goto vmid_free_mp_exit;
+
+	mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys);
+	if (!mp->virt)
+		goto vmid_free_mp_virt_exit;
+
+	/* Allocate buffer for Buffer ptr list */
+	bmp = kmalloc(sizeof(*bmp), GFP_KERNEL);
+	if (!bmp)
+		goto vmid_free_bmp_exit;
+
+	bmp->virt = lpfc_mbuf_alloc(phba, 0, &bmp->phys);
+	if (!bmp->virt)
+		goto vmid_free_bmp_virt_exit;
+
+	INIT_LIST_HEAD(&mp->list);
+	INIT_LIST_HEAD(&bmp->list);
+
+	lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
+			 "0218 VMID Request Data: x%x x%x x%x",
+			 vport->fc_flag, vport->port_state, cmdcode);
+	ctreq = (struct lpfc_sli_ct_request *)mp->virt;
+	data = mp->virt;
+	/* First populate the CT_IU preamble */
+	memset(data, 0, LPFC_BPL_SIZE);
+	ctreq->RevisionId.bits.Revision = SLI_CT_REVISION;
+	ctreq->RevisionId.bits.InId = 0;
+
+	ctreq->FsType = SLI_CT_MANAGEMENT_SERVICE;
+	ctreq->FsSubType = SLI_CT_APP_SEV_Subtypes;
+
+	ctreq->CommandResponse.bits.CmdRsp = cpu_to_be16(cmdcode);
+	rsp_size = LPFC_BPL_SIZE;
+	size = 0;
+
+	switch (cmdcode) {
+	case SLI_CTAS_RAPP_IDENT:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "1329 RAPP_IDENT for %s", vmid->host_vmid);
+		ctreq->un.PortID = cpu_to_be32(vport->fc_myDID);
+		rap = (struct lpfc_vmid_rapp_ident_list *)
+			(DAPP_IDENT_OFFSET + data);
+		rap->no_of_objects = cpu_to_be32(1);
+		rap->obj[0].entity_id_len = vmid->vmid_len;
+		memcpy(rap->obj[0].entity_id, vmid->host_vmid, vmid->vmid_len);
+		size = RAPP_IDENT_OFFSET +
+			sizeof(struct lpfc_vmid_rapp_ident_list);
+		retry = 1;
+		break;
+
+	case SLI_CTAS_GALLAPPIA_ID:
+		ctreq->un.PortID = cpu_to_be32(vport->fc_myDID);
+		size = GALLAPPIA_ID_SIZE;
+		break;
+
+	case SLI_CTAS_DAPP_IDENT:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "1469 DAPP_IDENT for %s", vmid->host_vmid);
+		ctreq->un.PortID = cpu_to_be32(vport->fc_myDID);
+		dap = (struct lpfc_vmid_dapp_ident_list *)
+			(DAPP_IDENT_OFFSET + data);
+		dap->no_of_objects = cpu_to_be32(1);
+		dap->obj[0].entity_id_len = vmid->vmid_len;
+		memcpy(dap->obj[0].entity_id, vmid->host_vmid, vmid->vmid_len);
+		size = DAPP_IDENT_OFFSET +
+			sizeof(struct lpfc_vmid_dapp_ident_list);
+		vmid->flag &= ~LPFC_VMID_REGISTERED;
+		retry = 1;
+		break;
+
+	case SLI_CTAS_DALLAPP_ID:
+		ctreq->un.PortID = cpu_to_be32(vport->fc_myDID);
+		size = DALLAPP_ID_SIZE;
+		break;
+
+	default:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "7062 VMID cmdcode x%x not supported",
+				 cmdcode);
+		goto vmid_free_all_mem;
+	}
+
+	ctreq->CommandResponse.bits.Size = cpu_to_be16(rsp_size);
+
+	bpl = (struct ulp_bde64 *)bmp->virt;
+	bpl->addrHigh = putPaddrHigh(mp->phys);
+	bpl->addrLow = putPaddrLow(mp->phys);
+	bpl->tus.f.bdeFlags = 0;
+	bpl->tus.f.bdeSize = size;
+
+	/* The lpfc_ct_cmd/lpfc_get_req shall increment ndlp reference count
+	 * to hold ndlp reference for the corresponding callback function.
+	 */
+	if (!lpfc_ct_cmd(vport, mp, bmp, ndlp, cmpl, rsp_size, retry))
+		return 0;
+
+	/* Decrement ndlp reference count to release ndlp reference held
+	 * for the failed command's callback function.
+	 */
+	lpfc_nlp_put(ndlp);
+
+ vmid_free_all_mem:
+	lpfc_mbuf_free(phba, bmp->virt, bmp->phys);
+ vmid_free_bmp_virt_exit:
+	kfree(bmp);
+ vmid_free_bmp_exit:
+	lpfc_mbuf_free(phba, mp->virt, mp->phys);
+ vmid_free_mp_virt_exit:
+	kfree(mp);
+ vmid_free_mp_exit:
+
+	/* Issue FDMI request failed */
+	lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+			 "0244 Issue FDMI request failed Data: x%x", cmdcode);
+	return FAILURE;
+}
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid.
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 9426 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

The patch implements CT commands for registering and deregistering the
appid for the application. Also, a small change in decrementing the ndlp
ref counter has been added.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
Removed redundant code due to changes since last submit
---
 drivers/scsi/lpfc/lpfc_ct.c | 249 ++++++++++++++++++++++++++++++++++++
 1 file changed, 249 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index dd0b432f7ac5..5099c46f4c4e 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -3744,3 +3744,252 @@ lpfc_decode_firmware_rev(struct lpfc_hba *phba, char *fwrevision, int flag)
 	}
 	return;
 }
+
+void
+lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
+		      struct lpfc_iocbq *rspiocb)
+{
+	struct lpfc_vport *vport = cmdiocb->vport;
+	struct lpfc_dmabuf *inp = cmdiocb->context1;
+	struct lpfc_dmabuf *outp = cmdiocb->context2;
+	struct lpfc_sli_ct_request *ctcmd = inp->virt;
+	struct lpfc_sli_ct_request *ctrsp = outp->virt;
+	u16 rsp = ctrsp->CommandResponse.bits.CmdRsp;
+	struct app_id_object *app;
+	u32 cmd, hash;
+	struct lpfc_vmid *vmp;
+	u8 *data = outp->virt;
+	int i;
+
+	cmd = be16_to_cpu(ctcmd->CommandResponse.bits.CmdRsp);
+	if (cmd == SLI_CTAS_DALLAPP_ID)
+		lpfc_ct_free_iocb(phba, cmdiocb);
+
+	if (lpfc_els_chk_latt(vport) || rspiocb->iocb.ulpStatus) {
+		if (cmd != SLI_CTAS_DALLAPP_ID)
+			return;
+	}
+	/* Check for a CT LS_RJT response */
+	if (rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
+		if (cmd != SLI_CTAS_DALLAPP_ID)
+			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+					 "3306 VMID FS_RJT Data: x%x  %x %x\n",
+				 cmd, ctrsp->ReasonCode, ctrsp->Explanation);
+		if ((cmd != SLI_CTAS_DALLAPP_ID) ||
+		    (ctrsp->ReasonCode != SLI_CT_UNABLE_TO_PERFORM_REQ) ||
+		    (ctrsp->Explanation != SLI_CT_APP_ID_NOT_AVAILABLE)) {
+			/* If DALLAPP_ID failed retry later */
+			if (cmd == SLI_CTAS_DALLAPP_ID)
+				vport->load_flag |= FC_DEREGISTER_ALL_APP_ID;
+			return;
+		}
+	}
+
+	switch (cmd) {
+	case SLI_CTAS_RAPP_IDENT:
+		app = (struct app_id_object *)(RAPP_IDENT_OFFSET + data);
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "6712 RAPP_IDENT app id %d  port id %x id\n"
+				 "len %d\n", be32_to_cpu(app->app_id),
+				 be32_to_cpu(app->port_id),
+				 app->obj.entity_id_len);
+
+		if (app->obj.entity_id_len == 0 || app->port_id == 0)
+			return;
+
+		hash = lpfc_vmid_hash_fn(app->obj.entity_id,
+					 app->obj.entity_id_len);
+		vmp = lpfc_get_vmid_from_hastable(vport, hash,
+						  app->obj.entity_id);
+		if (vmp) {
+			vmp->un.app_id = be32_to_cpu(app->app_id);
+			vmp->flag |= LPFC_VMID_REGISTERED;
+			vmp->flag &= ~LPFC_VMID_REQ_REGISTER;
+			/* Set IN USE flag */
+			vport->vmid_flag |= LPFC_VMID_IN_USE;
+		} else {
+			lpfc_printf_vlog(vport, KERN_DEBUG,
+					 LOG_DISCOVERY, "6901 No entry found\n"
+					 "%s hash %d\n", app->obj.entity_id,
+					 hash);
+		}
+		break;
+	case SLI_CTAS_DAPP_IDENT:
+		app = (struct app_id_object *)(DAPP_IDENT_OFFSET + data);
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "6713 DAPP_IDENT app id %d  port id %x",
+				 cpu_to_be32(app->app_id),
+				 cpu_to_be32(app->port_id));
+		break;
+	case SLI_CTAS_DALLAPP_ID:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "8856 Deregistered all app ids");
+		for (i = 0; i < phba->cfg_max_vmid; i++) {
+			vmp = &vport->vmid[i];
+			if (vmp->flag != LPFC_VMID_SLOT_FREE)
+				memset(vmp, 0, sizeof(struct lpfc_vmid));
+		}
+		for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
+			vport->hash_table[i] = NULL;
+		vport->load_flag |= FC_ALLOW_VMID;
+		break;
+	default:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "8857 Invalid command code");
+	}
+}
+
+/**
+ * lpfc_vmid_cmd - Build and send a FDMI cmd to the specified NPort
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @ndlp: ndlp to send FDMI cmd to (if NULL use FDMI_DID)
+ * cmdcode: FDMI command to send
+ * mask: Mask of HBA or PORT Attributes to send
+ *
+ * Builds and sends a FDMI command using the CT subsystem.
+ */
+int
+lpfc_vmid_cmd(struct lpfc_vport *vport,
+	      int cmdcode, struct lpfc_vmid *vmid)
+{
+	struct lpfc_hba *phba = vport->phba;
+	struct lpfc_dmabuf *mp, *bmp;
+	struct lpfc_sli_ct_request *ctreq;
+	struct ulp_bde64 *bpl;
+	u32 size;
+	u32 rsp_size;
+	u8 *data;
+	struct lpfc_vmid_rapp_ident_list *rap;
+	struct lpfc_vmid_dapp_ident_list *dap;
+	u8 retry = 0;
+	struct lpfc_nodelist *ndlp;
+
+	void (*cmpl)(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
+		     struct lpfc_iocbq *rspiocb);
+
+	ndlp = lpfc_findnode_did(vport, FDMI_DID);
+	if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
+		return 0;
+
+	cmpl = lpfc_cmpl_ct_cmd_vmid;
+
+	/* fill in BDEs for command */
+	/* Allocate buffer for command payload */
+	mp = kmalloc(sizeof(*mp), GFP_KERNEL);
+	if (!mp)
+		goto vmid_free_mp_exit;
+
+	mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys);
+	if (!mp->virt)
+		goto vmid_free_mp_virt_exit;
+
+	/* Allocate buffer for Buffer ptr list */
+	bmp = kmalloc(sizeof(*bmp), GFP_KERNEL);
+	if (!bmp)
+		goto vmid_free_bmp_exit;
+
+	bmp->virt = lpfc_mbuf_alloc(phba, 0, &bmp->phys);
+	if (!bmp->virt)
+		goto vmid_free_bmp_virt_exit;
+
+	INIT_LIST_HEAD(&mp->list);
+	INIT_LIST_HEAD(&bmp->list);
+
+	lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
+			 "0218 VMID Request Data: x%x x%x x%x",
+			 vport->fc_flag, vport->port_state, cmdcode);
+	ctreq = (struct lpfc_sli_ct_request *)mp->virt;
+	data = mp->virt;
+	/* First populate the CT_IU preamble */
+	memset(data, 0, LPFC_BPL_SIZE);
+	ctreq->RevisionId.bits.Revision = SLI_CT_REVISION;
+	ctreq->RevisionId.bits.InId = 0;
+
+	ctreq->FsType = SLI_CT_MANAGEMENT_SERVICE;
+	ctreq->FsSubType = SLI_CT_APP_SEV_Subtypes;
+
+	ctreq->CommandResponse.bits.CmdRsp = cpu_to_be16(cmdcode);
+	rsp_size = LPFC_BPL_SIZE;
+	size = 0;
+
+	switch (cmdcode) {
+	case SLI_CTAS_RAPP_IDENT:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "1329 RAPP_IDENT for %s", vmid->host_vmid);
+		ctreq->un.PortID = cpu_to_be32(vport->fc_myDID);
+		rap = (struct lpfc_vmid_rapp_ident_list *)
+			(DAPP_IDENT_OFFSET + data);
+		rap->no_of_objects = cpu_to_be32(1);
+		rap->obj[0].entity_id_len = vmid->vmid_len;
+		memcpy(rap->obj[0].entity_id, vmid->host_vmid, vmid->vmid_len);
+		size = RAPP_IDENT_OFFSET +
+			sizeof(struct lpfc_vmid_rapp_ident_list);
+		retry = 1;
+		break;
+
+	case SLI_CTAS_GALLAPPIA_ID:
+		ctreq->un.PortID = cpu_to_be32(vport->fc_myDID);
+		size = GALLAPPIA_ID_SIZE;
+		break;
+
+	case SLI_CTAS_DAPP_IDENT:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "1469 DAPP_IDENT for %s", vmid->host_vmid);
+		ctreq->un.PortID = cpu_to_be32(vport->fc_myDID);
+		dap = (struct lpfc_vmid_dapp_ident_list *)
+			(DAPP_IDENT_OFFSET + data);
+		dap->no_of_objects = cpu_to_be32(1);
+		dap->obj[0].entity_id_len = vmid->vmid_len;
+		memcpy(dap->obj[0].entity_id, vmid->host_vmid, vmid->vmid_len);
+		size = DAPP_IDENT_OFFSET +
+			sizeof(struct lpfc_vmid_dapp_ident_list);
+		vmid->flag &= ~LPFC_VMID_REGISTERED;
+		retry = 1;
+		break;
+
+	case SLI_CTAS_DALLAPP_ID:
+		ctreq->un.PortID = cpu_to_be32(vport->fc_myDID);
+		size = DALLAPP_ID_SIZE;
+		break;
+
+	default:
+		lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+				 "7062 VMID cmdcode x%x not supported",
+				 cmdcode);
+		goto vmid_free_all_mem;
+	}
+
+	ctreq->CommandResponse.bits.Size = cpu_to_be16(rsp_size);
+
+	bpl = (struct ulp_bde64 *)bmp->virt;
+	bpl->addrHigh = putPaddrHigh(mp->phys);
+	bpl->addrLow = putPaddrLow(mp->phys);
+	bpl->tus.f.bdeFlags = 0;
+	bpl->tus.f.bdeSize = size;
+
+	/* The lpfc_ct_cmd/lpfc_get_req shall increment ndlp reference count
+	 * to hold ndlp reference for the corresponding callback function.
+	 */
+	if (!lpfc_ct_cmd(vport, mp, bmp, ndlp, cmpl, rsp_size, retry))
+		return 0;
+
+	/* Decrement ndlp reference count to release ndlp reference held
+	 * for the failed command's callback function.
+	 */
+	lpfc_nlp_put(ndlp);
+
+ vmid_free_all_mem:
+	lpfc_mbuf_free(phba, bmp->virt, bmp->phys);
+ vmid_free_bmp_virt_exit:
+	kfree(bmp);
+ vmid_free_bmp_exit:
+	lpfc_mbuf_free(phba, mp->virt, mp->phys);
+ vmid_free_mp_virt_exit:
+	kfree(mp);
+ vmid_free_mp_exit:
+
+	/* Issue FDMI request failed */
+	lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
+			 "0244 Issue FDMI request failed Data: x%x", cmdcode);
+	return FAILURE;
+}
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 12/16] lpfc: vmid: Appends the vmid in the wqe before sending
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 4733 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch adds the vmid in wqe before sending out the request.
The type of vmid depends on the configured type and is checked before
being appended.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Modified the comments

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_sli.c | 56 +++++++++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index f9b6e32db618..a63371e9feaa 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -3856,7 +3856,7 @@ lpfc_sli_sp_handle_rspiocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
 
 		if (irsp->ulpStatus) {
 			/* Rsp ring <ringno> error: IOCB */
-			lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
+			lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
 					"0328 Rsp Ring %d error: "
 					"IOCB Data: "
 					"x%x x%x x%x x%x "
@@ -9762,6 +9762,8 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
 				*pcmd == ELS_CMD_RSCN_XMT ||
 				*pcmd == ELS_CMD_FDISC ||
 				*pcmd == ELS_CMD_LOGO ||
+				*pcmd == ELS_CMD_QFPA ||
+				*pcmd == ELS_CMD_UVEM ||
 				*pcmd == ELS_CMD_PLOGI)) {
 				bf_set(els_req64_sp, &wqe->els_req, 1);
 				bf_set(els_req64_sid, &wqe->els_req,
@@ -9893,6 +9895,24 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
 			ptr = &wqe->words[22];
 			memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd));
 		}
+
+		/* add the VMID tags as per switch response */
+		if (iocbq->iocb_flag & LPFC_IO_VMID) {
+			union lpfc_wqe128 *wqe128;
+
+			if (phba->pport->vmid_priority_tagging) {
+				bf_set(wqe_ccpe, &wqe->fcp_iwrite.wqe_com, 1);
+				bf_set(wqe_ccp, &wqe->fcp_iwrite.wqe_com,
+				       (iocbq->vmid_tag.cs_ctl_vmid));
+				/* Bit 0 must be 0 */
+			} else {
+				wqe128 = (union lpfc_wqe128 *)wqe;
+				bf_set(wqe_appid, &wqe->fcp_iwrite.wqe_com, 1);
+				bf_set(wqe_wqes, &wqe128->fcp_iwrite.wqe_com,
+				       1);
+				wqe128->words[31] = iocbq->vmid_tag.app_id;
+			}
+		}
 		break;
 	case CMD_FCP_IREAD64_CR:
 		/* word3 iocb=iotag wqe=payload_offset_len */
@@ -9957,6 +9977,23 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
 			ptr = &wqe->words[22];
 			memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd));
 		}
+
+		/* add the VMID tags as per switch response */
+		if (iocbq->iocb_flag & LPFC_IO_VMID) {
+			union lpfc_wqe128 *wqe128;
+
+			if (phba->pport->vmid_priority_tagging) {
+				bf_set(wqe_ccpe, &wqe->fcp_iread.wqe_com, 1);
+				bf_set(wqe_ccp, &wqe->fcp_iread.wqe_com,
+				       (iocbq->vmid_tag.cs_ctl_vmid));
+				/* Bit 0 must be 0 */
+			} else {
+				wqe128 = (union lpfc_wqe128 *)wqe;
+				bf_set(wqe_appid, &wqe->fcp_iread.wqe_com, 1);
+				bf_set(wqe_wqes, &wqe128->fcp_iread.wqe_com, 1);
+				wqe128->words[31] = iocbq->vmid_tag.app_id;
+			}
+		}
 		break;
 	case CMD_FCP_ICMND64_CR:
 		/* word3 iocb=iotag wqe=payload_offset_len */
@@ -10014,6 +10051,23 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
 			ptr = &wqe->words[22];
 			memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd));
 		}
+
+		/* add the VMID tags as per switch response */
+		if (iocbq->iocb_flag & LPFC_IO_VMID) {
+			union lpfc_wqe128 *wqe128;
+
+			if (phba->pport->vmid_priority_tagging) {
+				bf_set(wqe_ccpe, &wqe->fcp_icmd.wqe_com, 1);
+				bf_set(wqe_ccp, &wqe->fcp_icmd.wqe_com,
+				       (iocbq->vmid_tag.cs_ctl_vmid));
+				/* Bit 0 must be 0 */
+			} else {
+				wqe128 = (union lpfc_wqe128 *)wqe;
+				bf_set(wqe_appid, &wqe->fcp_icmd.wqe_com, 1);
+				bf_set(wqe_wqes, &wqe128->fcp_icmd.wqe_com, 1);
+				wqe128->words[31] = iocbq->vmid_tag.app_id;
+			}
+		}
 		break;
 	case CMD_GEN_REQUEST64_CR:
 		/* For this command calculate the xmit length of the
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 12/16] lpfc: vmid: Appends the vmid in the wqe before sending
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 4733 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch adds the vmid in wqe before sending out the request.
The type of vmid depends on the configured type and is checked before
being appended.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
Modified the comments

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_sli.c | 56 +++++++++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index f9b6e32db618..a63371e9feaa 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -3856,7 +3856,7 @@ lpfc_sli_sp_handle_rspiocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
 
 		if (irsp->ulpStatus) {
 			/* Rsp ring <ringno> error: IOCB */
-			lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
+			lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
 					"0328 Rsp Ring %d error: "
 					"IOCB Data: "
 					"x%x x%x x%x x%x "
@@ -9762,6 +9762,8 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
 				*pcmd == ELS_CMD_RSCN_XMT ||
 				*pcmd == ELS_CMD_FDISC ||
 				*pcmd == ELS_CMD_LOGO ||
+				*pcmd == ELS_CMD_QFPA ||
+				*pcmd == ELS_CMD_UVEM ||
 				*pcmd == ELS_CMD_PLOGI)) {
 				bf_set(els_req64_sp, &wqe->els_req, 1);
 				bf_set(els_req64_sid, &wqe->els_req,
@@ -9893,6 +9895,24 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
 			ptr = &wqe->words[22];
 			memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd));
 		}
+
+		/* add the VMID tags as per switch response */
+		if (iocbq->iocb_flag & LPFC_IO_VMID) {
+			union lpfc_wqe128 *wqe128;
+
+			if (phba->pport->vmid_priority_tagging) {
+				bf_set(wqe_ccpe, &wqe->fcp_iwrite.wqe_com, 1);
+				bf_set(wqe_ccp, &wqe->fcp_iwrite.wqe_com,
+				       (iocbq->vmid_tag.cs_ctl_vmid));
+				/* Bit 0 must be 0 */
+			} else {
+				wqe128 = (union lpfc_wqe128 *)wqe;
+				bf_set(wqe_appid, &wqe->fcp_iwrite.wqe_com, 1);
+				bf_set(wqe_wqes, &wqe128->fcp_iwrite.wqe_com,
+				       1);
+				wqe128->words[31] = iocbq->vmid_tag.app_id;
+			}
+		}
 		break;
 	case CMD_FCP_IREAD64_CR:
 		/* word3 iocb=iotag wqe=payload_offset_len */
@@ -9957,6 +9977,23 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
 			ptr = &wqe->words[22];
 			memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd));
 		}
+
+		/* add the VMID tags as per switch response */
+		if (iocbq->iocb_flag & LPFC_IO_VMID) {
+			union lpfc_wqe128 *wqe128;
+
+			if (phba->pport->vmid_priority_tagging) {
+				bf_set(wqe_ccpe, &wqe->fcp_iread.wqe_com, 1);
+				bf_set(wqe_ccp, &wqe->fcp_iread.wqe_com,
+				       (iocbq->vmid_tag.cs_ctl_vmid));
+				/* Bit 0 must be 0 */
+			} else {
+				wqe128 = (union lpfc_wqe128 *)wqe;
+				bf_set(wqe_appid, &wqe->fcp_iread.wqe_com, 1);
+				bf_set(wqe_wqes, &wqe128->fcp_iread.wqe_com, 1);
+				wqe128->words[31] = iocbq->vmid_tag.app_id;
+			}
+		}
 		break;
 	case CMD_FCP_ICMND64_CR:
 		/* word3 iocb=iotag wqe=payload_offset_len */
@@ -10014,6 +10051,23 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
 			ptr = &wqe->words[22];
 			memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd));
 		}
+
+		/* add the VMID tags as per switch response */
+		if (iocbq->iocb_flag & LPFC_IO_VMID) {
+			union lpfc_wqe128 *wqe128;
+
+			if (phba->pport->vmid_priority_tagging) {
+				bf_set(wqe_ccpe, &wqe->fcp_icmd.wqe_com, 1);
+				bf_set(wqe_ccp, &wqe->fcp_icmd.wqe_com,
+				       (iocbq->vmid_tag.cs_ctl_vmid));
+				/* Bit 0 must be 0 */
+			} else {
+				wqe128 = (union lpfc_wqe128 *)wqe;
+				bf_set(wqe_appid, &wqe->fcp_icmd.wqe_com, 1);
+				bf_set(wqe_wqes, &wqe128->fcp_icmd.wqe_com, 1);
+				wqe128->words[31] = iocbq->vmid_tag.app_id;
+			}
+		}
 		break;
 	case CMD_GEN_REQUEST64_CR:
 		/* For this command calculate the xmit length of the
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 13/16] lpfc: vmid: Timeout implementation for vmid
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 6702 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch implements the timeout functionality for the vmid. After the
set time period of inactivity, the vmid is deregistered from the switch.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_hbadisc.c | 109 +++++++++++++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_init.c    |  40 ++++++++++++
 2 files changed, 149 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 2b6b5fc671fe..be71f3a47c95 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -229,6 +229,115 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
 	return;
 }
 
+/**
+ * lpfc_check_inactive_vmid_one - VMID inactivity checker for a vport
+ * @vport: Pointer to vport context object.
+ *
+ * This function checks for idle vmid entries related to a particular vport. If
+ * found unused/idle, it frees them accordingly.
+ **/
+static void lpfc_check_inactive_vmid_one(struct lpfc_vport *vport)
+{
+	u16 i, keep;
+	u32 difftime = 0, r;
+	u64 *lta;
+	int cpu;
+
+	write_lock(&vport->vmid_lock);
+
+	if (!vport->cur_vmid_cnt)
+		goto out;
+
+	/* iterate through the table */
+	for (i = 0; i < LPFC_VMID_HASH_SIZE; ++i) {
+		if (vport->hash_table[i] && (vport->hash_table[i]->flag &
+					     LPFC_VMID_REGISTERED)) {
+			/* check if the particular vmid is in use */
+			/* for all available per cpu variable */
+			for_each_possible_cpu(cpu) {
+				/* if last access time is less than timeout */
+				lta = per_cpu_ptr(
+					vport->hash_table[i]->last_io_time,
+					cpu);
+				if (!lta)
+					continue;
+				difftime = (jiffies) - (*lta);
+				if ((vport->vmid_inactivity_timeout *
+				     JIFFIES_PER_HR) > difftime) {
+					keep = 1;
+					break;
+				}
+			}
+
+			/* if none of the cpus have been used by the vm, */
+			/*  remove the entry if already registered */
+			if (!keep) {
+				/* mark the entry for deregistration */
+				vport->hash_table[i]->flag =
+					LPFC_VMID_DE_REGISTER;
+				write_unlock(&vport->vmid_lock);
+				if (vport->vmid_priority_tagging)
+					r = lpfc_vmid_uvem(vport,
+							   vport->hash_table[i],
+							   false);
+				else
+					r = lpfc_vmid_cmd(vport,
+							  SLI_CTAS_DAPP_IDENT,
+							  vport->hash_table[i]);
+
+				/* decrement number of active vms and mark */
+				/* entry in slot as free */
+				write_lock(&vport->vmid_lock);
+				if (!r) {
+					struct lpfc_vmid *ht =
+							vport->hash_table[i];
+					vport->cur_vmid_cnt--;
+					ht->flag = LPFC_VMID_SLOT_FREE;
+					free_percpu(ht->last_io_time);
+					ht->last_io_time = NULL;
+					vport->hash_table[i] = NULL;
+				}
+			}
+		}
+		keep = 0;
+	}
+ out:
+	write_unlock(&vport->vmid_lock);
+}
+
+/**
+ * lpfc_check_inactive_vmid - VMID inactivity checker
+ * @phba: Pointer to hba context object.
+ *
+ * This function is called from the worker thread to determine if an entry in
+ * the vmid table can be released since there was no IO activity seen from that
+ * particular VM for the specified time. When this happens, the entry in the
+ * table is released and also the resources on the switch cleared.
+ **/
+
+void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
+{
+	struct lpfc_vport *vport;
+	struct lpfc_vport **vports;
+	int i;
+
+	vports = lpfc_create_vport_work_array(phba);
+	if (!vports)
+		return;
+
+	for (i = 0; i <= phba->max_vports; i++) {
+		if ((!vports[i]) && (i == 0))
+			vport = phba->pport;
+		else
+			vport = vports[i];
+		if (!vport)
+			break;
+
+		lpfc_check_inactive_vmid_one(vport);
+	}
+	lpfc_destroy_vport_work_array(phba, vports);
+}
+
 /**
  * lpfc_dev_loss_tmo_handler - Remote node devloss timeout handler
  * @ndlp: Pointer to remote node object.
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 8318dfdc7d87..d1187ec80cb3 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4811,6 +4811,42 @@ lpfc_sli4_fcf_redisc_wait_tmo(struct timer_list *t)
 	lpfc_worker_wake_up(phba);
 }
 
+/**
+ * lpfc_vmid_poll - VMID timeout detection
+ * @ptr: Map to lpfc_hba data structure pointer.
+ *
+ * This routine is invoked when there is no IO on by a VM for the specified
+ * amount of time. When this situation is detected, the VMID has to be
+ * deregistered from the switch and all the local resources freed. The VMID
+ * will be reassigned to the VM once the IO begins.
+ **/
+static void
+lpfc_vmid_poll(struct timer_list *t)
+{
+	struct lpfc_hba *phba = from_timer(phba, t, inactive_vmid_poll);
+	u32 wake_up = 0;
+
+	/* check if there is a need to issue QFPA */
+	if (phba->pport->vmid_priority_tagging) {
+		wake_up = 1;
+		phba->pport->work_port_events |= WORKER_CHECK_VMID_ISSUE_QFPA;
+	}
+
+	/* Is the vmid inactivity timer enabled */
+	if (phba->pport->vmid_inactivity_timeout ||
+	    phba->pport->load_flag & FC_DEREGISTER_ALL_APP_ID) {
+		wake_up = 1;
+		phba->pport->work_port_events |= WORKER_CHECK_INACTIVE_VMID;
+	}
+
+	if (wake_up)
+		lpfc_worker_wake_up(phba);
+
+	/* restart the timer for the next iteration */
+	mod_timer(&phba->inactive_vmid_poll, jiffies + msecs_to_jiffies(1000 *
+							LPFC_VMID_TIMER));
+}
+
 /**
  * lpfc_sli4_parse_latt_fault - Parse sli4 link-attention link fault code
  * @phba: pointer to lpfc hba data structure.
@@ -6657,6 +6693,10 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
 	phba->hbqs[LPFC_ELS_HBQ].hbq_alloc_buffer = lpfc_sli4_rb_alloc;
 	phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer = lpfc_sli4_rb_free;
 
+	/* for VMID idle timeout if VMID is enabled */
+	if (lpfc_is_vmid_enabled(phba))
+		timer_setup(&phba->inactive_vmid_poll, lpfc_vmid_poll, 0);
+
 	/*
 	 * Initialize the SLI Layer to run with lpfc SLI4 HBAs.
 	 */
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 13/16] lpfc: vmid: Timeout implementation for vmid
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 6702 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch implements the timeout functionality for the vmid. After the
set time period of inactivity, the vmid is deregistered from the switch.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_hbadisc.c | 109 +++++++++++++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_init.c    |  40 ++++++++++++
 2 files changed, 149 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 2b6b5fc671fe..be71f3a47c95 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -229,6 +229,115 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
 	return;
 }
 
+/**
+ * lpfc_check_inactive_vmid_one - VMID inactivity checker for a vport
+ * @vport: Pointer to vport context object.
+ *
+ * This function checks for idle vmid entries related to a particular vport. If
+ * found unused/idle, it frees them accordingly.
+ **/
+static void lpfc_check_inactive_vmid_one(struct lpfc_vport *vport)
+{
+	u16 i, keep;
+	u32 difftime = 0, r;
+	u64 *lta;
+	int cpu;
+
+	write_lock(&vport->vmid_lock);
+
+	if (!vport->cur_vmid_cnt)
+		goto out;
+
+	/* iterate through the table */
+	for (i = 0; i < LPFC_VMID_HASH_SIZE; ++i) {
+		if (vport->hash_table[i] && (vport->hash_table[i]->flag &
+					     LPFC_VMID_REGISTERED)) {
+			/* check if the particular vmid is in use */
+			/* for all available per cpu variable */
+			for_each_possible_cpu(cpu) {
+				/* if last access time is less than timeout */
+				lta = per_cpu_ptr(
+					vport->hash_table[i]->last_io_time,
+					cpu);
+				if (!lta)
+					continue;
+				difftime = (jiffies) - (*lta);
+				if ((vport->vmid_inactivity_timeout *
+				     JIFFIES_PER_HR) > difftime) {
+					keep = 1;
+					break;
+				}
+			}
+
+			/* if none of the cpus have been used by the vm, */
+			/*  remove the entry if already registered */
+			if (!keep) {
+				/* mark the entry for deregistration */
+				vport->hash_table[i]->flag =
+					LPFC_VMID_DE_REGISTER;
+				write_unlock(&vport->vmid_lock);
+				if (vport->vmid_priority_tagging)
+					r = lpfc_vmid_uvem(vport,
+							   vport->hash_table[i],
+							   false);
+				else
+					r = lpfc_vmid_cmd(vport,
+							  SLI_CTAS_DAPP_IDENT,
+							  vport->hash_table[i]);
+
+				/* decrement number of active vms and mark */
+				/* entry in slot as free */
+				write_lock(&vport->vmid_lock);
+				if (!r) {
+					struct lpfc_vmid *ht =
+							vport->hash_table[i];
+					vport->cur_vmid_cnt--;
+					ht->flag = LPFC_VMID_SLOT_FREE;
+					free_percpu(ht->last_io_time);
+					ht->last_io_time = NULL;
+					vport->hash_table[i] = NULL;
+				}
+			}
+		}
+		keep = 0;
+	}
+ out:
+	write_unlock(&vport->vmid_lock);
+}
+
+/**
+ * lpfc_check_inactive_vmid - VMID inactivity checker
+ * @phba: Pointer to hba context object.
+ *
+ * This function is called from the worker thread to determine if an entry in
+ * the vmid table can be released since there was no IO activity seen from that
+ * particular VM for the specified time. When this happens, the entry in the
+ * table is released and also the resources on the switch cleared.
+ **/
+
+void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
+{
+	struct lpfc_vport *vport;
+	struct lpfc_vport **vports;
+	int i;
+
+	vports = lpfc_create_vport_work_array(phba);
+	if (!vports)
+		return;
+
+	for (i = 0; i <= phba->max_vports; i++) {
+		if ((!vports[i]) && (i == 0))
+			vport = phba->pport;
+		else
+			vport = vports[i];
+		if (!vport)
+			break;
+
+		lpfc_check_inactive_vmid_one(vport);
+	}
+	lpfc_destroy_vport_work_array(phba, vports);
+}
+
 /**
  * lpfc_dev_loss_tmo_handler - Remote node devloss timeout handler
  * @ndlp: Pointer to remote node object.
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 8318dfdc7d87..d1187ec80cb3 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4811,6 +4811,42 @@ lpfc_sli4_fcf_redisc_wait_tmo(struct timer_list *t)
 	lpfc_worker_wake_up(phba);
 }
 
+/**
+ * lpfc_vmid_poll - VMID timeout detection
+ * @ptr: Map to lpfc_hba data structure pointer.
+ *
+ * This routine is invoked when there is no IO on by a VM for the specified
+ * amount of time. When this situation is detected, the VMID has to be
+ * deregistered from the switch and all the local resources freed. The VMID
+ * will be reassigned to the VM once the IO begins.
+ **/
+static void
+lpfc_vmid_poll(struct timer_list *t)
+{
+	struct lpfc_hba *phba = from_timer(phba, t, inactive_vmid_poll);
+	u32 wake_up = 0;
+
+	/* check if there is a need to issue QFPA */
+	if (phba->pport->vmid_priority_tagging) {
+		wake_up = 1;
+		phba->pport->work_port_events |= WORKER_CHECK_VMID_ISSUE_QFPA;
+	}
+
+	/* Is the vmid inactivity timer enabled */
+	if (phba->pport->vmid_inactivity_timeout ||
+	    phba->pport->load_flag & FC_DEREGISTER_ALL_APP_ID) {
+		wake_up = 1;
+		phba->pport->work_port_events |= WORKER_CHECK_INACTIVE_VMID;
+	}
+
+	if (wake_up)
+		lpfc_worker_wake_up(phba);
+
+	/* restart the timer for the next iteration */
+	mod_timer(&phba->inactive_vmid_poll, jiffies + msecs_to_jiffies(1000 *
+							LPFC_VMID_TIMER));
+}
+
 /**
  * lpfc_sli4_parse_latt_fault - Parse sli4 link-attention link fault code
  * @phba: pointer to lpfc hba data structure.
@@ -6657,6 +6693,10 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
 	phba->hbqs[LPFC_ELS_HBQ].hbq_alloc_buffer = lpfc_sli4_rb_alloc;
 	phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer = lpfc_sli4_rb_free;
 
+	/* for VMID idle timeout if VMID is enabled */
+	if (lpfc_is_vmid_enabled(phba))
+		timer_setup(&phba->inactive_vmid_poll, lpfc_vmid_poll, 0);
+
 	/*
 	 * Initialize the SLI Layer to run with lpfc SLI4 HBAs.
 	 */
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread
  2020-12-16  5:29 ` Muneendra
  (?)
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 3013 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch add the periodic check for issuing of qfpa command and vmid
timeout in the worker thread. The inactivity timeout check is added via
the timer function.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_hbadisc.c | 42 ++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index be71f3a47c95..3b36710cd47e 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -428,6 +428,32 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
 	return fcf_inuse;
 }
 
+void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
+{
+	struct lpfc_vport *vport;
+	struct lpfc_vport **vports;
+	int i, ret;
+
+	vports = lpfc_create_vport_work_array(phba);
+	if (!vports)
+		return;
+
+	for (i = 0; i <= phba->max_vports; i++) {
+		if ((!vports[i]) && (i == 0))
+			vport = phba->pport;
+		else
+			vport = vports[i];
+		if (!vport)
+			break;
+
+		if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) {
+			ret = lpfc_issue_els_qfpa(vport);
+			vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA;
+		}
+	}
+	lpfc_destroy_vport_work_array(phba, vports);
+}
+
 /**
  * lpfc_sli4_post_dev_loss_tmo_handler - SLI4 post devloss timeout handler
  * @phba: Pointer to hba context object.
@@ -748,6 +774,22 @@ lpfc_work_done(struct lpfc_hba *phba)
 	if (ha_copy & HA_LATT)
 		lpfc_handle_latt(phba);
 
+	/* Handle VMID Events */
+	if (lpfc_is_vmid_enabled(phba)) {
+		if (phba->pport->work_port_events &
+		    WORKER_CHECK_VMID_ISSUE_QFPA) {
+			lpfc_check_vmid_qfpa_issue(phba);
+			phba->pport->work_port_events &=
+				~WORKER_CHECK_VMID_ISSUE_QFPA;
+		}
+		if (phba->pport->work_port_events &
+		    WORKER_CHECK_INACTIVE_VMID) {
+			lpfc_check_inactive_vmid(phba);
+			phba->pport->work_port_events &=
+			    ~WORKER_CHECK_INACTIVE_VMID;
+		}
+	}
+
 	/* Process SLI4 events */
 	if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) {
 		if (phba->hba_flag & HBA_RRQ_ACTIVE)
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 3013 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch add the periodic check for issuing of qfpa command and vmid
timeout in the worker thread. The inactivity timeout check is added via
the timer function.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_hbadisc.c | 42 ++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index be71f3a47c95..3b36710cd47e 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -428,6 +428,32 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
 	return fcf_inuse;
 }
 
+void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
+{
+	struct lpfc_vport *vport;
+	struct lpfc_vport **vports;
+	int i, ret;
+
+	vports = lpfc_create_vport_work_array(phba);
+	if (!vports)
+		return;
+
+	for (i = 0; i <= phba->max_vports; i++) {
+		if ((!vports[i]) && (i == 0))
+			vport = phba->pport;
+		else
+			vport = vports[i];
+		if (!vport)
+			break;
+
+		if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) {
+			ret = lpfc_issue_els_qfpa(vport);
+			vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA;
+		}
+	}
+	lpfc_destroy_vport_work_array(phba, vports);
+}
+
 /**
  * lpfc_sli4_post_dev_loss_tmo_handler - SLI4 post devloss timeout handler
  * @phba: Pointer to hba context object.
@@ -748,6 +774,22 @@ lpfc_work_done(struct lpfc_hba *phba)
 	if (ha_copy & HA_LATT)
 		lpfc_handle_latt(phba);
 
+	/* Handle VMID Events */
+	if (lpfc_is_vmid_enabled(phba)) {
+		if (phba->pport->work_port_events &
+		    WORKER_CHECK_VMID_ISSUE_QFPA) {
+			lpfc_check_vmid_qfpa_issue(phba);
+			phba->pport->work_port_events &=
+				~WORKER_CHECK_VMID_ISSUE_QFPA;
+		}
+		if (phba->pport->work_port_events &
+		    WORKER_CHECK_INACTIVE_VMID) {
+			lpfc_check_inactive_vmid(phba);
+			phba->pport->work_port_events &=
+			    ~WORKER_CHECK_INACTIVE_VMID;
+		}
+	}
+
 	/* Process SLI4 events */
 	if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) {
 		if (phba->hba_flag & HBA_RRQ_ACTIVE)
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 3013 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch add the periodic check for issuing of qfpa command and vmid
timeout in the worker thread. The inactivity timeout check is added via
the timer function.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_hbadisc.c | 42 ++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index be71f3a47c95..3b36710cd47e 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -428,6 +428,32 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
 	return fcf_inuse;
 }
 
+void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
+{
+	struct lpfc_vport *vport;
+	struct lpfc_vport **vports;
+	int i, ret;
+
+	vports = lpfc_create_vport_work_array(phba);
+	if (!vports)
+		return;
+
+	for (i = 0; i <= phba->max_vports; i++) {
+		if ((!vports[i]) && (i == 0))
+			vport = phba->pport;
+		else
+			vport = vports[i];
+		if (!vport)
+			break;
+
+		if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) {
+			ret = lpfc_issue_els_qfpa(vport);
+			vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA;
+		}
+	}
+	lpfc_destroy_vport_work_array(phba, vports);
+}
+
 /**
  * lpfc_sli4_post_dev_loss_tmo_handler - SLI4 post devloss timeout handler
  * @phba: Pointer to hba context object.
@@ -748,6 +774,22 @@ lpfc_work_done(struct lpfc_hba *phba)
 	if (ha_copy & HA_LATT)
 		lpfc_handle_latt(phba);
 
+	/* Handle VMID Events */
+	if (lpfc_is_vmid_enabled(phba)) {
+		if (phba->pport->work_port_events &
+		    WORKER_CHECK_VMID_ISSUE_QFPA) {
+			lpfc_check_vmid_qfpa_issue(phba);
+			phba->pport->work_port_events &=
+				~WORKER_CHECK_VMID_ISSUE_QFPA;
+		}
+		if (phba->pport->work_port_events &
+		    WORKER_CHECK_INACTIVE_VMID) {
+			lpfc_check_inactive_vmid(phba);
+			phba->pport->work_port_events &=
+			    ~WORKER_CHECK_INACTIVE_VMID;
+		}
+	}
+
 	/* Process SLI4 events */
 	if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) {
 		if (phba->hba_flag & HBA_RRQ_ACTIVE)
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 15/16] lpfc: vmid: Introducing vmid in io path.
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 7287 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

The patch introduces the vmid in the io path. It checks if the vmid is
enabled and if io belongs to a vm or not and acts accordingly. Other
supporing APIs are also included in the patch.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
Replaced blkcg_get_app_identifier with blkcg_get_fc_appid

v2:
Ported the patch on top of 5.10/scsi-queue
Added a fix for issuing QFPA command which was not included in the
last submit
---
 drivers/scsi/lpfc/lpfc_scsi.c | 165 ++++++++++++++++++++++++++++++++++
 1 file changed, 165 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 6a6a9a314368..c464f07d8cd8 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5270,6 +5270,151 @@ void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
 	}
 }
 
+/*
+ * lpfc_vmid_get_appid- get the vmid associated with the uuid
+ * @vport: The virtual port for which this call is being executed.
+ * @uuid: uuid associated with the VE
+ * @cmd: address of scsi cmmd descriptor
+ * @tag: VMID tag
+ * Returns status of the function
+ */
+static int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid, struct
+			       scsi_cmnd * cmd, union lpfc_vmid_io_tag *tag)
+{
+	struct lpfc_vmid *vmp = NULL;
+	int hash, len, rc = 1, i;
+	u8 pending = 0;
+
+	/* check if QFPA is complete */
+	if (lpfc_vmid_is_type_priority_tag(vport) && !(vport->vmid_flag &
+	      LPFC_VMID_QFPA_CMPL)) {
+		vport->work_port_events |= WORKER_CHECK_VMID_ISSUE_QFPA;
+		return FAILURE;
+	}
+
+	/* search if the uuid has already been mapped to the vmid */
+	len = strlen(uuid);
+	hash = lpfc_vmid_hash_fn(uuid, len);
+
+	/* search for the VMID in the table */
+	read_lock(&vport->vmid_lock);
+	vmp = lpfc_get_vmid_from_hastable(vport, hash, uuid);
+	read_unlock(&vport->vmid_lock);
+
+	/* if found, check if its already registered  */
+	if (vmp  && vmp->flag & LPFC_VMID_REGISTERED) {
+		lpfc_vmid_update_entry(vport, cmd, vmp, tag);
+		rc = 0;
+	} else if (vmp && (vmp->flag & LPFC_VMID_REQ_REGISTER ||
+			   vmp->flag & LPFC_VMID_DE_REGISTER)) {
+		/* else if register or dereg request has already been sent */
+		/* Hence vmid tag will not be added for this IO */
+		rc = 1;
+	} else {
+		/* else, start the process to obtain one as per the */
+		/* switch connected */
+		write_lock(&vport->vmid_lock);
+		vmp = lpfc_get_vmid_from_hastable(vport, hash, uuid);
+
+		/* while the read lock was released, in case the entry was */
+		/* added by other context or is in process of being added */
+		if (vmp && vmp->flag & LPFC_VMID_REGISTERED) {
+			lpfc_vmid_update_entry(vport, cmd, vmp, tag);
+			write_unlock(&vport->vmid_lock);
+			return 0;
+		} else if (vmp && vmp->flag & LPFC_VMID_REQ_REGISTER) {
+			write_unlock(&vport->vmid_lock);
+			return FAILURE;
+		}
+
+		/* else search and allocate a free slot in the hash table */
+		if (vport->cur_vmid_cnt < vport->max_vmid) {
+			for (i = 0; i < vport->max_vmid; ++i) {
+				vmp = vport->vmid + i;
+				if (vmp->flag == LPFC_VMID_SLOT_FREE) {
+					vmp = vport->vmid + i;
+					break;
+				}
+			}
+		} else {
+			write_unlock(&vport->vmid_lock);
+			return FAILURE;
+		}
+
+		if (vmp && (vmp->flag == LPFC_VMID_SLOT_FREE)) {
+			vmp->vmid_len = len;
+
+			/* Add the vmid and register  */
+			memcpy(vmp->host_vmid, uuid, vmp->vmid_len);
+			vmp->io_rd_cnt = 0;
+			vmp->io_wr_cnt = 0;
+			vmp->flag = LPFC_VMID_SLOT_USED;
+			lpfc_put_vmid_in_hashtable(vport, hash, vmp);
+
+			vmp->delete_inactive =
+			    vport->vmid_inactivity_timeout ? 1 : 0;
+
+			/* if type priority tag, get next available vmid */
+			if (lpfc_vmid_is_type_priority_tag(vport))
+				lpfc_vmid_assign_cs_ctl(vport, vmp);
+
+			/* allocate the per cpu variable for holding */
+			/* the last access time stamp only if vmid is enabled */
+			if (!vmp->last_io_time)
+				vmp->last_io_time =
+				    __alloc_percpu(sizeof(u64),
+						   __alignof__(struct
+							       lpfc_vmid));
+
+			/* registration pending */
+			pending = 1;
+			rc = 1;
+		}
+		write_unlock(&vport->vmid_lock);
+
+		/* complete transaction with switch */
+		if (pending) {
+			if (lpfc_vmid_is_type_priority_tag(vport))
+				rc = lpfc_vmid_uvem(vport, vmp, true);
+			else
+				rc = lpfc_vmid_cmd(vport,
+						   SLI_CTAS_RAPP_IDENT,
+						   vmp);
+			if (!rc) {
+				write_lock(&vport->vmid_lock);
+				vport->cur_vmid_cnt++;
+				vmp->flag |= LPFC_VMID_REQ_REGISTER;
+				write_unlock(&vport->vmid_lock);
+			}
+		}
+
+		/* finally, enable the idle timer once */
+		if (!(vport->phba->pport->vmid_flag & LPFC_VMID_TIMER_ENBLD)) {
+			mod_timer(&vport->phba->inactive_vmid_poll,
+				  jiffies +
+				  msecs_to_jiffies(1000 * LPFC_VMID_TIMER));
+			vport->phba->pport->vmid_flag |= LPFC_VMID_TIMER_ENBLD;
+		}
+	}
+	return rc;
+}
+
+/*
+ * lpfc_is_command_vm_io - get the uuid from blk cgroup
+ * @cmd:Pointer to scsi_cmnd data structure
+ * Returns uuid if present if not null
+ */
+static char *lpfc_is_command_vm_io(struct scsi_cmnd *cmd)
+{
+	char *uuid = NULL;
+
+	if (cmd->request) {
+		if (cmd->request->bio)
+			uuid = blkcg_get_fc_appid(cmd->request->bio);
+	}
+	return uuid;
+}
+
 /**
  * lpfc_queuecommand - scsi_host_template queuecommand entry point
  * @shost: kernel scsi host pointer.
@@ -5295,6 +5440,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	int err, idx;
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
 	uint64_t start = 0L;
+	u8 *uuid = NULL;
 
 	if (phba->ktime_on)
 		start = ktime_get_ns();
@@ -5422,6 +5568,25 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	}
 
 
+	/* check the necessary and sufficient condition to support VMID */
+	if (lpfc_is_vmid_enabled(phba) &&
+	    (ndlp->vmid_support ||
+	     phba->pport->vmid_priority_tagging ==
+	     LPFC_VMID_PRIO_TAG_ALL_TARGETS)) {
+		/* is the IO generated by a VM, get the associated virtual */
+		/* entity id */
+		uuid = lpfc_is_command_vm_io(cmnd);
+
+		if (uuid) {
+			err = lpfc_vmid_get_appid(vport, uuid, cmnd,
+				(union lpfc_vmid_io_tag *)
+					&lpfc_cmd->cur_iocbq.vmid_tag);
+			if (!err)
+				lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_VMID;
+		}
+	}
+
+	atomic_inc(&ndlp->cmd_pending);
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
 	if (unlikely(phba->hdwqstat_on & LPFC_CHECK_SCSI_IO))
 		this_cpu_inc(phba->sli4_hba.c_stat->xmt_io);
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 15/16] lpfc: vmid: Introducing vmid in io path.
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Gaurav Srivastava


[-- Attachment #1.1: Type: text/plain, Size: 7287 bytes --]

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

The patch introduces the vmid in the io path. It checks if the vmid is
enabled and if io belongs to a vm or not and acts accordingly. Other
supporing APIs are also included in the patch.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
Replaced blkcg_get_app_identifier with blkcg_get_fc_appid

v2:
Ported the patch on top of 5.10/scsi-queue
Added a fix for issuing QFPA command which was not included in the
last submit
---
 drivers/scsi/lpfc/lpfc_scsi.c | 165 ++++++++++++++++++++++++++++++++++
 1 file changed, 165 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 6a6a9a314368..c464f07d8cd8 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5270,6 +5270,151 @@ void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
 	}
 }
 
+/*
+ * lpfc_vmid_get_appid- get the vmid associated with the uuid
+ * @vport: The virtual port for which this call is being executed.
+ * @uuid: uuid associated with the VE
+ * @cmd: address of scsi cmmd descriptor
+ * @tag: VMID tag
+ * Returns status of the function
+ */
+static int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid, struct
+			       scsi_cmnd * cmd, union lpfc_vmid_io_tag *tag)
+{
+	struct lpfc_vmid *vmp = NULL;
+	int hash, len, rc = 1, i;
+	u8 pending = 0;
+
+	/* check if QFPA is complete */
+	if (lpfc_vmid_is_type_priority_tag(vport) && !(vport->vmid_flag &
+	      LPFC_VMID_QFPA_CMPL)) {
+		vport->work_port_events |= WORKER_CHECK_VMID_ISSUE_QFPA;
+		return FAILURE;
+	}
+
+	/* search if the uuid has already been mapped to the vmid */
+	len = strlen(uuid);
+	hash = lpfc_vmid_hash_fn(uuid, len);
+
+	/* search for the VMID in the table */
+	read_lock(&vport->vmid_lock);
+	vmp = lpfc_get_vmid_from_hastable(vport, hash, uuid);
+	read_unlock(&vport->vmid_lock);
+
+	/* if found, check if its already registered  */
+	if (vmp  && vmp->flag & LPFC_VMID_REGISTERED) {
+		lpfc_vmid_update_entry(vport, cmd, vmp, tag);
+		rc = 0;
+	} else if (vmp && (vmp->flag & LPFC_VMID_REQ_REGISTER ||
+			   vmp->flag & LPFC_VMID_DE_REGISTER)) {
+		/* else if register or dereg request has already been sent */
+		/* Hence vmid tag will not be added for this IO */
+		rc = 1;
+	} else {
+		/* else, start the process to obtain one as per the */
+		/* switch connected */
+		write_lock(&vport->vmid_lock);
+		vmp = lpfc_get_vmid_from_hastable(vport, hash, uuid);
+
+		/* while the read lock was released, in case the entry was */
+		/* added by other context or is in process of being added */
+		if (vmp && vmp->flag & LPFC_VMID_REGISTERED) {
+			lpfc_vmid_update_entry(vport, cmd, vmp, tag);
+			write_unlock(&vport->vmid_lock);
+			return 0;
+		} else if (vmp && vmp->flag & LPFC_VMID_REQ_REGISTER) {
+			write_unlock(&vport->vmid_lock);
+			return FAILURE;
+		}
+
+		/* else search and allocate a free slot in the hash table */
+		if (vport->cur_vmid_cnt < vport->max_vmid) {
+			for (i = 0; i < vport->max_vmid; ++i) {
+				vmp = vport->vmid + i;
+				if (vmp->flag == LPFC_VMID_SLOT_FREE) {
+					vmp = vport->vmid + i;
+					break;
+				}
+			}
+		} else {
+			write_unlock(&vport->vmid_lock);
+			return FAILURE;
+		}
+
+		if (vmp && (vmp->flag == LPFC_VMID_SLOT_FREE)) {
+			vmp->vmid_len = len;
+
+			/* Add the vmid and register  */
+			memcpy(vmp->host_vmid, uuid, vmp->vmid_len);
+			vmp->io_rd_cnt = 0;
+			vmp->io_wr_cnt = 0;
+			vmp->flag = LPFC_VMID_SLOT_USED;
+			lpfc_put_vmid_in_hashtable(vport, hash, vmp);
+
+			vmp->delete_inactive =
+			    vport->vmid_inactivity_timeout ? 1 : 0;
+
+			/* if type priority tag, get next available vmid */
+			if (lpfc_vmid_is_type_priority_tag(vport))
+				lpfc_vmid_assign_cs_ctl(vport, vmp);
+
+			/* allocate the per cpu variable for holding */
+			/* the last access time stamp only if vmid is enabled */
+			if (!vmp->last_io_time)
+				vmp->last_io_time =
+				    __alloc_percpu(sizeof(u64),
+						   __alignof__(struct
+							       lpfc_vmid));
+
+			/* registration pending */
+			pending = 1;
+			rc = 1;
+		}
+		write_unlock(&vport->vmid_lock);
+
+		/* complete transaction with switch */
+		if (pending) {
+			if (lpfc_vmid_is_type_priority_tag(vport))
+				rc = lpfc_vmid_uvem(vport, vmp, true);
+			else
+				rc = lpfc_vmid_cmd(vport,
+						   SLI_CTAS_RAPP_IDENT,
+						   vmp);
+			if (!rc) {
+				write_lock(&vport->vmid_lock);
+				vport->cur_vmid_cnt++;
+				vmp->flag |= LPFC_VMID_REQ_REGISTER;
+				write_unlock(&vport->vmid_lock);
+			}
+		}
+
+		/* finally, enable the idle timer once */
+		if (!(vport->phba->pport->vmid_flag & LPFC_VMID_TIMER_ENBLD)) {
+			mod_timer(&vport->phba->inactive_vmid_poll,
+				  jiffies +
+				  msecs_to_jiffies(1000 * LPFC_VMID_TIMER));
+			vport->phba->pport->vmid_flag |= LPFC_VMID_TIMER_ENBLD;
+		}
+	}
+	return rc;
+}
+
+/*
+ * lpfc_is_command_vm_io - get the uuid from blk cgroup
+ * @cmd:Pointer to scsi_cmnd data structure
+ * Returns uuid if present if not null
+ */
+static char *lpfc_is_command_vm_io(struct scsi_cmnd *cmd)
+{
+	char *uuid = NULL;
+
+	if (cmd->request) {
+		if (cmd->request->bio)
+			uuid = blkcg_get_fc_appid(cmd->request->bio);
+	}
+	return uuid;
+}
+
 /**
  * lpfc_queuecommand - scsi_host_template queuecommand entry point
  * @shost: kernel scsi host pointer.
@@ -5295,6 +5440,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	int err, idx;
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
 	uint64_t start = 0L;
+	u8 *uuid = NULL;
 
 	if (phba->ktime_on)
 		start = ktime_get_ns();
@@ -5422,6 +5568,25 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	}
 
 
+	/* check the necessary and sufficient condition to support VMID */
+	if (lpfc_is_vmid_enabled(phba) &&
+	    (ndlp->vmid_support ||
+	     phba->pport->vmid_priority_tagging ==
+	     LPFC_VMID_PRIO_TAG_ALL_TARGETS)) {
+		/* is the IO generated by a VM, get the associated virtual */
+		/* entity id */
+		uuid = lpfc_is_command_vm_io(cmnd);
+
+		if (uuid) {
+			err = lpfc_vmid_get_appid(vport, uuid, cmnd,
+				(union lpfc_vmid_io_tag *)
+					&lpfc_cmd->cur_iocbq.vmid_tag);
+			if (!err)
+				lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_VMID;
+		}
+	}
+
+	atomic_inc(&ndlp->cmd_pending);
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
 	if (unlikely(phba->hdwqstat_on & LPFC_CHECK_SCSI_IO))
 		this_cpu_inc(phba->sli4_hba.c_stat->xmt_io);
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 16/16] scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID
  2020-12-16  5:29 ` Muneendra
@ 2020-12-16  5:29   ` Muneendra
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini, Muneendra

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

Added a new config FC_APPID to select BLK_CGROUP_FC_APPID
which Enable support to track FC io Traffic.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
No change

v4:
Addressed the error reported by kernel test robot

v3:
New patch
---
 drivers/scsi/Kconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 701b61ec76ee..1c73c60e398f 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -235,6 +235,19 @@ config SCSI_FC_ATTRS
 	  each attached FiberChannel device to sysfs, say Y.
 	  Otherwise, say N.
 
+config FC_APPID
+	bool "Enable support to track FC io Traffic"
+	depends on BLOCK && BLK_CGROUP
+	depends on SCSI
+	select BLK_CGROUP_FC_APPID
+	default y
+	help
+	  If you say Y here, it enables the support to track
+	  FC IO traffic over fabric.It enables the Fabric and the
+	  storage targets to identify, monitor, and handle FC traffic
+	  based on vm tags by inserting application specific
+	  identification into the FC frame
+
 config SCSI_ISCSI_ATTRS
 	tristate "iSCSI Transport Attributes"
 	depends on SCSI && NET
-- 
2.26.2


-- 
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: 4177 bytes --]

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH v5 16/16] scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID
@ 2020-12-16  5:29   ` Muneendra
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra @ 2020-12-16  5:29 UTC (permalink / raw)
  To: linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne, Muneendra


[-- Attachment #1.1: Type: text/plain, Size: 1972 bytes --]

Added a new config FC_APPID to select BLK_CGROUP_FC_APPID
which Enable support to track FC io Traffic.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v5:
No change

v4:
Addressed the error reported by kernel test robot

v3:
New patch
---
 drivers/scsi/Kconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 701b61ec76ee..1c73c60e398f 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -235,6 +235,19 @@ config SCSI_FC_ATTRS
 	  each attached FiberChannel device to sysfs, say Y.
 	  Otherwise, say N.
 
+config FC_APPID
+	bool "Enable support to track FC io Traffic"
+	depends on BLOCK && BLK_CGROUP
+	depends on SCSI
+	select BLK_CGROUP_FC_APPID
+	default y
+	help
+	  If you say Y here, it enables the support to track
+	  FC IO traffic over fabric.It enables the Fabric and the
+	  storage targets to identify, monitor, and handle FC traffic
+	  based on vm tags by inserting application specific
+	  identification into the FC frame
+
 config SCSI_ISCSI_ATTRS
 	tristate "iSCSI Transport Attributes"
 	depends on SCSI && NET
-- 
2.26.2


-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-16 15:13     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 15:13 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 4056 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_init.c:4288:1: warning: no previous prototype for 'lpfc_vmid_res_alloc' [-Wmissing-prototypes]
    4288 | lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
         | ^~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_vmid_res_alloc +4288 drivers/scsi/lpfc/lpfc_init.c

  4275	
  4276	/**
  4277	 * lpfc_vmid_res_alloc - Allocates resources for VMID
  4278	 * @phba: pointer to lpfc hba data structure.
  4279	 * @vport: pointer to vport data structure
  4280	 *
  4281	 * This routine allocated the resources needed for the vmid.
  4282	 *
  4283	 * Return codes
  4284	 *	0 on Succeess
  4285	 *	Non-0 on Failure
  4286	 */
  4287	u8
> 4288	lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
  4289	{
  4290		u16 i;
  4291	
  4292		/* vmid feature is supported only on SLI4 */
  4293		if (phba->sli_rev == LPFC_SLI_REV3) {
  4294			phba->cfg_vmid_app_header = 0;
  4295			phba->cfg_vmid_priority_tagging = 0;
  4296		}
  4297	
  4298		/* if enabled, then allocated the resources */
  4299		if (lpfc_is_vmid_enabled(phba)) {
  4300			vport->vmid =
  4301			    kmalloc_array(phba->cfg_max_vmid, sizeof(struct lpfc_vmid),
  4302					  GFP_KERNEL);
  4303			if (!vport->vmid)
  4304				return FAILURE;
  4305	
  4306			memset(vport->vmid, 0,
  4307			       phba->cfg_max_vmid * sizeof(struct lpfc_vmid));
  4308	
  4309			rwlock_init(&vport->vmid_lock);
  4310	
  4311			/* setting the VMID parameters for the vport */
  4312			vport->vmid_priority_tagging = phba->cfg_vmid_priority_tagging;
  4313			vport->vmid_inactivity_timeout =
  4314			    phba->cfg_vmid_inactivity_timeout;
  4315			vport->max_vmid = phba->cfg_max_vmid;
  4316			vport->cur_vmid_cnt = 0;
  4317	
  4318			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  4319				vport->hash_table[i] = NULL;
  4320	
  4321			vport->vmid_priority_range = bitmap_zalloc
  4322				(LPFC_VMID_MAX_PRIORITY_RANGE, GFP_KERNEL);
  4323	
  4324			if (!vport->vmid_priority_range) {
  4325				kfree(vport->vmid);
  4326				return FAILURE;
  4327			}
  4328		}
  4329		return 0;
  4330	}
  4331	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup
@ 2020-12-16 15:13     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 15:13 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne, pbonzini

[-- Attachment #1: Type: text/plain, Size: 4056 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_init.c:4288:1: warning: no previous prototype for 'lpfc_vmid_res_alloc' [-Wmissing-prototypes]
    4288 | lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
         | ^~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_vmid_res_alloc +4288 drivers/scsi/lpfc/lpfc_init.c

  4275	
  4276	/**
  4277	 * lpfc_vmid_res_alloc - Allocates resources for VMID
  4278	 * @phba: pointer to lpfc hba data structure.
  4279	 * @vport: pointer to vport data structure
  4280	 *
  4281	 * This routine allocated the resources needed for the vmid.
  4282	 *
  4283	 * Return codes
  4284	 *	0 on Succeess
  4285	 *	Non-0 on Failure
  4286	 */
  4287	u8
> 4288	lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
  4289	{
  4290		u16 i;
  4291	
  4292		/* vmid feature is supported only on SLI4 */
  4293		if (phba->sli_rev == LPFC_SLI_REV3) {
  4294			phba->cfg_vmid_app_header = 0;
  4295			phba->cfg_vmid_priority_tagging = 0;
  4296		}
  4297	
  4298		/* if enabled, then allocated the resources */
  4299		if (lpfc_is_vmid_enabled(phba)) {
  4300			vport->vmid =
  4301			    kmalloc_array(phba->cfg_max_vmid, sizeof(struct lpfc_vmid),
  4302					  GFP_KERNEL);
  4303			if (!vport->vmid)
  4304				return FAILURE;
  4305	
  4306			memset(vport->vmid, 0,
  4307			       phba->cfg_max_vmid * sizeof(struct lpfc_vmid));
  4308	
  4309			rwlock_init(&vport->vmid_lock);
  4310	
  4311			/* setting the VMID parameters for the vport */
  4312			vport->vmid_priority_tagging = phba->cfg_vmid_priority_tagging;
  4313			vport->vmid_inactivity_timeout =
  4314			    phba->cfg_vmid_inactivity_timeout;
  4315			vport->max_vmid = phba->cfg_max_vmid;
  4316			vport->cur_vmid_cnt = 0;
  4317	
  4318			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  4319				vport->hash_table[i] = NULL;
  4320	
  4321			vport->vmid_priority_range = bitmap_zalloc
  4322				(LPFC_VMID_MAX_PRIORITY_RANGE, GFP_KERNEL);
  4323	
  4324			if (!vport->vmid_priority_range) {
  4325				kfree(vport->vmid);
  4326				return FAILURE;
  4327			}
  4328		}
  4329		return 0;
  4330	}
  4331	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup
@ 2020-12-16 15:13     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 15:13 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4162 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_init.c:4288:1: warning: no previous prototype for 'lpfc_vmid_res_alloc' [-Wmissing-prototypes]
    4288 | lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
         | ^~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_vmid_res_alloc +4288 drivers/scsi/lpfc/lpfc_init.c

  4275	
  4276	/**
  4277	 * lpfc_vmid_res_alloc - Allocates resources for VMID
  4278	 * @phba: pointer to lpfc hba data structure.
  4279	 * @vport: pointer to vport data structure
  4280	 *
  4281	 * This routine allocated the resources needed for the vmid.
  4282	 *
  4283	 * Return codes
  4284	 *	0 on Succeess
  4285	 *	Non-0 on Failure
  4286	 */
  4287	u8
> 4288	lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
  4289	{
  4290		u16 i;
  4291	
  4292		/* vmid feature is supported only on SLI4 */
  4293		if (phba->sli_rev == LPFC_SLI_REV3) {
  4294			phba->cfg_vmid_app_header = 0;
  4295			phba->cfg_vmid_priority_tagging = 0;
  4296		}
  4297	
  4298		/* if enabled, then allocated the resources */
  4299		if (lpfc_is_vmid_enabled(phba)) {
  4300			vport->vmid =
  4301			    kmalloc_array(phba->cfg_max_vmid, sizeof(struct lpfc_vmid),
  4302					  GFP_KERNEL);
  4303			if (!vport->vmid)
  4304				return FAILURE;
  4305	
  4306			memset(vport->vmid, 0,
  4307			       phba->cfg_max_vmid * sizeof(struct lpfc_vmid));
  4308	
  4309			rwlock_init(&vport->vmid_lock);
  4310	
  4311			/* setting the VMID parameters for the vport */
  4312			vport->vmid_priority_tagging = phba->cfg_vmid_priority_tagging;
  4313			vport->vmid_inactivity_timeout =
  4314			    phba->cfg_vmid_inactivity_timeout;
  4315			vport->max_vmid = phba->cfg_max_vmid;
  4316			vport->cur_vmid_cnt = 0;
  4317	
  4318			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  4319				vport->hash_table[i] = NULL;
  4320	
  4321			vport->vmid_priority_range = bitmap_zalloc
  4322				(LPFC_VMID_MAX_PRIORITY_RANGE, GFP_KERNEL);
  4323	
  4324			if (!vport->vmid_priority_range) {
  4325				kfree(vport->vmid);
  4326				return FAILURE;
  4327			}
  4328		}
  4329		return 0;
  4330	}
  4331	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-16 15:47     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 15:47 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 4041 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/65751f65f5df79aaa25cd5752589ca91ebddde18
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 65751f65f5df79aaa25cd5752589ca91ebddde18
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_els.c:10354:6: warning: no previous prototype for 'lpfc_init_cs_ctl_bitmap' [-Wmissing-prototypes]
   10354 | void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
         |      ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_els.c:10360:1: warning: no previous prototype for 'lpfc_vmid_set_cs_ctl_range' [-Wmissing-prototypes]
   10360 | lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_els.c:10371:6: warning: no previous prototype for 'lpfc_vmid_put_cs_ctl' [-Wmissing-prototypes]
   10371 | void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
         |      ^~~~~~~~~~~~~~~~~~~~
   drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_issue_els_qfpa':
   drivers/scsi/lpfc/lpfc_els.c:10491:19: warning: variable 'psli' set but not used [-Wunused-but-set-variable]
   10491 |  struct lpfc_sli *psli;
         |                   ^~~~
   drivers/scsi/lpfc/lpfc_els.c:10488:10: warning: variable 'icmd' set but not used [-Wunused-but-set-variable]
   10488 |  IOCB_t *icmd;
         |          ^~~~
   drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_vmid_uvem':
   drivers/scsi/lpfc/lpfc_els.c:10537:10: warning: variable 'icmd' set but not used [-Wunused-but-set-variable]
   10537 |  IOCB_t *icmd;
         |          ^~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_init_cs_ctl_bitmap +10354 drivers/scsi/lpfc/lpfc_els.c

 10353	
 10354	void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
 10355	{
 10356		bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE);
 10357	}
 10358	
 10359	void
 10360	lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
 10361	{
 10362		u32 i;
 10363	
 10364		if ((min > max) || (max > LPFC_VMID_MAX_PRIORITY_RANGE))
 10365			return;
 10366	
 10367		for (i = min; i <= max; i++)
 10368			set_bit(i, vport->vmid_priority_range);
 10369	}
 10370	
 10371	void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
 10372	{
 10373		set_bit(ctcl_vmid, vport->vmid_priority_range);
 10374	}
 10375	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch
@ 2020-12-16 15:47     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 15:47 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne, pbonzini

[-- Attachment #1: Type: text/plain, Size: 4041 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/65751f65f5df79aaa25cd5752589ca91ebddde18
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 65751f65f5df79aaa25cd5752589ca91ebddde18
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_els.c:10354:6: warning: no previous prototype for 'lpfc_init_cs_ctl_bitmap' [-Wmissing-prototypes]
   10354 | void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
         |      ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_els.c:10360:1: warning: no previous prototype for 'lpfc_vmid_set_cs_ctl_range' [-Wmissing-prototypes]
   10360 | lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_els.c:10371:6: warning: no previous prototype for 'lpfc_vmid_put_cs_ctl' [-Wmissing-prototypes]
   10371 | void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
         |      ^~~~~~~~~~~~~~~~~~~~
   drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_issue_els_qfpa':
   drivers/scsi/lpfc/lpfc_els.c:10491:19: warning: variable 'psli' set but not used [-Wunused-but-set-variable]
   10491 |  struct lpfc_sli *psli;
         |                   ^~~~
   drivers/scsi/lpfc/lpfc_els.c:10488:10: warning: variable 'icmd' set but not used [-Wunused-but-set-variable]
   10488 |  IOCB_t *icmd;
         |          ^~~~
   drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_vmid_uvem':
   drivers/scsi/lpfc/lpfc_els.c:10537:10: warning: variable 'icmd' set but not used [-Wunused-but-set-variable]
   10537 |  IOCB_t *icmd;
         |          ^~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_init_cs_ctl_bitmap +10354 drivers/scsi/lpfc/lpfc_els.c

 10353	
 10354	void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
 10355	{
 10356		bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE);
 10357	}
 10358	
 10359	void
 10360	lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
 10361	{
 10362		u32 i;
 10363	
 10364		if ((min > max) || (max > LPFC_VMID_MAX_PRIORITY_RANGE))
 10365			return;
 10366	
 10367		for (i = min; i <= max; i++)
 10368			set_bit(i, vport->vmid_priority_range);
 10369	}
 10370	
 10371	void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
 10372	{
 10373		set_bit(ctcl_vmid, vport->vmid_priority_range);
 10374	}
 10375	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch
@ 2020-12-16 15:47     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 15:47 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4130 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/65751f65f5df79aaa25cd5752589ca91ebddde18
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 65751f65f5df79aaa25cd5752589ca91ebddde18
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_els.c:10354:6: warning: no previous prototype for 'lpfc_init_cs_ctl_bitmap' [-Wmissing-prototypes]
   10354 | void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
         |      ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_els.c:10360:1: warning: no previous prototype for 'lpfc_vmid_set_cs_ctl_range' [-Wmissing-prototypes]
   10360 | lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_els.c:10371:6: warning: no previous prototype for 'lpfc_vmid_put_cs_ctl' [-Wmissing-prototypes]
   10371 | void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
         |      ^~~~~~~~~~~~~~~~~~~~
   drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_issue_els_qfpa':
   drivers/scsi/lpfc/lpfc_els.c:10491:19: warning: variable 'psli' set but not used [-Wunused-but-set-variable]
   10491 |  struct lpfc_sli *psli;
         |                   ^~~~
   drivers/scsi/lpfc/lpfc_els.c:10488:10: warning: variable 'icmd' set but not used [-Wunused-but-set-variable]
   10488 |  IOCB_t *icmd;
         |          ^~~~
   drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_vmid_uvem':
   drivers/scsi/lpfc/lpfc_els.c:10537:10: warning: variable 'icmd' set but not used [-Wunused-but-set-variable]
   10537 |  IOCB_t *icmd;
         |          ^~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_init_cs_ctl_bitmap +10354 drivers/scsi/lpfc/lpfc_els.c

 10353	
 10354	void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
 10355	{
 10356		bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE);
 10357	}
 10358	
 10359	void
 10360	lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
 10361	{
 10362		u32 i;
 10363	
 10364		if ((min > max) || (max > LPFC_VMID_MAX_PRIORITY_RANGE))
 10365			return;
 10366	
 10367		for (i = min; i <= max; i++)
 10368			set_bit(i, vport->vmid_priority_range);
 10369	}
 10370	
 10371	void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
 10372	{
 10373		set_bit(ctcl_vmid, vport->vmid_priority_range);
 10374	}
 10375	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-16 16:23     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 16:23 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 6147 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8417ca99565475d5bf5493657fcf90922607f1b1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 8417ca99565475d5bf5493657fcf90922607f1b1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_scsi.c:5179:1: warning: no previous prototype for 'lpfc_put_vmid_in_hashtable' [-Wmissing-prototypes]
    5179 | lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_scsi.c:5233:6: warning: no previous prototype for 'lpfc_vmid_update_entry' [-Wmissing-prototypes]
    5233 | void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
         |      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_scsi.c:5254:6: warning: no previous prototype for 'lpfc_vmid_assign_cs_ctl' [-Wmissing-prototypes]
    5254 | void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
         |      ^~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_put_vmid_in_hashtable +5179 drivers/scsi/lpfc/lpfc_scsi.c

  5168	
  5169	/*
  5170	 * lpfc_put_vmid_from_hastable - put the VMID in the hash table
  5171	 * @vport: The virtual port for which this call is being executed.
  5172	 * @hash - calculated hash value
  5173	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5174	 *
  5175	 * This routine will insert the newly acquired vmid entity in the hash table.
  5176	 * Make sure to acquire the appropriate lock before invoking this routine.
  5177	 */
  5178	int
> 5179	lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
  5180				   struct lpfc_vmid *vmp)
  5181	{
  5182		int count = 0;
  5183	
  5184		while (count < LPFC_VMID_HASH_SIZE) {
  5185			if (!vport->hash_table[hash]) {
  5186				vport->hash_table[hash] = vmp;
  5187				vmp->hash_index = hash;
  5188				return FAILURE;
  5189			}
  5190			/* if the slot is already occupied, a collision has occurred. */
  5191			/* Store in the next available slot */
  5192			count++;
  5193			hash++;
  5194			/* table is full */
  5195			if (hash == LPFC_VMID_HASH_SIZE)
  5196				hash = 0;
  5197		}
  5198		return 0;
  5199	}
  5200	
  5201	/*
  5202	 * lpfc_vmid_hash_fn- creates a hash value of the UUID
  5203	 * @uuid: uuid associated with the VE
  5204	 * @len: length of the UUID
  5205	 * Returns the calculated hash value
  5206	 */
  5207	int lpfc_vmid_hash_fn(char *vmid, int len)
  5208	{
  5209		int c;
  5210		int hash = 0;
  5211	
  5212		if (len == 0)
  5213			return 0;
  5214		while (len--) {
  5215			c = *vmid++;
  5216			if (c >= 'A' && c <= 'Z')
  5217				c += 'a' - 'A';
  5218	
  5219			hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
  5220				(c >> LPFC_VMID_HASH_SHIFT)) * 19;
  5221		}
  5222	
  5223		return hash & LPFC_VMID_HASH_MASK;
  5224	}
  5225	
  5226	/*
  5227	 * lpfc_vmid_update_entry - update the vmid entry in the hash table
  5228	 * @vport: The virtual port for which this call is being executed.
  5229	 * @cmd: address of scsi cmmd descriptor
  5230	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5231	 * @tag: VMID tag
  5232	 */
> 5233	void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
  5234					   *cmd, struct lpfc_vmid *vmp,
  5235					   union lpfc_vmid_io_tag *tag)
  5236	{
  5237		u64 *lta;
  5238	
  5239		if (vport->vmid_priority_tagging)
  5240			tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
  5241		else
  5242			tag->app_id = vmp->un.app_id;
  5243	
  5244		if (cmd->sc_data_direction == DMA_TO_DEVICE)
  5245			vmp->io_wr_cnt++;
  5246		else
  5247			vmp->io_rd_cnt++;
  5248	
  5249		/* update the last access timestamp in the table */
  5250		lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
  5251		*lta = jiffies;
  5252	}
  5253	
> 5254	void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
  5255	{
  5256		u32 hash;
  5257		struct lpfc_vmid *pvmid;
  5258	
  5259		if (vport->port_type == LPFC_PHYSICAL_PORT) {
  5260			vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5261		} else {
  5262			hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
  5263			pvmid =
  5264			    lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
  5265							vmid->host_vmid);
  5266			if (!pvmid)
  5267				vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
  5268			else
  5269				vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5270		}
  5271	}
  5272	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
@ 2020-12-16 16:23     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 16:23 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne, pbonzini

[-- Attachment #1: Type: text/plain, Size: 6147 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8417ca99565475d5bf5493657fcf90922607f1b1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 8417ca99565475d5bf5493657fcf90922607f1b1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_scsi.c:5179:1: warning: no previous prototype for 'lpfc_put_vmid_in_hashtable' [-Wmissing-prototypes]
    5179 | lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_scsi.c:5233:6: warning: no previous prototype for 'lpfc_vmid_update_entry' [-Wmissing-prototypes]
    5233 | void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
         |      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_scsi.c:5254:6: warning: no previous prototype for 'lpfc_vmid_assign_cs_ctl' [-Wmissing-prototypes]
    5254 | void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
         |      ^~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_put_vmid_in_hashtable +5179 drivers/scsi/lpfc/lpfc_scsi.c

  5168	
  5169	/*
  5170	 * lpfc_put_vmid_from_hastable - put the VMID in the hash table
  5171	 * @vport: The virtual port for which this call is being executed.
  5172	 * @hash - calculated hash value
  5173	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5174	 *
  5175	 * This routine will insert the newly acquired vmid entity in the hash table.
  5176	 * Make sure to acquire the appropriate lock before invoking this routine.
  5177	 */
  5178	int
> 5179	lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
  5180				   struct lpfc_vmid *vmp)
  5181	{
  5182		int count = 0;
  5183	
  5184		while (count < LPFC_VMID_HASH_SIZE) {
  5185			if (!vport->hash_table[hash]) {
  5186				vport->hash_table[hash] = vmp;
  5187				vmp->hash_index = hash;
  5188				return FAILURE;
  5189			}
  5190			/* if the slot is already occupied, a collision has occurred. */
  5191			/* Store in the next available slot */
  5192			count++;
  5193			hash++;
  5194			/* table is full */
  5195			if (hash == LPFC_VMID_HASH_SIZE)
  5196				hash = 0;
  5197		}
  5198		return 0;
  5199	}
  5200	
  5201	/*
  5202	 * lpfc_vmid_hash_fn- creates a hash value of the UUID
  5203	 * @uuid: uuid associated with the VE
  5204	 * @len: length of the UUID
  5205	 * Returns the calculated hash value
  5206	 */
  5207	int lpfc_vmid_hash_fn(char *vmid, int len)
  5208	{
  5209		int c;
  5210		int hash = 0;
  5211	
  5212		if (len == 0)
  5213			return 0;
  5214		while (len--) {
  5215			c = *vmid++;
  5216			if (c >= 'A' && c <= 'Z')
  5217				c += 'a' - 'A';
  5218	
  5219			hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
  5220				(c >> LPFC_VMID_HASH_SHIFT)) * 19;
  5221		}
  5222	
  5223		return hash & LPFC_VMID_HASH_MASK;
  5224	}
  5225	
  5226	/*
  5227	 * lpfc_vmid_update_entry - update the vmid entry in the hash table
  5228	 * @vport: The virtual port for which this call is being executed.
  5229	 * @cmd: address of scsi cmmd descriptor
  5230	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5231	 * @tag: VMID tag
  5232	 */
> 5233	void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
  5234					   *cmd, struct lpfc_vmid *vmp,
  5235					   union lpfc_vmid_io_tag *tag)
  5236	{
  5237		u64 *lta;
  5238	
  5239		if (vport->vmid_priority_tagging)
  5240			tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
  5241		else
  5242			tag->app_id = vmp->un.app_id;
  5243	
  5244		if (cmd->sc_data_direction == DMA_TO_DEVICE)
  5245			vmp->io_wr_cnt++;
  5246		else
  5247			vmp->io_rd_cnt++;
  5248	
  5249		/* update the last access timestamp in the table */
  5250		lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
  5251		*lta = jiffies;
  5252	}
  5253	
> 5254	void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
  5255	{
  5256		u32 hash;
  5257		struct lpfc_vmid *pvmid;
  5258	
  5259		if (vport->port_type == LPFC_PHYSICAL_PORT) {
  5260			vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5261		} else {
  5262			hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
  5263			pvmid =
  5264			    lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
  5265							vmid->host_vmid);
  5266			if (!pvmid)
  5267				vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
  5268			else
  5269				vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5270		}
  5271	}
  5272	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
@ 2020-12-16 16:23     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 16:23 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6307 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8417ca99565475d5bf5493657fcf90922607f1b1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 8417ca99565475d5bf5493657fcf90922607f1b1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_scsi.c:5179:1: warning: no previous prototype for 'lpfc_put_vmid_in_hashtable' [-Wmissing-prototypes]
    5179 | lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_scsi.c:5233:6: warning: no previous prototype for 'lpfc_vmid_update_entry' [-Wmissing-prototypes]
    5233 | void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
         |      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_scsi.c:5254:6: warning: no previous prototype for 'lpfc_vmid_assign_cs_ctl' [-Wmissing-prototypes]
    5254 | void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
         |      ^~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_put_vmid_in_hashtable +5179 drivers/scsi/lpfc/lpfc_scsi.c

  5168	
  5169	/*
  5170	 * lpfc_put_vmid_from_hastable - put the VMID in the hash table
  5171	 * @vport: The virtual port for which this call is being executed.
  5172	 * @hash - calculated hash value
  5173	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5174	 *
  5175	 * This routine will insert the newly acquired vmid entity in the hash table.
  5176	 * Make sure to acquire the appropriate lock before invoking this routine.
  5177	 */
  5178	int
> 5179	lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
  5180				   struct lpfc_vmid *vmp)
  5181	{
  5182		int count = 0;
  5183	
  5184		while (count < LPFC_VMID_HASH_SIZE) {
  5185			if (!vport->hash_table[hash]) {
  5186				vport->hash_table[hash] = vmp;
  5187				vmp->hash_index = hash;
  5188				return FAILURE;
  5189			}
  5190			/* if the slot is already occupied, a collision has occurred. */
  5191			/* Store in the next available slot */
  5192			count++;
  5193			hash++;
  5194			/* table is full */
  5195			if (hash == LPFC_VMID_HASH_SIZE)
  5196				hash = 0;
  5197		}
  5198		return 0;
  5199	}
  5200	
  5201	/*
  5202	 * lpfc_vmid_hash_fn- creates a hash value of the UUID
  5203	 * @uuid: uuid associated with the VE
  5204	 * @len: length of the UUID
  5205	 * Returns the calculated hash value
  5206	 */
  5207	int lpfc_vmid_hash_fn(char *vmid, int len)
  5208	{
  5209		int c;
  5210		int hash = 0;
  5211	
  5212		if (len == 0)
  5213			return 0;
  5214		while (len--) {
  5215			c = *vmid++;
  5216			if (c >= 'A' && c <= 'Z')
  5217				c += 'a' - 'A';
  5218	
  5219			hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
  5220				(c >> LPFC_VMID_HASH_SHIFT)) * 19;
  5221		}
  5222	
  5223		return hash & LPFC_VMID_HASH_MASK;
  5224	}
  5225	
  5226	/*
  5227	 * lpfc_vmid_update_entry - update the vmid entry in the hash table
  5228	 * @vport: The virtual port for which this call is being executed.
  5229	 * @cmd: address of scsi cmmd descriptor
  5230	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5231	 * @tag: VMID tag
  5232	 */
> 5233	void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
  5234					   *cmd, struct lpfc_vmid *vmp,
  5235					   union lpfc_vmid_io_tag *tag)
  5236	{
  5237		u64 *lta;
  5238	
  5239		if (vport->vmid_priority_tagging)
  5240			tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
  5241		else
  5242			tag->app_id = vmp->un.app_id;
  5243	
  5244		if (cmd->sc_data_direction == DMA_TO_DEVICE)
  5245			vmp->io_wr_cnt++;
  5246		else
  5247			vmp->io_rd_cnt++;
  5248	
  5249		/* update the last access timestamp in the table */
  5250		lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
  5251		*lta = jiffies;
  5252	}
  5253	
> 5254	void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
  5255	{
  5256		u32 hash;
  5257		struct lpfc_vmid *pvmid;
  5258	
  5259		if (vport->port_type == LPFC_PHYSICAL_PORT) {
  5260			vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5261		} else {
  5262			hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
  5263			pvmid =
  5264			    lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
  5265							vmid->host_vmid);
  5266			if (!pvmid)
  5267				vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
  5268			else
  5269				vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5270		}
  5271	}
  5272	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid.
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-16 16:57     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 16:57 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 5920 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_ct.c:3749:1: warning: no previous prototype for 'lpfc_cmpl_ct_cmd_vmid' [-Wmissing-prototypes]
    3749 | lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
         | ^~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_cmpl_ct_cmd_vmid +3749 drivers/scsi/lpfc/lpfc_ct.c

  3747	
  3748	void
> 3749	lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
  3750			      struct lpfc_iocbq *rspiocb)
  3751	{
  3752		struct lpfc_vport *vport = cmdiocb->vport;
  3753		struct lpfc_dmabuf *inp = cmdiocb->context1;
  3754		struct lpfc_dmabuf *outp = cmdiocb->context2;
  3755		struct lpfc_sli_ct_request *ctcmd = inp->virt;
  3756		struct lpfc_sli_ct_request *ctrsp = outp->virt;
  3757		u16 rsp = ctrsp->CommandResponse.bits.CmdRsp;
  3758		struct app_id_object *app;
  3759		u32 cmd, hash;
  3760		struct lpfc_vmid *vmp;
  3761		u8 *data = outp->virt;
  3762		int i;
  3763	
  3764		cmd = be16_to_cpu(ctcmd->CommandResponse.bits.CmdRsp);
  3765		if (cmd == SLI_CTAS_DALLAPP_ID)
  3766			lpfc_ct_free_iocb(phba, cmdiocb);
  3767	
  3768		if (lpfc_els_chk_latt(vport) || rspiocb->iocb.ulpStatus) {
  3769			if (cmd != SLI_CTAS_DALLAPP_ID)
  3770				return;
  3771		}
  3772		/* Check for a CT LS_RJT response */
  3773		if (rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
  3774			if (cmd != SLI_CTAS_DALLAPP_ID)
  3775				lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3776						 "3306 VMID FS_RJT Data: x%x  %x %x\n",
  3777					 cmd, ctrsp->ReasonCode, ctrsp->Explanation);
  3778			if ((cmd != SLI_CTAS_DALLAPP_ID) ||
  3779			    (ctrsp->ReasonCode != SLI_CT_UNABLE_TO_PERFORM_REQ) ||
  3780			    (ctrsp->Explanation != SLI_CT_APP_ID_NOT_AVAILABLE)) {
  3781				/* If DALLAPP_ID failed retry later */
  3782				if (cmd == SLI_CTAS_DALLAPP_ID)
  3783					vport->load_flag |= FC_DEREGISTER_ALL_APP_ID;
  3784				return;
  3785			}
  3786		}
  3787	
  3788		switch (cmd) {
  3789		case SLI_CTAS_RAPP_IDENT:
  3790			app = (struct app_id_object *)(RAPP_IDENT_OFFSET + data);
  3791			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3792					 "6712 RAPP_IDENT app id %d  port id %x id\n"
  3793					 "len %d\n", be32_to_cpu(app->app_id),
  3794					 be32_to_cpu(app->port_id),
  3795					 app->obj.entity_id_len);
  3796	
  3797			if (app->obj.entity_id_len == 0 || app->port_id == 0)
  3798				return;
  3799	
  3800			hash = lpfc_vmid_hash_fn(app->obj.entity_id,
  3801						 app->obj.entity_id_len);
  3802			vmp = lpfc_get_vmid_from_hastable(vport, hash,
  3803							  app->obj.entity_id);
  3804			if (vmp) {
  3805				vmp->un.app_id = be32_to_cpu(app->app_id);
  3806				vmp->flag |= LPFC_VMID_REGISTERED;
  3807				vmp->flag &= ~LPFC_VMID_REQ_REGISTER;
  3808				/* Set IN USE flag */
  3809				vport->vmid_flag |= LPFC_VMID_IN_USE;
  3810			} else {
  3811				lpfc_printf_vlog(vport, KERN_DEBUG,
  3812						 LOG_DISCOVERY, "6901 No entry found\n"
  3813						 "%s hash %d\n", app->obj.entity_id,
  3814						 hash);
  3815			}
  3816			break;
  3817		case SLI_CTAS_DAPP_IDENT:
  3818			app = (struct app_id_object *)(DAPP_IDENT_OFFSET + data);
  3819			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3820					 "6713 DAPP_IDENT app id %d  port id %x",
  3821					 cpu_to_be32(app->app_id),
  3822					 cpu_to_be32(app->port_id));
  3823			break;
  3824		case SLI_CTAS_DALLAPP_ID:
  3825			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3826					 "8856 Deregistered all app ids");
  3827			for (i = 0; i < phba->cfg_max_vmid; i++) {
  3828				vmp = &vport->vmid[i];
  3829				if (vmp->flag != LPFC_VMID_SLOT_FREE)
  3830					memset(vmp, 0, sizeof(struct lpfc_vmid));
  3831			}
  3832			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  3833				vport->hash_table[i] = NULL;
  3834			vport->load_flag |= FC_ALLOW_VMID;
  3835			break;
  3836		default:
  3837			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3838					 "8857 Invalid command code");
  3839		}
  3840	}
  3841	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid.
@ 2020-12-16 16:57     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 16:57 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne, pbonzini

[-- Attachment #1: Type: text/plain, Size: 5920 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_ct.c:3749:1: warning: no previous prototype for 'lpfc_cmpl_ct_cmd_vmid' [-Wmissing-prototypes]
    3749 | lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
         | ^~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_cmpl_ct_cmd_vmid +3749 drivers/scsi/lpfc/lpfc_ct.c

  3747	
  3748	void
> 3749	lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
  3750			      struct lpfc_iocbq *rspiocb)
  3751	{
  3752		struct lpfc_vport *vport = cmdiocb->vport;
  3753		struct lpfc_dmabuf *inp = cmdiocb->context1;
  3754		struct lpfc_dmabuf *outp = cmdiocb->context2;
  3755		struct lpfc_sli_ct_request *ctcmd = inp->virt;
  3756		struct lpfc_sli_ct_request *ctrsp = outp->virt;
  3757		u16 rsp = ctrsp->CommandResponse.bits.CmdRsp;
  3758		struct app_id_object *app;
  3759		u32 cmd, hash;
  3760		struct lpfc_vmid *vmp;
  3761		u8 *data = outp->virt;
  3762		int i;
  3763	
  3764		cmd = be16_to_cpu(ctcmd->CommandResponse.bits.CmdRsp);
  3765		if (cmd == SLI_CTAS_DALLAPP_ID)
  3766			lpfc_ct_free_iocb(phba, cmdiocb);
  3767	
  3768		if (lpfc_els_chk_latt(vport) || rspiocb->iocb.ulpStatus) {
  3769			if (cmd != SLI_CTAS_DALLAPP_ID)
  3770				return;
  3771		}
  3772		/* Check for a CT LS_RJT response */
  3773		if (rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
  3774			if (cmd != SLI_CTAS_DALLAPP_ID)
  3775				lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3776						 "3306 VMID FS_RJT Data: x%x  %x %x\n",
  3777					 cmd, ctrsp->ReasonCode, ctrsp->Explanation);
  3778			if ((cmd != SLI_CTAS_DALLAPP_ID) ||
  3779			    (ctrsp->ReasonCode != SLI_CT_UNABLE_TO_PERFORM_REQ) ||
  3780			    (ctrsp->Explanation != SLI_CT_APP_ID_NOT_AVAILABLE)) {
  3781				/* If DALLAPP_ID failed retry later */
  3782				if (cmd == SLI_CTAS_DALLAPP_ID)
  3783					vport->load_flag |= FC_DEREGISTER_ALL_APP_ID;
  3784				return;
  3785			}
  3786		}
  3787	
  3788		switch (cmd) {
  3789		case SLI_CTAS_RAPP_IDENT:
  3790			app = (struct app_id_object *)(RAPP_IDENT_OFFSET + data);
  3791			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3792					 "6712 RAPP_IDENT app id %d  port id %x id\n"
  3793					 "len %d\n", be32_to_cpu(app->app_id),
  3794					 be32_to_cpu(app->port_id),
  3795					 app->obj.entity_id_len);
  3796	
  3797			if (app->obj.entity_id_len == 0 || app->port_id == 0)
  3798				return;
  3799	
  3800			hash = lpfc_vmid_hash_fn(app->obj.entity_id,
  3801						 app->obj.entity_id_len);
  3802			vmp = lpfc_get_vmid_from_hastable(vport, hash,
  3803							  app->obj.entity_id);
  3804			if (vmp) {
  3805				vmp->un.app_id = be32_to_cpu(app->app_id);
  3806				vmp->flag |= LPFC_VMID_REGISTERED;
  3807				vmp->flag &= ~LPFC_VMID_REQ_REGISTER;
  3808				/* Set IN USE flag */
  3809				vport->vmid_flag |= LPFC_VMID_IN_USE;
  3810			} else {
  3811				lpfc_printf_vlog(vport, KERN_DEBUG,
  3812						 LOG_DISCOVERY, "6901 No entry found\n"
  3813						 "%s hash %d\n", app->obj.entity_id,
  3814						 hash);
  3815			}
  3816			break;
  3817		case SLI_CTAS_DAPP_IDENT:
  3818			app = (struct app_id_object *)(DAPP_IDENT_OFFSET + data);
  3819			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3820					 "6713 DAPP_IDENT app id %d  port id %x",
  3821					 cpu_to_be32(app->app_id),
  3822					 cpu_to_be32(app->port_id));
  3823			break;
  3824		case SLI_CTAS_DALLAPP_ID:
  3825			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3826					 "8856 Deregistered all app ids");
  3827			for (i = 0; i < phba->cfg_max_vmid; i++) {
  3828				vmp = &vport->vmid[i];
  3829				if (vmp->flag != LPFC_VMID_SLOT_FREE)
  3830					memset(vmp, 0, sizeof(struct lpfc_vmid));
  3831			}
  3832			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  3833				vport->hash_table[i] = NULL;
  3834			vport->load_flag |= FC_ALLOW_VMID;
  3835			break;
  3836		default:
  3837			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3838					 "8857 Invalid command code");
  3839		}
  3840	}
  3841	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid.
@ 2020-12-16 16:57     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 16:57 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6064 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_ct.c:3749:1: warning: no previous prototype for 'lpfc_cmpl_ct_cmd_vmid' [-Wmissing-prototypes]
    3749 | lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
         | ^~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_cmpl_ct_cmd_vmid +3749 drivers/scsi/lpfc/lpfc_ct.c

  3747	
  3748	void
> 3749	lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
  3750			      struct lpfc_iocbq *rspiocb)
  3751	{
  3752		struct lpfc_vport *vport = cmdiocb->vport;
  3753		struct lpfc_dmabuf *inp = cmdiocb->context1;
  3754		struct lpfc_dmabuf *outp = cmdiocb->context2;
  3755		struct lpfc_sli_ct_request *ctcmd = inp->virt;
  3756		struct lpfc_sli_ct_request *ctrsp = outp->virt;
  3757		u16 rsp = ctrsp->CommandResponse.bits.CmdRsp;
  3758		struct app_id_object *app;
  3759		u32 cmd, hash;
  3760		struct lpfc_vmid *vmp;
  3761		u8 *data = outp->virt;
  3762		int i;
  3763	
  3764		cmd = be16_to_cpu(ctcmd->CommandResponse.bits.CmdRsp);
  3765		if (cmd == SLI_CTAS_DALLAPP_ID)
  3766			lpfc_ct_free_iocb(phba, cmdiocb);
  3767	
  3768		if (lpfc_els_chk_latt(vport) || rspiocb->iocb.ulpStatus) {
  3769			if (cmd != SLI_CTAS_DALLAPP_ID)
  3770				return;
  3771		}
  3772		/* Check for a CT LS_RJT response */
  3773		if (rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
  3774			if (cmd != SLI_CTAS_DALLAPP_ID)
  3775				lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3776						 "3306 VMID FS_RJT Data: x%x  %x %x\n",
  3777					 cmd, ctrsp->ReasonCode, ctrsp->Explanation);
  3778			if ((cmd != SLI_CTAS_DALLAPP_ID) ||
  3779			    (ctrsp->ReasonCode != SLI_CT_UNABLE_TO_PERFORM_REQ) ||
  3780			    (ctrsp->Explanation != SLI_CT_APP_ID_NOT_AVAILABLE)) {
  3781				/* If DALLAPP_ID failed retry later */
  3782				if (cmd == SLI_CTAS_DALLAPP_ID)
  3783					vport->load_flag |= FC_DEREGISTER_ALL_APP_ID;
  3784				return;
  3785			}
  3786		}
  3787	
  3788		switch (cmd) {
  3789		case SLI_CTAS_RAPP_IDENT:
  3790			app = (struct app_id_object *)(RAPP_IDENT_OFFSET + data);
  3791			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3792					 "6712 RAPP_IDENT app id %d  port id %x id\n"
  3793					 "len %d\n", be32_to_cpu(app->app_id),
  3794					 be32_to_cpu(app->port_id),
  3795					 app->obj.entity_id_len);
  3796	
  3797			if (app->obj.entity_id_len == 0 || app->port_id == 0)
  3798				return;
  3799	
  3800			hash = lpfc_vmid_hash_fn(app->obj.entity_id,
  3801						 app->obj.entity_id_len);
  3802			vmp = lpfc_get_vmid_from_hastable(vport, hash,
  3803							  app->obj.entity_id);
  3804			if (vmp) {
  3805				vmp->un.app_id = be32_to_cpu(app->app_id);
  3806				vmp->flag |= LPFC_VMID_REGISTERED;
  3807				vmp->flag &= ~LPFC_VMID_REQ_REGISTER;
  3808				/* Set IN USE flag */
  3809				vport->vmid_flag |= LPFC_VMID_IN_USE;
  3810			} else {
  3811				lpfc_printf_vlog(vport, KERN_DEBUG,
  3812						 LOG_DISCOVERY, "6901 No entry found\n"
  3813						 "%s hash %d\n", app->obj.entity_id,
  3814						 hash);
  3815			}
  3816			break;
  3817		case SLI_CTAS_DAPP_IDENT:
  3818			app = (struct app_id_object *)(DAPP_IDENT_OFFSET + data);
  3819			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3820					 "6713 DAPP_IDENT app id %d  port id %x",
  3821					 cpu_to_be32(app->app_id),
  3822					 cpu_to_be32(app->port_id));
  3823			break;
  3824		case SLI_CTAS_DALLAPP_ID:
  3825			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3826					 "8856 Deregistered all app ids");
  3827			for (i = 0; i < phba->cfg_max_vmid; i++) {
  3828				vmp = &vport->vmid[i];
  3829				if (vmp->flag != LPFC_VMID_SLOT_FREE)
  3830					memset(vmp, 0, sizeof(struct lpfc_vmid));
  3831			}
  3832			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  3833				vport->hash_table[i] = NULL;
  3834			vport->load_flag |= FC_ALLOW_VMID;
  3835			break;
  3836		default:
  3837			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3838					 "8857 Invalid command code");
  3839		}
  3840	}
  3841	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 13/16] lpfc: vmid: Timeout implementation for vmid
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-16 17:51     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 17:51 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 3361 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/740ce984134d0cb523356e9bc60b870497053caf
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 740ce984134d0cb523356e9bc60b870497053caf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_hbadisc.c:318:6: warning: no previous prototype for 'lpfc_check_inactive_vmid' [-Wmissing-prototypes]
     318 | void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_check_inactive_vmid +318 drivers/scsi/lpfc/lpfc_hbadisc.c

   307	
   308	/**
   309	 * lpfc_check_inactive_vmid - VMID inactivity checker
   310	 * @phba: Pointer to hba context object.
   311	 *
   312	 * This function is called from the worker thread to determine if an entry in
   313	 * the vmid table can be released since there was no IO activity seen from that
   314	 * particular VM for the specified time. When this happens, the entry in the
   315	 * table is released and also the resources on the switch cleared.
   316	 **/
   317	
 > 318	void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
   319	{
   320		struct lpfc_vport *vport;
   321		struct lpfc_vport **vports;
   322		int i;
   323	
   324		vports = lpfc_create_vport_work_array(phba);
   325		if (!vports)
   326			return;
   327	
   328		for (i = 0; i <= phba->max_vports; i++) {
   329			if ((!vports[i]) && (i == 0))
   330				vport = phba->pport;
   331			else
   332				vport = vports[i];
   333			if (!vport)
   334				break;
   335	
   336			lpfc_check_inactive_vmid_one(vport);
   337		}
   338		lpfc_destroy_vport_work_array(phba, vports);
   339	}
   340	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 13/16] lpfc: vmid: Timeout implementation for vmid
@ 2020-12-16 17:51     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 17:51 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne, pbonzini

[-- Attachment #1: Type: text/plain, Size: 3361 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/740ce984134d0cb523356e9bc60b870497053caf
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 740ce984134d0cb523356e9bc60b870497053caf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_hbadisc.c:318:6: warning: no previous prototype for 'lpfc_check_inactive_vmid' [-Wmissing-prototypes]
     318 | void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_check_inactive_vmid +318 drivers/scsi/lpfc/lpfc_hbadisc.c

   307	
   308	/**
   309	 * lpfc_check_inactive_vmid - VMID inactivity checker
   310	 * @phba: Pointer to hba context object.
   311	 *
   312	 * This function is called from the worker thread to determine if an entry in
   313	 * the vmid table can be released since there was no IO activity seen from that
   314	 * particular VM for the specified time. When this happens, the entry in the
   315	 * table is released and also the resources on the switch cleared.
   316	 **/
   317	
 > 318	void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
   319	{
   320		struct lpfc_vport *vport;
   321		struct lpfc_vport **vports;
   322		int i;
   323	
   324		vports = lpfc_create_vport_work_array(phba);
   325		if (!vports)
   326			return;
   327	
   328		for (i = 0; i <= phba->max_vports; i++) {
   329			if ((!vports[i]) && (i == 0))
   330				vport = phba->pport;
   331			else
   332				vport = vports[i];
   333			if (!vport)
   334				break;
   335	
   336			lpfc_check_inactive_vmid_one(vport);
   337		}
   338		lpfc_destroy_vport_work_array(phba, vports);
   339	}
   340	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 13/16] lpfc: vmid: Timeout implementation for vmid
@ 2020-12-16 17:51     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 17:51 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3444 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/740ce984134d0cb523356e9bc60b870497053caf
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 740ce984134d0cb523356e9bc60b870497053caf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_hbadisc.c:318:6: warning: no previous prototype for 'lpfc_check_inactive_vmid' [-Wmissing-prototypes]
     318 | void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_check_inactive_vmid +318 drivers/scsi/lpfc/lpfc_hbadisc.c

   307	
   308	/**
   309	 * lpfc_check_inactive_vmid - VMID inactivity checker
   310	 * @phba: Pointer to hba context object.
   311	 *
   312	 * This function is called from the worker thread to determine if an entry in
   313	 * the vmid table can be released since there was no IO activity seen from that
   314	 * particular VM for the specified time. When this happens, the entry in the
   315	 * table is released and also the resources on the switch cleared.
   316	 **/
   317	
 > 318	void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
   319	{
   320		struct lpfc_vport *vport;
   321		struct lpfc_vport **vports;
   322		int i;
   323	
   324		vports = lpfc_create_vport_work_array(phba);
   325		if (!vports)
   326			return;
   327	
   328		for (i = 0; i <= phba->max_vports; i++) {
   329			if ((!vports[i]) && (i == 0))
   330				vport = phba->pport;
   331			else
   332				vport = vports[i];
   333			if (!vport)
   334				break;
   335	
   336			lpfc_check_inactive_vmid_one(vport);
   337		}
   338		lpfc_destroy_vport_work_array(phba, vports);
   339	}
   340	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-16 18:31     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 18:31 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, jsmart2021, emilne, mkumar, pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 3485 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/4bfc0dd58345c1a8eaf5c00475ca1b0472a0ba44
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 4bfc0dd58345c1a8eaf5c00475ca1b0472a0ba44
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/scsi/lpfc/lpfc_hbadisc.c:318:6: warning: no previous prototype for 'lpfc_check_inactive_vmid' [-Wmissing-prototypes]
     318 | void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_hbadisc.c:431:6: warning: no previous prototype for 'lpfc_check_vmid_qfpa_issue' [-Wmissing-prototypes]
     431 | void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_check_vmid_qfpa_issue':
>> drivers/scsi/lpfc/lpfc_hbadisc.c:435:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     435 |  int i, ret;
         |         ^~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_check_vmid_qfpa_issue +431 drivers/scsi/lpfc/lpfc_hbadisc.c

   430	
 > 431	void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
   432	{
   433		struct lpfc_vport *vport;
   434		struct lpfc_vport **vports;
 > 435		int i, ret;
   436	
   437		vports = lpfc_create_vport_work_array(phba);
   438		if (!vports)
   439			return;
   440	
   441		for (i = 0; i <= phba->max_vports; i++) {
   442			if ((!vports[i]) && (i == 0))
   443				vport = phba->pport;
   444			else
   445				vport = vports[i];
   446			if (!vport)
   447				break;
   448	
   449			if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) {
   450				ret = lpfc_issue_els_qfpa(vport);
   451				vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA;
   452			}
   453		}
   454		lpfc_destroy_vport_work_array(phba, vports);
   455	}
   456	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread
@ 2020-12-16 18:31     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 18:31 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne, pbonzini

[-- Attachment #1: Type: text/plain, Size: 3485 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/4bfc0dd58345c1a8eaf5c00475ca1b0472a0ba44
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 4bfc0dd58345c1a8eaf5c00475ca1b0472a0ba44
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/scsi/lpfc/lpfc_hbadisc.c:318:6: warning: no previous prototype for 'lpfc_check_inactive_vmid' [-Wmissing-prototypes]
     318 | void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_hbadisc.c:431:6: warning: no previous prototype for 'lpfc_check_vmid_qfpa_issue' [-Wmissing-prototypes]
     431 | void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_check_vmid_qfpa_issue':
>> drivers/scsi/lpfc/lpfc_hbadisc.c:435:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     435 |  int i, ret;
         |         ^~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_check_vmid_qfpa_issue +431 drivers/scsi/lpfc/lpfc_hbadisc.c

   430	
 > 431	void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
   432	{
   433		struct lpfc_vport *vport;
   434		struct lpfc_vport **vports;
 > 435		int i, ret;
   436	
   437		vports = lpfc_create_vport_work_array(phba);
   438		if (!vports)
   439			return;
   440	
   441		for (i = 0; i <= phba->max_vports; i++) {
   442			if ((!vports[i]) && (i == 0))
   443				vport = phba->pport;
   444			else
   445				vport = vports[i];
   446			if (!vport)
   447				break;
   448	
   449			if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) {
   450				ret = lpfc_issue_els_qfpa(vport);
   451				vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA;
   452			}
   453		}
   454		lpfc_destroy_vport_work_array(phba, vports);
   455	}
   456	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread
@ 2020-12-16 18:31     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-16 18:31 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3568 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/4bfc0dd58345c1a8eaf5c00475ca1b0472a0ba44
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 4bfc0dd58345c1a8eaf5c00475ca1b0472a0ba44
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/scsi/lpfc/lpfc_hbadisc.c:318:6: warning: no previous prototype for 'lpfc_check_inactive_vmid' [-Wmissing-prototypes]
     318 | void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_hbadisc.c:431:6: warning: no previous prototype for 'lpfc_check_vmid_qfpa_issue' [-Wmissing-prototypes]
     431 | void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_check_vmid_qfpa_issue':
>> drivers/scsi/lpfc/lpfc_hbadisc.c:435:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     435 |  int i, ret;
         |         ^~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_check_vmid_qfpa_issue +431 drivers/scsi/lpfc/lpfc_hbadisc.c

   430	
 > 431	void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
   432	{
   433		struct lpfc_vport *vport;
   434		struct lpfc_vport **vports;
 > 435		int i, ret;
   436	
   437		vports = lpfc_create_vport_work_array(phba);
   438		if (!vports)
   439			return;
   440	
   441		for (i = 0; i <= phba->max_vports; i++) {
   442			if ((!vports[i]) && (i == 0))
   443				vport = phba->pport;
   444			else
   445				vport = vports[i];
   446			if (!vport)
   447				break;
   448	
   449			if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) {
   450				ret = lpfc_issue_els_qfpa(vport);
   451				vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA;
   452			}
   453		}
   454		lpfc_destroy_vport_work_array(phba, vports);
   455	}
   456	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62883 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-19 15:58     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 15:58 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, clang-built-linux, jsmart2021, emilne, mkumar,
	pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 4062 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_init.c:4288:1: warning: no previous prototype for function 'lpfc_vmid_res_alloc' [-Wmissing-prototypes]
   lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
   ^
   drivers/scsi/lpfc/lpfc_init.c:4287:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   u8
   ^
   static 
   1 warning generated.


vim +/lpfc_vmid_res_alloc +4288 drivers/scsi/lpfc/lpfc_init.c

  4275	
  4276	/**
  4277	 * lpfc_vmid_res_alloc - Allocates resources for VMID
  4278	 * @phba: pointer to lpfc hba data structure.
  4279	 * @vport: pointer to vport data structure
  4280	 *
  4281	 * This routine allocated the resources needed for the vmid.
  4282	 *
  4283	 * Return codes
  4284	 *	0 on Succeess
  4285	 *	Non-0 on Failure
  4286	 */
  4287	u8
> 4288	lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
  4289	{
  4290		u16 i;
  4291	
  4292		/* vmid feature is supported only on SLI4 */
  4293		if (phba->sli_rev == LPFC_SLI_REV3) {
  4294			phba->cfg_vmid_app_header = 0;
  4295			phba->cfg_vmid_priority_tagging = 0;
  4296		}
  4297	
  4298		/* if enabled, then allocated the resources */
  4299		if (lpfc_is_vmid_enabled(phba)) {
  4300			vport->vmid =
  4301			    kmalloc_array(phba->cfg_max_vmid, sizeof(struct lpfc_vmid),
  4302					  GFP_KERNEL);
  4303			if (!vport->vmid)
  4304				return FAILURE;
  4305	
  4306			memset(vport->vmid, 0,
  4307			       phba->cfg_max_vmid * sizeof(struct lpfc_vmid));
  4308	
  4309			rwlock_init(&vport->vmid_lock);
  4310	
  4311			/* setting the VMID parameters for the vport */
  4312			vport->vmid_priority_tagging = phba->cfg_vmid_priority_tagging;
  4313			vport->vmid_inactivity_timeout =
  4314			    phba->cfg_vmid_inactivity_timeout;
  4315			vport->max_vmid = phba->cfg_max_vmid;
  4316			vport->cur_vmid_cnt = 0;
  4317	
  4318			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  4319				vport->hash_table[i] = NULL;
  4320	
  4321			vport->vmid_priority_range = bitmap_zalloc
  4322				(LPFC_VMID_MAX_PRIORITY_RANGE, GFP_KERNEL);
  4323	
  4324			if (!vport->vmid_priority_range) {
  4325				kfree(vport->vmid);
  4326				return FAILURE;
  4327			}
  4328		}
  4329		return 0;
  4330	}
  4331	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup
@ 2020-12-19 15:58     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 15:58 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne,
	clang-built-linux, pbonzini

[-- Attachment #1: Type: text/plain, Size: 4062 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_init.c:4288:1: warning: no previous prototype for function 'lpfc_vmid_res_alloc' [-Wmissing-prototypes]
   lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
   ^
   drivers/scsi/lpfc/lpfc_init.c:4287:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   u8
   ^
   static 
   1 warning generated.


vim +/lpfc_vmid_res_alloc +4288 drivers/scsi/lpfc/lpfc_init.c

  4275	
  4276	/**
  4277	 * lpfc_vmid_res_alloc - Allocates resources for VMID
  4278	 * @phba: pointer to lpfc hba data structure.
  4279	 * @vport: pointer to vport data structure
  4280	 *
  4281	 * This routine allocated the resources needed for the vmid.
  4282	 *
  4283	 * Return codes
  4284	 *	0 on Succeess
  4285	 *	Non-0 on Failure
  4286	 */
  4287	u8
> 4288	lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
  4289	{
  4290		u16 i;
  4291	
  4292		/* vmid feature is supported only on SLI4 */
  4293		if (phba->sli_rev == LPFC_SLI_REV3) {
  4294			phba->cfg_vmid_app_header = 0;
  4295			phba->cfg_vmid_priority_tagging = 0;
  4296		}
  4297	
  4298		/* if enabled, then allocated the resources */
  4299		if (lpfc_is_vmid_enabled(phba)) {
  4300			vport->vmid =
  4301			    kmalloc_array(phba->cfg_max_vmid, sizeof(struct lpfc_vmid),
  4302					  GFP_KERNEL);
  4303			if (!vport->vmid)
  4304				return FAILURE;
  4305	
  4306			memset(vport->vmid, 0,
  4307			       phba->cfg_max_vmid * sizeof(struct lpfc_vmid));
  4308	
  4309			rwlock_init(&vport->vmid_lock);
  4310	
  4311			/* setting the VMID parameters for the vport */
  4312			vport->vmid_priority_tagging = phba->cfg_vmid_priority_tagging;
  4313			vport->vmid_inactivity_timeout =
  4314			    phba->cfg_vmid_inactivity_timeout;
  4315			vport->max_vmid = phba->cfg_max_vmid;
  4316			vport->cur_vmid_cnt = 0;
  4317	
  4318			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  4319				vport->hash_table[i] = NULL;
  4320	
  4321			vport->vmid_priority_range = bitmap_zalloc
  4322				(LPFC_VMID_MAX_PRIORITY_RANGE, GFP_KERNEL);
  4323	
  4324			if (!vport->vmid_priority_range) {
  4325				kfree(vport->vmid);
  4326				return FAILURE;
  4327			}
  4328		}
  4329		return 0;
  4330	}
  4331	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup
@ 2020-12-19 15:58     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 15:58 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4169 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 03480ee8b62a90ab2917fccf45d0e56185c1f8a5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_init.c:4288:1: warning: no previous prototype for function 'lpfc_vmid_res_alloc' [-Wmissing-prototypes]
   lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
   ^
   drivers/scsi/lpfc/lpfc_init.c:4287:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   u8
   ^
   static 
   1 warning generated.


vim +/lpfc_vmid_res_alloc +4288 drivers/scsi/lpfc/lpfc_init.c

  4275	
  4276	/**
  4277	 * lpfc_vmid_res_alloc - Allocates resources for VMID
  4278	 * @phba: pointer to lpfc hba data structure.
  4279	 * @vport: pointer to vport data structure
  4280	 *
  4281	 * This routine allocated the resources needed for the vmid.
  4282	 *
  4283	 * Return codes
  4284	 *	0 on Succeess
  4285	 *	Non-0 on Failure
  4286	 */
  4287	u8
> 4288	lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport)
  4289	{
  4290		u16 i;
  4291	
  4292		/* vmid feature is supported only on SLI4 */
  4293		if (phba->sli_rev == LPFC_SLI_REV3) {
  4294			phba->cfg_vmid_app_header = 0;
  4295			phba->cfg_vmid_priority_tagging = 0;
  4296		}
  4297	
  4298		/* if enabled, then allocated the resources */
  4299		if (lpfc_is_vmid_enabled(phba)) {
  4300			vport->vmid =
  4301			    kmalloc_array(phba->cfg_max_vmid, sizeof(struct lpfc_vmid),
  4302					  GFP_KERNEL);
  4303			if (!vport->vmid)
  4304				return FAILURE;
  4305	
  4306			memset(vport->vmid, 0,
  4307			       phba->cfg_max_vmid * sizeof(struct lpfc_vmid));
  4308	
  4309			rwlock_init(&vport->vmid_lock);
  4310	
  4311			/* setting the VMID parameters for the vport */
  4312			vport->vmid_priority_tagging = phba->cfg_vmid_priority_tagging;
  4313			vport->vmid_inactivity_timeout =
  4314			    phba->cfg_vmid_inactivity_timeout;
  4315			vport->max_vmid = phba->cfg_max_vmid;
  4316			vport->cur_vmid_cnt = 0;
  4317	
  4318			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  4319				vport->hash_table[i] = NULL;
  4320	
  4321			vport->vmid_priority_range = bitmap_zalloc
  4322				(LPFC_VMID_MAX_PRIORITY_RANGE, GFP_KERNEL);
  4323	
  4324			if (!vport->vmid_priority_range) {
  4325				kfree(vport->vmid);
  4326				return FAILURE;
  4327			}
  4328		}
  4329		return 0;
  4330	}
  4331	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 02/16] blkcg: Added a app identifier support for blkcg
  2020-12-16  5:29   ` Muneendra
@ 2020-12-19 17:12     ` Randy Dunlap
  -1 siblings, 0 replies; 73+ messages in thread
From: Randy Dunlap @ 2020-12-19 17:12 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini

On 12/15/20 9:29 PM, Muneendra wrote:

Hi--

> ---
>  block/Kconfig              |  9 ++++++
>  include/linux/blk-cgroup.h | 56 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 65 insertions(+)
> 
> diff --git a/block/Kconfig b/block/Kconfig
> index a2297edfdde8..1920388fb0e9 100644
> --- a/block/Kconfig
> +++ b/block/Kconfig
> @@ -144,6 +144,15 @@ config BLK_CGROUP_IOLATENCY
>  
>  	Note, this is an experimental interface and could be changed someday.
>  
> +config BLK_CGROUP_FC_APPID
> +	bool "Enable support to track FC io Traffic across cgroup applications"
> +	depends on BLK_CGROUP=y
> +	help
> +	Enabling this option enables the support to track FC io traffic across
> +	cgroup applications.It enables the Fabric and the storage targets to
> +	identify, monitor, and handle FC traffic based on vm tags by inserting
> +	application specific identification into the FC frame.

Please follow coding-style for Kconfig files:

from Documentation/process/coding-style.rst, section 10):

For all of the Kconfig* configuration files throughout the source tree,
the indentation is somewhat different.  Lines under a ``config`` definition
are indented with one tab, while help text is indented an additional two
spaces.


thanks.
-- 
~Randy


^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 02/16] blkcg: Added a app identifier support for blkcg
@ 2020-12-19 17:12     ` Randy Dunlap
  0 siblings, 0 replies; 73+ messages in thread
From: Randy Dunlap @ 2020-12-19 17:12 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne

On 12/15/20 9:29 PM, Muneendra wrote:

Hi--

> ---
>  block/Kconfig              |  9 ++++++
>  include/linux/blk-cgroup.h | 56 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 65 insertions(+)
> 
> diff --git a/block/Kconfig b/block/Kconfig
> index a2297edfdde8..1920388fb0e9 100644
> --- a/block/Kconfig
> +++ b/block/Kconfig
> @@ -144,6 +144,15 @@ config BLK_CGROUP_IOLATENCY
>  
>  	Note, this is an experimental interface and could be changed someday.
>  
> +config BLK_CGROUP_FC_APPID
> +	bool "Enable support to track FC io Traffic across cgroup applications"
> +	depends on BLK_CGROUP=y
> +	help
> +	Enabling this option enables the support to track FC io traffic across
> +	cgroup applications.It enables the Fabric and the storage targets to
> +	identify, monitor, and handle FC traffic based on vm tags by inserting
> +	application specific identification into the FC frame.

Please follow coding-style for Kconfig files:

from Documentation/process/coding-style.rst, section 10):

For all of the Kconfig* configuration files throughout the source tree,
the indentation is somewhat different.  Lines under a ``config`` definition
are indented with one tab, while help text is indented an additional two
spaces.


thanks.
-- 
~Randy


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 16/16] scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID
  2020-12-16  5:29   ` Muneendra
@ 2020-12-19 17:15     ` Randy Dunlap
  -1 siblings, 0 replies; 73+ messages in thread
From: Randy Dunlap @ 2020-12-19 17:15 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini

Hi,

On 12/15/20 9:29 PM, Muneendra wrote:
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index 701b61ec76ee..1c73c60e398f 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig
> @@ -235,6 +235,19 @@ config SCSI_FC_ATTRS
>  	  each attached FiberChannel device to sysfs, say Y.
>  	  Otherwise, say N.
>  
> +config FC_APPID
> +	bool "Enable support to track FC io Traffic"

	                                 IO  {or I/O}

> +	depends on BLOCK && BLK_CGROUP
> +	depends on SCSI
> +	select BLK_CGROUP_FC_APPID
> +	default y
> +	help
> +	  If you say Y here, it enables the support to track
> +	  FC IO traffic over fabric.It enables the Fabric and the

	                over fabric. It

> +	  storage targets to identify, monitor, and handle FC traffic
> +	  based on vm tags by inserting application specific

	           VM

> +	  identification into the FC frame

	                             frame.



-- 
~Randy


^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 16/16] scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID
@ 2020-12-19 17:15     ` Randy Dunlap
  0 siblings, 0 replies; 73+ messages in thread
From: Randy Dunlap @ 2020-12-19 17:15 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne

Hi,

On 12/15/20 9:29 PM, Muneendra wrote:
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index 701b61ec76ee..1c73c60e398f 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig
> @@ -235,6 +235,19 @@ config SCSI_FC_ATTRS
>  	  each attached FiberChannel device to sysfs, say Y.
>  	  Otherwise, say N.
>  
> +config FC_APPID
> +	bool "Enable support to track FC io Traffic"

	                                 IO  {or I/O}

> +	depends on BLOCK && BLK_CGROUP
> +	depends on SCSI
> +	select BLK_CGROUP_FC_APPID
> +	default y
> +	help
> +	  If you say Y here, it enables the support to track
> +	  FC IO traffic over fabric.It enables the Fabric and the

	                over fabric. It

> +	  storage targets to identify, monitor, and handle FC traffic
> +	  based on vm tags by inserting application specific

	           VM

> +	  identification into the FC frame

	                             frame.



-- 
~Randy


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-19 18:04     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 18:04 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, clang-built-linux, jsmart2021, emilne, mkumar,
	pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 8208 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/65751f65f5df79aaa25cd5752589ca91ebddde18
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 65751f65f5df79aaa25cd5752589ca91ebddde18
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_els.c:10354:6: warning: no previous prototype for function 'lpfc_init_cs_ctl_bitmap' [-Wmissing-prototypes]
   void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
        ^
   drivers/scsi/lpfc/lpfc_els.c:10354:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10360:1: warning: no previous prototype for function 'lpfc_vmid_set_cs_ctl_range' [-Wmissing-prototypes]
   lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
   ^
   drivers/scsi/lpfc/lpfc_els.c:10359:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10371:6: warning: no previous prototype for function 'lpfc_vmid_put_cs_ctl' [-Wmissing-prototypes]
   void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
        ^
   drivers/scsi/lpfc/lpfc_els.c:10371:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10408:6: warning: variable 'ndlp' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!prsp)
               ^~~~~
   drivers/scsi/lpfc/lpfc_els.c:10482:15: note: uninitialized use occurs here
           lpfc_nlp_put(ndlp);
                        ^~~~
   drivers/scsi/lpfc/lpfc_els.c:10408:2: note: remove the 'if' if its condition is always false
           if (!prsp)
           ^~~~~~~~~~
   drivers/scsi/lpfc/lpfc_els.c:10405:28: note: initialize the variable 'ndlp' to silence this warning
           struct lpfc_nodelist *ndlp;
                                     ^
                                      = NULL
   4 warnings generated.


vim +/lpfc_init_cs_ctl_bitmap +10354 drivers/scsi/lpfc/lpfc_els.c

 10353	
 10354	void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
 10355	{
 10356		bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE);
 10357	}
 10358	
 10359	void
 10360	lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
 10361	{
 10362		u32 i;
 10363	
 10364		if ((min > max) || (max > LPFC_VMID_MAX_PRIORITY_RANGE))
 10365			return;
 10366	
 10367		for (i = min; i <= max; i++)
 10368			set_bit(i, vport->vmid_priority_range);
 10369	}
 10370	
 10371	void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
 10372	{
 10373		set_bit(ctcl_vmid, vport->vmid_priority_range);
 10374	}
 10375	
 10376	u32 lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport)
 10377	{
 10378		u32 i;
 10379	
 10380		i = find_first_bit(vport->vmid_priority_range,
 10381				   LPFC_VMID_MAX_PRIORITY_RANGE);
 10382	
 10383		if (i == LPFC_VMID_MAX_PRIORITY_RANGE)
 10384			return 0;
 10385	
 10386		clear_bit(i, vport->vmid_priority_range);
 10387		return i;
 10388	}
 10389	
 10390	#define MAX_PRIORITY_DESC	255
 10391	
 10392	static void
 10393	lpfc_cmpl_els_qfpa(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 10394			   struct lpfc_iocbq *rspiocb)
 10395	{
 10396		struct lpfc_vport *vport = cmdiocb->vport;
 10397		struct priority_range_desc *desc;
 10398		struct lpfc_dmabuf *prsp = NULL;
 10399		struct lpfc_vmid_priority_range *vmid_range = NULL;
 10400		u32 *data;
 10401		struct lpfc_dmabuf *dmabuf = cmdiocb->context2;
 10402		IOCB_t *irsp = &rspiocb->iocb;
 10403		u8 *pcmd;
 10404		u32 len, i;
 10405		struct lpfc_nodelist *ndlp;
 10406	
 10407		prsp = list_get_first(&dmabuf->list, struct lpfc_dmabuf, list);
 10408		if (!prsp)
 10409			goto out;
 10410	
 10411		ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
 10412		pcmd = prsp->virt;
 10413		data = (u32 *)pcmd;
 10414		if (data[0] == ELS_CMD_LS_RJT) {
 10415			lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
 10416					 "6528 QFPA LS_RJT %x  %x ", data[0], data[1]);
 10417			goto out;
 10418		}
 10419		if (irsp->ulpStatus) {
 10420			lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
 10421					 "6529 QFPA failed with status %x  %x ",
 10422					 irsp->ulpStatus, irsp->un.ulpWord[4]);
 10423			goto out;
 10424		}
 10425	
 10426		if (!vport->qfpa_res) {
 10427			vport->qfpa_res = kmalloc(FCELSSIZE, GFP_KERNEL);
 10428			if (!vport->qfpa_res)
 10429				goto out;
 10430			memset(vport->qfpa_res, 0, FCELSSIZE);
 10431		}
 10432	
 10433		len = *((u32 *)(pcmd + 4));
 10434		len = be32_to_cpu(len);
 10435		memcpy(vport->qfpa_res, pcmd, len + 8);
 10436		len = len / LPFC_PRIORITY_RANGE_DESC_SIZE;
 10437	
 10438		desc = (struct priority_range_desc *)(pcmd + 8);
 10439		vmid_range = vport->vmid_priority.vmid_range;
 10440		if (!vmid_range) {
 10441			vmid_range = kmalloc_array(MAX_PRIORITY_DESC,
 10442						   sizeof
 10443						   (struct lpfc_vmid_priority_range),
 10444						   GFP_KERNEL);
 10445			if (!vmid_range)
 10446				goto out;
 10447			memset(vmid_range, 0, MAX_PRIORITY_DESC *
 10448			       sizeof(struct lpfc_vmid_priority_range));
 10449			vport->vmid_priority.vmid_range = vmid_range;
 10450		}
 10451		vport->vmid_priority.num_descriptors = len;
 10452	
 10453		for (i = 0; i < len; i++, vmid_range++, desc++) {
 10454			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS,
 10455					 "6539 vmid values low=%d, high=%d, qos=%d,\n"
 10456					 " local ve id=%d\n", desc->lo_range,
 10457					 desc->hi_range, desc->qos_priority,
 10458					 desc->local_ve_id);
 10459	
 10460			vmid_range->low = desc->lo_range << 1;
 10461			if (desc->local_ve_id == QFPA_ODD_ONLY)
 10462				vmid_range->low++;
 10463			if (desc->qos_priority)
 10464				vport->vmid_flag |= LPFC_VMID_QOS_ENABLED;
 10465			vmid_range->qos = desc->qos_priority;
 10466	
 10467			vmid_range->high = desc->hi_range << 1;
 10468			if ((desc->local_ve_id == QFPA_ODD_ONLY) ||
 10469			    (desc->local_ve_id == QFPA_EVEN_ODD))
 10470				vmid_range->high++;
 10471		}
 10472		lpfc_init_cs_ctl_bitmap(vport);
 10473		for (i = 0; i < vport->vmid_priority.num_descriptors; i++) {
 10474			lpfc_vmid_set_cs_ctl_range(vport,
 10475					vport->vmid_priority.vmid_range[i].low,
 10476					vport->vmid_priority.vmid_range[i].high);
 10477		}
 10478	
 10479		vport->vmid_flag |= LPFC_VMID_QFPA_CMPL;
 10480	 out:
 10481		lpfc_els_free_iocb(phba, cmdiocb);
 10482		lpfc_nlp_put(ndlp);
 10483	}
 10484	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch
@ 2020-12-19 18:04     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 18:04 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne,
	clang-built-linux, pbonzini

[-- Attachment #1: Type: text/plain, Size: 8208 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/65751f65f5df79aaa25cd5752589ca91ebddde18
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 65751f65f5df79aaa25cd5752589ca91ebddde18
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_els.c:10354:6: warning: no previous prototype for function 'lpfc_init_cs_ctl_bitmap' [-Wmissing-prototypes]
   void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
        ^
   drivers/scsi/lpfc/lpfc_els.c:10354:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10360:1: warning: no previous prototype for function 'lpfc_vmid_set_cs_ctl_range' [-Wmissing-prototypes]
   lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
   ^
   drivers/scsi/lpfc/lpfc_els.c:10359:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10371:6: warning: no previous prototype for function 'lpfc_vmid_put_cs_ctl' [-Wmissing-prototypes]
   void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
        ^
   drivers/scsi/lpfc/lpfc_els.c:10371:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10408:6: warning: variable 'ndlp' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!prsp)
               ^~~~~
   drivers/scsi/lpfc/lpfc_els.c:10482:15: note: uninitialized use occurs here
           lpfc_nlp_put(ndlp);
                        ^~~~
   drivers/scsi/lpfc/lpfc_els.c:10408:2: note: remove the 'if' if its condition is always false
           if (!prsp)
           ^~~~~~~~~~
   drivers/scsi/lpfc/lpfc_els.c:10405:28: note: initialize the variable 'ndlp' to silence this warning
           struct lpfc_nodelist *ndlp;
                                     ^
                                      = NULL
   4 warnings generated.


vim +/lpfc_init_cs_ctl_bitmap +10354 drivers/scsi/lpfc/lpfc_els.c

 10353	
 10354	void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
 10355	{
 10356		bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE);
 10357	}
 10358	
 10359	void
 10360	lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
 10361	{
 10362		u32 i;
 10363	
 10364		if ((min > max) || (max > LPFC_VMID_MAX_PRIORITY_RANGE))
 10365			return;
 10366	
 10367		for (i = min; i <= max; i++)
 10368			set_bit(i, vport->vmid_priority_range);
 10369	}
 10370	
 10371	void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
 10372	{
 10373		set_bit(ctcl_vmid, vport->vmid_priority_range);
 10374	}
 10375	
 10376	u32 lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport)
 10377	{
 10378		u32 i;
 10379	
 10380		i = find_first_bit(vport->vmid_priority_range,
 10381				   LPFC_VMID_MAX_PRIORITY_RANGE);
 10382	
 10383		if (i == LPFC_VMID_MAX_PRIORITY_RANGE)
 10384			return 0;
 10385	
 10386		clear_bit(i, vport->vmid_priority_range);
 10387		return i;
 10388	}
 10389	
 10390	#define MAX_PRIORITY_DESC	255
 10391	
 10392	static void
 10393	lpfc_cmpl_els_qfpa(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 10394			   struct lpfc_iocbq *rspiocb)
 10395	{
 10396		struct lpfc_vport *vport = cmdiocb->vport;
 10397		struct priority_range_desc *desc;
 10398		struct lpfc_dmabuf *prsp = NULL;
 10399		struct lpfc_vmid_priority_range *vmid_range = NULL;
 10400		u32 *data;
 10401		struct lpfc_dmabuf *dmabuf = cmdiocb->context2;
 10402		IOCB_t *irsp = &rspiocb->iocb;
 10403		u8 *pcmd;
 10404		u32 len, i;
 10405		struct lpfc_nodelist *ndlp;
 10406	
 10407		prsp = list_get_first(&dmabuf->list, struct lpfc_dmabuf, list);
 10408		if (!prsp)
 10409			goto out;
 10410	
 10411		ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
 10412		pcmd = prsp->virt;
 10413		data = (u32 *)pcmd;
 10414		if (data[0] == ELS_CMD_LS_RJT) {
 10415			lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
 10416					 "6528 QFPA LS_RJT %x  %x ", data[0], data[1]);
 10417			goto out;
 10418		}
 10419		if (irsp->ulpStatus) {
 10420			lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
 10421					 "6529 QFPA failed with status %x  %x ",
 10422					 irsp->ulpStatus, irsp->un.ulpWord[4]);
 10423			goto out;
 10424		}
 10425	
 10426		if (!vport->qfpa_res) {
 10427			vport->qfpa_res = kmalloc(FCELSSIZE, GFP_KERNEL);
 10428			if (!vport->qfpa_res)
 10429				goto out;
 10430			memset(vport->qfpa_res, 0, FCELSSIZE);
 10431		}
 10432	
 10433		len = *((u32 *)(pcmd + 4));
 10434		len = be32_to_cpu(len);
 10435		memcpy(vport->qfpa_res, pcmd, len + 8);
 10436		len = len / LPFC_PRIORITY_RANGE_DESC_SIZE;
 10437	
 10438		desc = (struct priority_range_desc *)(pcmd + 8);
 10439		vmid_range = vport->vmid_priority.vmid_range;
 10440		if (!vmid_range) {
 10441			vmid_range = kmalloc_array(MAX_PRIORITY_DESC,
 10442						   sizeof
 10443						   (struct lpfc_vmid_priority_range),
 10444						   GFP_KERNEL);
 10445			if (!vmid_range)
 10446				goto out;
 10447			memset(vmid_range, 0, MAX_PRIORITY_DESC *
 10448			       sizeof(struct lpfc_vmid_priority_range));
 10449			vport->vmid_priority.vmid_range = vmid_range;
 10450		}
 10451		vport->vmid_priority.num_descriptors = len;
 10452	
 10453		for (i = 0; i < len; i++, vmid_range++, desc++) {
 10454			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS,
 10455					 "6539 vmid values low=%d, high=%d, qos=%d,\n"
 10456					 " local ve id=%d\n", desc->lo_range,
 10457					 desc->hi_range, desc->qos_priority,
 10458					 desc->local_ve_id);
 10459	
 10460			vmid_range->low = desc->lo_range << 1;
 10461			if (desc->local_ve_id == QFPA_ODD_ONLY)
 10462				vmid_range->low++;
 10463			if (desc->qos_priority)
 10464				vport->vmid_flag |= LPFC_VMID_QOS_ENABLED;
 10465			vmid_range->qos = desc->qos_priority;
 10466	
 10467			vmid_range->high = desc->hi_range << 1;
 10468			if ((desc->local_ve_id == QFPA_ODD_ONLY) ||
 10469			    (desc->local_ve_id == QFPA_EVEN_ODD))
 10470				vmid_range->high++;
 10471		}
 10472		lpfc_init_cs_ctl_bitmap(vport);
 10473		for (i = 0; i < vport->vmid_priority.num_descriptors; i++) {
 10474			lpfc_vmid_set_cs_ctl_range(vport,
 10475					vport->vmid_priority.vmid_range[i].low,
 10476					vport->vmid_priority.vmid_range[i].high);
 10477		}
 10478	
 10479		vport->vmid_flag |= LPFC_VMID_QFPA_CMPL;
 10480	 out:
 10481		lpfc_els_free_iocb(phba, cmdiocb);
 10482		lpfc_nlp_put(ndlp);
 10483	}
 10484	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch
@ 2020-12-19 18:04     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 18:04 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 8417 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/65751f65f5df79aaa25cd5752589ca91ebddde18
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 65751f65f5df79aaa25cd5752589ca91ebddde18
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_els.c:10354:6: warning: no previous prototype for function 'lpfc_init_cs_ctl_bitmap' [-Wmissing-prototypes]
   void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
        ^
   drivers/scsi/lpfc/lpfc_els.c:10354:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10360:1: warning: no previous prototype for function 'lpfc_vmid_set_cs_ctl_range' [-Wmissing-prototypes]
   lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
   ^
   drivers/scsi/lpfc/lpfc_els.c:10359:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10371:6: warning: no previous prototype for function 'lpfc_vmid_put_cs_ctl' [-Wmissing-prototypes]
   void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
        ^
   drivers/scsi/lpfc/lpfc_els.c:10371:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
   ^
   static 
>> drivers/scsi/lpfc/lpfc_els.c:10408:6: warning: variable 'ndlp' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!prsp)
               ^~~~~
   drivers/scsi/lpfc/lpfc_els.c:10482:15: note: uninitialized use occurs here
           lpfc_nlp_put(ndlp);
                        ^~~~
   drivers/scsi/lpfc/lpfc_els.c:10408:2: note: remove the 'if' if its condition is always false
           if (!prsp)
           ^~~~~~~~~~
   drivers/scsi/lpfc/lpfc_els.c:10405:28: note: initialize the variable 'ndlp' to silence this warning
           struct lpfc_nodelist *ndlp;
                                     ^
                                      = NULL
   4 warnings generated.


vim +/lpfc_init_cs_ctl_bitmap +10354 drivers/scsi/lpfc/lpfc_els.c

 10353	
 10354	void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport)
 10355	{
 10356		bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE);
 10357	}
 10358	
 10359	void
 10360	lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max)
 10361	{
 10362		u32 i;
 10363	
 10364		if ((min > max) || (max > LPFC_VMID_MAX_PRIORITY_RANGE))
 10365			return;
 10366	
 10367		for (i = min; i <= max; i++)
 10368			set_bit(i, vport->vmid_priority_range);
 10369	}
 10370	
 10371	void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid)
 10372	{
 10373		set_bit(ctcl_vmid, vport->vmid_priority_range);
 10374	}
 10375	
 10376	u32 lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport)
 10377	{
 10378		u32 i;
 10379	
 10380		i = find_first_bit(vport->vmid_priority_range,
 10381				   LPFC_VMID_MAX_PRIORITY_RANGE);
 10382	
 10383		if (i == LPFC_VMID_MAX_PRIORITY_RANGE)
 10384			return 0;
 10385	
 10386		clear_bit(i, vport->vmid_priority_range);
 10387		return i;
 10388	}
 10389	
 10390	#define MAX_PRIORITY_DESC	255
 10391	
 10392	static void
 10393	lpfc_cmpl_els_qfpa(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 10394			   struct lpfc_iocbq *rspiocb)
 10395	{
 10396		struct lpfc_vport *vport = cmdiocb->vport;
 10397		struct priority_range_desc *desc;
 10398		struct lpfc_dmabuf *prsp = NULL;
 10399		struct lpfc_vmid_priority_range *vmid_range = NULL;
 10400		u32 *data;
 10401		struct lpfc_dmabuf *dmabuf = cmdiocb->context2;
 10402		IOCB_t *irsp = &rspiocb->iocb;
 10403		u8 *pcmd;
 10404		u32 len, i;
 10405		struct lpfc_nodelist *ndlp;
 10406	
 10407		prsp = list_get_first(&dmabuf->list, struct lpfc_dmabuf, list);
 10408		if (!prsp)
 10409			goto out;
 10410	
 10411		ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
 10412		pcmd = prsp->virt;
 10413		data = (u32 *)pcmd;
 10414		if (data[0] == ELS_CMD_LS_RJT) {
 10415			lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI,
 10416					 "6528 QFPA LS_RJT %x  %x ", data[0], data[1]);
 10417			goto out;
 10418		}
 10419		if (irsp->ulpStatus) {
 10420			lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
 10421					 "6529 QFPA failed with status %x  %x ",
 10422					 irsp->ulpStatus, irsp->un.ulpWord[4]);
 10423			goto out;
 10424		}
 10425	
 10426		if (!vport->qfpa_res) {
 10427			vport->qfpa_res = kmalloc(FCELSSIZE, GFP_KERNEL);
 10428			if (!vport->qfpa_res)
 10429				goto out;
 10430			memset(vport->qfpa_res, 0, FCELSSIZE);
 10431		}
 10432	
 10433		len = *((u32 *)(pcmd + 4));
 10434		len = be32_to_cpu(len);
 10435		memcpy(vport->qfpa_res, pcmd, len + 8);
 10436		len = len / LPFC_PRIORITY_RANGE_DESC_SIZE;
 10437	
 10438		desc = (struct priority_range_desc *)(pcmd + 8);
 10439		vmid_range = vport->vmid_priority.vmid_range;
 10440		if (!vmid_range) {
 10441			vmid_range = kmalloc_array(MAX_PRIORITY_DESC,
 10442						   sizeof
 10443						   (struct lpfc_vmid_priority_range),
 10444						   GFP_KERNEL);
 10445			if (!vmid_range)
 10446				goto out;
 10447			memset(vmid_range, 0, MAX_PRIORITY_DESC *
 10448			       sizeof(struct lpfc_vmid_priority_range));
 10449			vport->vmid_priority.vmid_range = vmid_range;
 10450		}
 10451		vport->vmid_priority.num_descriptors = len;
 10452	
 10453		for (i = 0; i < len; i++, vmid_range++, desc++) {
 10454			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS,
 10455					 "6539 vmid values low=%d, high=%d, qos=%d,\n"
 10456					 " local ve id=%d\n", desc->lo_range,
 10457					 desc->hi_range, desc->qos_priority,
 10458					 desc->local_ve_id);
 10459	
 10460			vmid_range->low = desc->lo_range << 1;
 10461			if (desc->local_ve_id == QFPA_ODD_ONLY)
 10462				vmid_range->low++;
 10463			if (desc->qos_priority)
 10464				vport->vmid_flag |= LPFC_VMID_QOS_ENABLED;
 10465			vmid_range->qos = desc->qos_priority;
 10466	
 10467			vmid_range->high = desc->hi_range << 1;
 10468			if ((desc->local_ve_id == QFPA_ODD_ONLY) ||
 10469			    (desc->local_ve_id == QFPA_EVEN_ODD))
 10470				vmid_range->high++;
 10471		}
 10472		lpfc_init_cs_ctl_bitmap(vport);
 10473		for (i = 0; i < vport->vmid_priority.num_descriptors; i++) {
 10474			lpfc_vmid_set_cs_ctl_range(vport,
 10475					vport->vmid_priority.vmid_range[i].low,
 10476					vport->vmid_priority.vmid_range[i].high);
 10477		}
 10478	
 10479		vport->vmid_flag |= LPFC_VMID_QFPA_CMPL;
 10480	 out:
 10481		lpfc_els_free_iocb(phba, cmdiocb);
 10482		lpfc_nlp_put(ndlp);
 10483	}
 10484	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-19 20:20     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 20:20 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, clang-built-linux, jsmart2021, emilne, mkumar,
	pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 6853 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/8417ca99565475d5bf5493657fcf90922607f1b1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 8417ca99565475d5bf5493657fcf90922607f1b1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_scsi.c:5179:1: warning: no previous prototype for function 'lpfc_put_vmid_in_hashtable' [-Wmissing-prototypes]
   lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
   ^
   drivers/scsi/lpfc/lpfc_scsi.c:5178:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int
   ^
   static 
>> drivers/scsi/lpfc/lpfc_scsi.c:5233:6: warning: no previous prototype for function 'lpfc_vmid_update_entry' [-Wmissing-prototypes]
   void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
        ^
   drivers/scsi/lpfc/lpfc_scsi.c:5233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
   ^
   static 
>> drivers/scsi/lpfc/lpfc_scsi.c:5254:6: warning: no previous prototype for function 'lpfc_vmid_assign_cs_ctl' [-Wmissing-prototypes]
   void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
        ^
   drivers/scsi/lpfc/lpfc_scsi.c:5254:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
   ^
   static 
   In file included from drivers/scsi/lpfc/lpfc_scsi.c:31:
   In file included from include/linux/blk-cgroup.h:17:
   include/linux/cgroup.h:748:23: warning: unused function 'cgroup_get_from_id' [-Wunused-function]
   static struct cgroup *cgroup_get_from_id(u64 id)
                         ^
   4 warnings generated.


vim +/lpfc_put_vmid_in_hashtable +5179 drivers/scsi/lpfc/lpfc_scsi.c

  5168	
  5169	/*
  5170	 * lpfc_put_vmid_from_hastable - put the VMID in the hash table
  5171	 * @vport: The virtual port for which this call is being executed.
  5172	 * @hash - calculated hash value
  5173	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5174	 *
  5175	 * This routine will insert the newly acquired vmid entity in the hash table.
  5176	 * Make sure to acquire the appropriate lock before invoking this routine.
  5177	 */
  5178	int
> 5179	lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
  5180				   struct lpfc_vmid *vmp)
  5181	{
  5182		int count = 0;
  5183	
  5184		while (count < LPFC_VMID_HASH_SIZE) {
  5185			if (!vport->hash_table[hash]) {
  5186				vport->hash_table[hash] = vmp;
  5187				vmp->hash_index = hash;
  5188				return FAILURE;
  5189			}
  5190			/* if the slot is already occupied, a collision has occurred. */
  5191			/* Store in the next available slot */
  5192			count++;
  5193			hash++;
  5194			/* table is full */
  5195			if (hash == LPFC_VMID_HASH_SIZE)
  5196				hash = 0;
  5197		}
  5198		return 0;
  5199	}
  5200	
  5201	/*
  5202	 * lpfc_vmid_hash_fn- creates a hash value of the UUID
  5203	 * @uuid: uuid associated with the VE
  5204	 * @len: length of the UUID
  5205	 * Returns the calculated hash value
  5206	 */
  5207	int lpfc_vmid_hash_fn(char *vmid, int len)
  5208	{
  5209		int c;
  5210		int hash = 0;
  5211	
  5212		if (len == 0)
  5213			return 0;
  5214		while (len--) {
  5215			c = *vmid++;
  5216			if (c >= 'A' && c <= 'Z')
  5217				c += 'a' - 'A';
  5218	
  5219			hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
  5220				(c >> LPFC_VMID_HASH_SHIFT)) * 19;
  5221		}
  5222	
  5223		return hash & LPFC_VMID_HASH_MASK;
  5224	}
  5225	
  5226	/*
  5227	 * lpfc_vmid_update_entry - update the vmid entry in the hash table
  5228	 * @vport: The virtual port for which this call is being executed.
  5229	 * @cmd: address of scsi cmmd descriptor
  5230	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5231	 * @tag: VMID tag
  5232	 */
> 5233	void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
  5234					   *cmd, struct lpfc_vmid *vmp,
  5235					   union lpfc_vmid_io_tag *tag)
  5236	{
  5237		u64 *lta;
  5238	
  5239		if (vport->vmid_priority_tagging)
  5240			tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
  5241		else
  5242			tag->app_id = vmp->un.app_id;
  5243	
  5244		if (cmd->sc_data_direction == DMA_TO_DEVICE)
  5245			vmp->io_wr_cnt++;
  5246		else
  5247			vmp->io_rd_cnt++;
  5248	
  5249		/* update the last access timestamp in the table */
  5250		lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
  5251		*lta = jiffies;
  5252	}
  5253	
> 5254	void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
  5255	{
  5256		u32 hash;
  5257		struct lpfc_vmid *pvmid;
  5258	
  5259		if (vport->port_type == LPFC_PHYSICAL_PORT) {
  5260			vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5261		} else {
  5262			hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
  5263			pvmid =
  5264			    lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
  5265							vmid->host_vmid);
  5266			if (!pvmid)
  5267				vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
  5268			else
  5269				vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5270		}
  5271	}
  5272	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
@ 2020-12-19 20:20     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 20:20 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne,
	clang-built-linux, pbonzini

[-- Attachment #1: Type: text/plain, Size: 6853 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/8417ca99565475d5bf5493657fcf90922607f1b1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 8417ca99565475d5bf5493657fcf90922607f1b1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_scsi.c:5179:1: warning: no previous prototype for function 'lpfc_put_vmid_in_hashtable' [-Wmissing-prototypes]
   lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
   ^
   drivers/scsi/lpfc/lpfc_scsi.c:5178:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int
   ^
   static 
>> drivers/scsi/lpfc/lpfc_scsi.c:5233:6: warning: no previous prototype for function 'lpfc_vmid_update_entry' [-Wmissing-prototypes]
   void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
        ^
   drivers/scsi/lpfc/lpfc_scsi.c:5233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
   ^
   static 
>> drivers/scsi/lpfc/lpfc_scsi.c:5254:6: warning: no previous prototype for function 'lpfc_vmid_assign_cs_ctl' [-Wmissing-prototypes]
   void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
        ^
   drivers/scsi/lpfc/lpfc_scsi.c:5254:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
   ^
   static 
   In file included from drivers/scsi/lpfc/lpfc_scsi.c:31:
   In file included from include/linux/blk-cgroup.h:17:
   include/linux/cgroup.h:748:23: warning: unused function 'cgroup_get_from_id' [-Wunused-function]
   static struct cgroup *cgroup_get_from_id(u64 id)
                         ^
   4 warnings generated.


vim +/lpfc_put_vmid_in_hashtable +5179 drivers/scsi/lpfc/lpfc_scsi.c

  5168	
  5169	/*
  5170	 * lpfc_put_vmid_from_hastable - put the VMID in the hash table
  5171	 * @vport: The virtual port for which this call is being executed.
  5172	 * @hash - calculated hash value
  5173	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5174	 *
  5175	 * This routine will insert the newly acquired vmid entity in the hash table.
  5176	 * Make sure to acquire the appropriate lock before invoking this routine.
  5177	 */
  5178	int
> 5179	lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
  5180				   struct lpfc_vmid *vmp)
  5181	{
  5182		int count = 0;
  5183	
  5184		while (count < LPFC_VMID_HASH_SIZE) {
  5185			if (!vport->hash_table[hash]) {
  5186				vport->hash_table[hash] = vmp;
  5187				vmp->hash_index = hash;
  5188				return FAILURE;
  5189			}
  5190			/* if the slot is already occupied, a collision has occurred. */
  5191			/* Store in the next available slot */
  5192			count++;
  5193			hash++;
  5194			/* table is full */
  5195			if (hash == LPFC_VMID_HASH_SIZE)
  5196				hash = 0;
  5197		}
  5198		return 0;
  5199	}
  5200	
  5201	/*
  5202	 * lpfc_vmid_hash_fn- creates a hash value of the UUID
  5203	 * @uuid: uuid associated with the VE
  5204	 * @len: length of the UUID
  5205	 * Returns the calculated hash value
  5206	 */
  5207	int lpfc_vmid_hash_fn(char *vmid, int len)
  5208	{
  5209		int c;
  5210		int hash = 0;
  5211	
  5212		if (len == 0)
  5213			return 0;
  5214		while (len--) {
  5215			c = *vmid++;
  5216			if (c >= 'A' && c <= 'Z')
  5217				c += 'a' - 'A';
  5218	
  5219			hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
  5220				(c >> LPFC_VMID_HASH_SHIFT)) * 19;
  5221		}
  5222	
  5223		return hash & LPFC_VMID_HASH_MASK;
  5224	}
  5225	
  5226	/*
  5227	 * lpfc_vmid_update_entry - update the vmid entry in the hash table
  5228	 * @vport: The virtual port for which this call is being executed.
  5229	 * @cmd: address of scsi cmmd descriptor
  5230	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5231	 * @tag: VMID tag
  5232	 */
> 5233	void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
  5234					   *cmd, struct lpfc_vmid *vmp,
  5235					   union lpfc_vmid_io_tag *tag)
  5236	{
  5237		u64 *lta;
  5238	
  5239		if (vport->vmid_priority_tagging)
  5240			tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
  5241		else
  5242			tag->app_id = vmp->un.app_id;
  5243	
  5244		if (cmd->sc_data_direction == DMA_TO_DEVICE)
  5245			vmp->io_wr_cnt++;
  5246		else
  5247			vmp->io_rd_cnt++;
  5248	
  5249		/* update the last access timestamp in the table */
  5250		lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
  5251		*lta = jiffies;
  5252	}
  5253	
> 5254	void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
  5255	{
  5256		u32 hash;
  5257		struct lpfc_vmid *pvmid;
  5258	
  5259		if (vport->port_type == LPFC_PHYSICAL_PORT) {
  5260			vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5261		} else {
  5262			hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
  5263			pvmid =
  5264			    lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
  5265							vmid->host_vmid);
  5266			if (!pvmid)
  5267				vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
  5268			else
  5269				vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5270		}
  5271	}
  5272	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
@ 2020-12-19 20:20     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 20:20 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7027 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/8417ca99565475d5bf5493657fcf90922607f1b1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 8417ca99565475d5bf5493657fcf90922607f1b1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_scsi.c:5179:1: warning: no previous prototype for function 'lpfc_put_vmid_in_hashtable' [-Wmissing-prototypes]
   lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
   ^
   drivers/scsi/lpfc/lpfc_scsi.c:5178:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int
   ^
   static 
>> drivers/scsi/lpfc/lpfc_scsi.c:5233:6: warning: no previous prototype for function 'lpfc_vmid_update_entry' [-Wmissing-prototypes]
   void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
        ^
   drivers/scsi/lpfc/lpfc_scsi.c:5233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
   ^
   static 
>> drivers/scsi/lpfc/lpfc_scsi.c:5254:6: warning: no previous prototype for function 'lpfc_vmid_assign_cs_ctl' [-Wmissing-prototypes]
   void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
        ^
   drivers/scsi/lpfc/lpfc_scsi.c:5254:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
   ^
   static 
   In file included from drivers/scsi/lpfc/lpfc_scsi.c:31:
   In file included from include/linux/blk-cgroup.h:17:
   include/linux/cgroup.h:748:23: warning: unused function 'cgroup_get_from_id' [-Wunused-function]
   static struct cgroup *cgroup_get_from_id(u64 id)
                         ^
   4 warnings generated.


vim +/lpfc_put_vmid_in_hashtable +5179 drivers/scsi/lpfc/lpfc_scsi.c

  5168	
  5169	/*
  5170	 * lpfc_put_vmid_from_hastable - put the VMID in the hash table
  5171	 * @vport: The virtual port for which this call is being executed.
  5172	 * @hash - calculated hash value
  5173	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5174	 *
  5175	 * This routine will insert the newly acquired vmid entity in the hash table.
  5176	 * Make sure to acquire the appropriate lock before invoking this routine.
  5177	 */
  5178	int
> 5179	lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
  5180				   struct lpfc_vmid *vmp)
  5181	{
  5182		int count = 0;
  5183	
  5184		while (count < LPFC_VMID_HASH_SIZE) {
  5185			if (!vport->hash_table[hash]) {
  5186				vport->hash_table[hash] = vmp;
  5187				vmp->hash_index = hash;
  5188				return FAILURE;
  5189			}
  5190			/* if the slot is already occupied, a collision has occurred. */
  5191			/* Store in the next available slot */
  5192			count++;
  5193			hash++;
  5194			/* table is full */
  5195			if (hash == LPFC_VMID_HASH_SIZE)
  5196				hash = 0;
  5197		}
  5198		return 0;
  5199	}
  5200	
  5201	/*
  5202	 * lpfc_vmid_hash_fn- creates a hash value of the UUID
  5203	 * @uuid: uuid associated with the VE
  5204	 * @len: length of the UUID
  5205	 * Returns the calculated hash value
  5206	 */
  5207	int lpfc_vmid_hash_fn(char *vmid, int len)
  5208	{
  5209		int c;
  5210		int hash = 0;
  5211	
  5212		if (len == 0)
  5213			return 0;
  5214		while (len--) {
  5215			c = *vmid++;
  5216			if (c >= 'A' && c <= 'Z')
  5217				c += 'a' - 'A';
  5218	
  5219			hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
  5220				(c >> LPFC_VMID_HASH_SHIFT)) * 19;
  5221		}
  5222	
  5223		return hash & LPFC_VMID_HASH_MASK;
  5224	}
  5225	
  5226	/*
  5227	 * lpfc_vmid_update_entry - update the vmid entry in the hash table
  5228	 * @vport: The virtual port for which this call is being executed.
  5229	 * @cmd: address of scsi cmmd descriptor
  5230	 * @vmp: Pointer to a VMID entry representing a VM sending IO
  5231	 * @tag: VMID tag
  5232	 */
> 5233	void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
  5234					   *cmd, struct lpfc_vmid *vmp,
  5235					   union lpfc_vmid_io_tag *tag)
  5236	{
  5237		u64 *lta;
  5238	
  5239		if (vport->vmid_priority_tagging)
  5240			tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
  5241		else
  5242			tag->app_id = vmp->un.app_id;
  5243	
  5244		if (cmd->sc_data_direction == DMA_TO_DEVICE)
  5245			vmp->io_wr_cnt++;
  5246		else
  5247			vmp->io_rd_cnt++;
  5248	
  5249		/* update the last access timestamp in the table */
  5250		lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
  5251		*lta = jiffies;
  5252	}
  5253	
> 5254	void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
  5255	{
  5256		u32 hash;
  5257		struct lpfc_vmid *pvmid;
  5258	
  5259		if (vport->port_type == LPFC_PHYSICAL_PORT) {
  5260			vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5261		} else {
  5262			hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
  5263			pvmid =
  5264			    lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
  5265							vmid->host_vmid);
  5266			if (!pvmid)
  5267				vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
  5268			else
  5269				vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
  5270		}
  5271	}
  5272	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid.
  2020-12-16  5:29   ` Muneendra
  (?)
@ 2020-12-19 23:27     ` kernel test robot
  -1 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 23:27 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: kbuild-all, clang-built-linux, jsmart2021, emilne, mkumar,
	pbonzini, Gaurav Srivastava

[-- Attachment #1: Type: text/plain, Size: 5924 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_ct.c:3749:1: warning: no previous prototype for function 'lpfc_cmpl_ct_cmd_vmid' [-Wmissing-prototypes]
   lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
   ^
   drivers/scsi/lpfc/lpfc_ct.c:3748:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void
   ^
   static 
   1 warning generated.


vim +/lpfc_cmpl_ct_cmd_vmid +3749 drivers/scsi/lpfc/lpfc_ct.c

  3747	
  3748	void
> 3749	lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
  3750			      struct lpfc_iocbq *rspiocb)
  3751	{
  3752		struct lpfc_vport *vport = cmdiocb->vport;
  3753		struct lpfc_dmabuf *inp = cmdiocb->context1;
  3754		struct lpfc_dmabuf *outp = cmdiocb->context2;
  3755		struct lpfc_sli_ct_request *ctcmd = inp->virt;
  3756		struct lpfc_sli_ct_request *ctrsp = outp->virt;
  3757		u16 rsp = ctrsp->CommandResponse.bits.CmdRsp;
  3758		struct app_id_object *app;
  3759		u32 cmd, hash;
  3760		struct lpfc_vmid *vmp;
  3761		u8 *data = outp->virt;
  3762		int i;
  3763	
  3764		cmd = be16_to_cpu(ctcmd->CommandResponse.bits.CmdRsp);
  3765		if (cmd == SLI_CTAS_DALLAPP_ID)
  3766			lpfc_ct_free_iocb(phba, cmdiocb);
  3767	
  3768		if (lpfc_els_chk_latt(vport) || rspiocb->iocb.ulpStatus) {
  3769			if (cmd != SLI_CTAS_DALLAPP_ID)
  3770				return;
  3771		}
  3772		/* Check for a CT LS_RJT response */
  3773		if (rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
  3774			if (cmd != SLI_CTAS_DALLAPP_ID)
  3775				lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3776						 "3306 VMID FS_RJT Data: x%x  %x %x\n",
  3777					 cmd, ctrsp->ReasonCode, ctrsp->Explanation);
  3778			if ((cmd != SLI_CTAS_DALLAPP_ID) ||
  3779			    (ctrsp->ReasonCode != SLI_CT_UNABLE_TO_PERFORM_REQ) ||
  3780			    (ctrsp->Explanation != SLI_CT_APP_ID_NOT_AVAILABLE)) {
  3781				/* If DALLAPP_ID failed retry later */
  3782				if (cmd == SLI_CTAS_DALLAPP_ID)
  3783					vport->load_flag |= FC_DEREGISTER_ALL_APP_ID;
  3784				return;
  3785			}
  3786		}
  3787	
  3788		switch (cmd) {
  3789		case SLI_CTAS_RAPP_IDENT:
  3790			app = (struct app_id_object *)(RAPP_IDENT_OFFSET + data);
  3791			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3792					 "6712 RAPP_IDENT app id %d  port id %x id\n"
  3793					 "len %d\n", be32_to_cpu(app->app_id),
  3794					 be32_to_cpu(app->port_id),
  3795					 app->obj.entity_id_len);
  3796	
  3797			if (app->obj.entity_id_len == 0 || app->port_id == 0)
  3798				return;
  3799	
  3800			hash = lpfc_vmid_hash_fn(app->obj.entity_id,
  3801						 app->obj.entity_id_len);
  3802			vmp = lpfc_get_vmid_from_hastable(vport, hash,
  3803							  app->obj.entity_id);
  3804			if (vmp) {
  3805				vmp->un.app_id = be32_to_cpu(app->app_id);
  3806				vmp->flag |= LPFC_VMID_REGISTERED;
  3807				vmp->flag &= ~LPFC_VMID_REQ_REGISTER;
  3808				/* Set IN USE flag */
  3809				vport->vmid_flag |= LPFC_VMID_IN_USE;
  3810			} else {
  3811				lpfc_printf_vlog(vport, KERN_DEBUG,
  3812						 LOG_DISCOVERY, "6901 No entry found\n"
  3813						 "%s hash %d\n", app->obj.entity_id,
  3814						 hash);
  3815			}
  3816			break;
  3817		case SLI_CTAS_DAPP_IDENT:
  3818			app = (struct app_id_object *)(DAPP_IDENT_OFFSET + data);
  3819			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3820					 "6713 DAPP_IDENT app id %d  port id %x",
  3821					 cpu_to_be32(app->app_id),
  3822					 cpu_to_be32(app->port_id));
  3823			break;
  3824		case SLI_CTAS_DALLAPP_ID:
  3825			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3826					 "8856 Deregistered all app ids");
  3827			for (i = 0; i < phba->cfg_max_vmid; i++) {
  3828				vmp = &vport->vmid[i];
  3829				if (vmp->flag != LPFC_VMID_SLOT_FREE)
  3830					memset(vmp, 0, sizeof(struct lpfc_vmid));
  3831			}
  3832			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  3833				vport->hash_table[i] = NULL;
  3834			vport->load_flag |= FC_ALLOW_VMID;
  3835			break;
  3836		default:
  3837			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3838					 "8857 Invalid command code");
  3839		}
  3840	}
  3841	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid.
@ 2020-12-19 23:27     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 23:27 UTC (permalink / raw)
  To: Muneendra, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, kbuild-all, mkumar, Gaurav Srivastava, emilne,
	clang-built-linux, pbonzini

[-- Attachment #1: Type: text/plain, Size: 5924 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_ct.c:3749:1: warning: no previous prototype for function 'lpfc_cmpl_ct_cmd_vmid' [-Wmissing-prototypes]
   lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
   ^
   drivers/scsi/lpfc/lpfc_ct.c:3748:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void
   ^
   static 
   1 warning generated.


vim +/lpfc_cmpl_ct_cmd_vmid +3749 drivers/scsi/lpfc/lpfc_ct.c

  3747	
  3748	void
> 3749	lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
  3750			      struct lpfc_iocbq *rspiocb)
  3751	{
  3752		struct lpfc_vport *vport = cmdiocb->vport;
  3753		struct lpfc_dmabuf *inp = cmdiocb->context1;
  3754		struct lpfc_dmabuf *outp = cmdiocb->context2;
  3755		struct lpfc_sli_ct_request *ctcmd = inp->virt;
  3756		struct lpfc_sli_ct_request *ctrsp = outp->virt;
  3757		u16 rsp = ctrsp->CommandResponse.bits.CmdRsp;
  3758		struct app_id_object *app;
  3759		u32 cmd, hash;
  3760		struct lpfc_vmid *vmp;
  3761		u8 *data = outp->virt;
  3762		int i;
  3763	
  3764		cmd = be16_to_cpu(ctcmd->CommandResponse.bits.CmdRsp);
  3765		if (cmd == SLI_CTAS_DALLAPP_ID)
  3766			lpfc_ct_free_iocb(phba, cmdiocb);
  3767	
  3768		if (lpfc_els_chk_latt(vport) || rspiocb->iocb.ulpStatus) {
  3769			if (cmd != SLI_CTAS_DALLAPP_ID)
  3770				return;
  3771		}
  3772		/* Check for a CT LS_RJT response */
  3773		if (rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
  3774			if (cmd != SLI_CTAS_DALLAPP_ID)
  3775				lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3776						 "3306 VMID FS_RJT Data: x%x  %x %x\n",
  3777					 cmd, ctrsp->ReasonCode, ctrsp->Explanation);
  3778			if ((cmd != SLI_CTAS_DALLAPP_ID) ||
  3779			    (ctrsp->ReasonCode != SLI_CT_UNABLE_TO_PERFORM_REQ) ||
  3780			    (ctrsp->Explanation != SLI_CT_APP_ID_NOT_AVAILABLE)) {
  3781				/* If DALLAPP_ID failed retry later */
  3782				if (cmd == SLI_CTAS_DALLAPP_ID)
  3783					vport->load_flag |= FC_DEREGISTER_ALL_APP_ID;
  3784				return;
  3785			}
  3786		}
  3787	
  3788		switch (cmd) {
  3789		case SLI_CTAS_RAPP_IDENT:
  3790			app = (struct app_id_object *)(RAPP_IDENT_OFFSET + data);
  3791			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3792					 "6712 RAPP_IDENT app id %d  port id %x id\n"
  3793					 "len %d\n", be32_to_cpu(app->app_id),
  3794					 be32_to_cpu(app->port_id),
  3795					 app->obj.entity_id_len);
  3796	
  3797			if (app->obj.entity_id_len == 0 || app->port_id == 0)
  3798				return;
  3799	
  3800			hash = lpfc_vmid_hash_fn(app->obj.entity_id,
  3801						 app->obj.entity_id_len);
  3802			vmp = lpfc_get_vmid_from_hastable(vport, hash,
  3803							  app->obj.entity_id);
  3804			if (vmp) {
  3805				vmp->un.app_id = be32_to_cpu(app->app_id);
  3806				vmp->flag |= LPFC_VMID_REGISTERED;
  3807				vmp->flag &= ~LPFC_VMID_REQ_REGISTER;
  3808				/* Set IN USE flag */
  3809				vport->vmid_flag |= LPFC_VMID_IN_USE;
  3810			} else {
  3811				lpfc_printf_vlog(vport, KERN_DEBUG,
  3812						 LOG_DISCOVERY, "6901 No entry found\n"
  3813						 "%s hash %d\n", app->obj.entity_id,
  3814						 hash);
  3815			}
  3816			break;
  3817		case SLI_CTAS_DAPP_IDENT:
  3818			app = (struct app_id_object *)(DAPP_IDENT_OFFSET + data);
  3819			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3820					 "6713 DAPP_IDENT app id %d  port id %x",
  3821					 cpu_to_be32(app->app_id),
  3822					 cpu_to_be32(app->port_id));
  3823			break;
  3824		case SLI_CTAS_DALLAPP_ID:
  3825			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3826					 "8856 Deregistered all app ids");
  3827			for (i = 0; i < phba->cfg_max_vmid; i++) {
  3828				vmp = &vport->vmid[i];
  3829				if (vmp->flag != LPFC_VMID_SLOT_FREE)
  3830					memset(vmp, 0, sizeof(struct lpfc_vmid));
  3831			}
  3832			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  3833				vport->hash_table[i] = NULL;
  3834			vport->load_flag |= FC_ALLOW_VMID;
  3835			break;
  3836		default:
  3837			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3838					 "8857 Invalid command code");
  3839		}
  3840	}
  3841	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid.
@ 2020-12-19 23:27     ` kernel test robot
  0 siblings, 0 replies; 73+ messages in thread
From: kernel test robot @ 2020-12-19 23:27 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6069 bytes --]

Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 2c2a03c1111ef8a2c5aac440b227390d40d1e2cb
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/lpfc/lpfc_ct.c:3749:1: warning: no previous prototype for function 'lpfc_cmpl_ct_cmd_vmid' [-Wmissing-prototypes]
   lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
   ^
   drivers/scsi/lpfc/lpfc_ct.c:3748:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void
   ^
   static 
   1 warning generated.


vim +/lpfc_cmpl_ct_cmd_vmid +3749 drivers/scsi/lpfc/lpfc_ct.c

  3747	
  3748	void
> 3749	lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
  3750			      struct lpfc_iocbq *rspiocb)
  3751	{
  3752		struct lpfc_vport *vport = cmdiocb->vport;
  3753		struct lpfc_dmabuf *inp = cmdiocb->context1;
  3754		struct lpfc_dmabuf *outp = cmdiocb->context2;
  3755		struct lpfc_sli_ct_request *ctcmd = inp->virt;
  3756		struct lpfc_sli_ct_request *ctrsp = outp->virt;
  3757		u16 rsp = ctrsp->CommandResponse.bits.CmdRsp;
  3758		struct app_id_object *app;
  3759		u32 cmd, hash;
  3760		struct lpfc_vmid *vmp;
  3761		u8 *data = outp->virt;
  3762		int i;
  3763	
  3764		cmd = be16_to_cpu(ctcmd->CommandResponse.bits.CmdRsp);
  3765		if (cmd == SLI_CTAS_DALLAPP_ID)
  3766			lpfc_ct_free_iocb(phba, cmdiocb);
  3767	
  3768		if (lpfc_els_chk_latt(vport) || rspiocb->iocb.ulpStatus) {
  3769			if (cmd != SLI_CTAS_DALLAPP_ID)
  3770				return;
  3771		}
  3772		/* Check for a CT LS_RJT response */
  3773		if (rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
  3774			if (cmd != SLI_CTAS_DALLAPP_ID)
  3775				lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3776						 "3306 VMID FS_RJT Data: x%x  %x %x\n",
  3777					 cmd, ctrsp->ReasonCode, ctrsp->Explanation);
  3778			if ((cmd != SLI_CTAS_DALLAPP_ID) ||
  3779			    (ctrsp->ReasonCode != SLI_CT_UNABLE_TO_PERFORM_REQ) ||
  3780			    (ctrsp->Explanation != SLI_CT_APP_ID_NOT_AVAILABLE)) {
  3781				/* If DALLAPP_ID failed retry later */
  3782				if (cmd == SLI_CTAS_DALLAPP_ID)
  3783					vport->load_flag |= FC_DEREGISTER_ALL_APP_ID;
  3784				return;
  3785			}
  3786		}
  3787	
  3788		switch (cmd) {
  3789		case SLI_CTAS_RAPP_IDENT:
  3790			app = (struct app_id_object *)(RAPP_IDENT_OFFSET + data);
  3791			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3792					 "6712 RAPP_IDENT app id %d  port id %x id\n"
  3793					 "len %d\n", be32_to_cpu(app->app_id),
  3794					 be32_to_cpu(app->port_id),
  3795					 app->obj.entity_id_len);
  3796	
  3797			if (app->obj.entity_id_len == 0 || app->port_id == 0)
  3798				return;
  3799	
  3800			hash = lpfc_vmid_hash_fn(app->obj.entity_id,
  3801						 app->obj.entity_id_len);
  3802			vmp = lpfc_get_vmid_from_hastable(vport, hash,
  3803							  app->obj.entity_id);
  3804			if (vmp) {
  3805				vmp->un.app_id = be32_to_cpu(app->app_id);
  3806				vmp->flag |= LPFC_VMID_REGISTERED;
  3807				vmp->flag &= ~LPFC_VMID_REQ_REGISTER;
  3808				/* Set IN USE flag */
  3809				vport->vmid_flag |= LPFC_VMID_IN_USE;
  3810			} else {
  3811				lpfc_printf_vlog(vport, KERN_DEBUG,
  3812						 LOG_DISCOVERY, "6901 No entry found\n"
  3813						 "%s hash %d\n", app->obj.entity_id,
  3814						 hash);
  3815			}
  3816			break;
  3817		case SLI_CTAS_DAPP_IDENT:
  3818			app = (struct app_id_object *)(DAPP_IDENT_OFFSET + data);
  3819			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3820					 "6713 DAPP_IDENT app id %d  port id %x",
  3821					 cpu_to_be32(app->app_id),
  3822					 cpu_to_be32(app->port_id));
  3823			break;
  3824		case SLI_CTAS_DALLAPP_ID:
  3825			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3826					 "8856 Deregistered all app ids");
  3827			for (i = 0; i < phba->cfg_max_vmid; i++) {
  3828				vmp = &vport->vmid[i];
  3829				if (vmp->flag != LPFC_VMID_SLOT_FREE)
  3830					memset(vmp, 0, sizeof(struct lpfc_vmid));
  3831			}
  3832			for (i = 0; i < LPFC_VMID_HASH_SIZE; i++)
  3833				vport->hash_table[i] = NULL;
  3834			vport->load_flag |= FC_ALLOW_VMID;
  3835			break;
  3836		default:
  3837			lpfc_printf_vlog(vport, KERN_DEBUG, LOG_DISCOVERY,
  3838					 "8857 Invalid command code");
  3839		}
  3840	}
  3841	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31312 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH v5 02/16] blkcg: Added a app identifier support for blkcg
  2020-12-19 17:12     ` Randy Dunlap
@ 2020-12-22  6:02       ` Muneendra Kumar M
  -1 siblings, 0 replies; 73+ messages in thread
From: Muneendra Kumar M @ 2020-12-22  6:02 UTC (permalink / raw)
  To: Randy Dunlap, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: jsmart2021, emilne, mkumar, pbonzini

[-- Attachment #1: Type: text/plain, Size: 2592 bytes --]

Hi Randy,
Thanks for your comments.
I will incorporate your comments in my next version.

Regards,
Muneendra.

-----Original Message-----
From: Randy Dunlap [mailto:rdunlap@infradead.org]
Sent: Saturday, December 19, 2020 10:42 PM
To: Muneendra <muneendra.kumar@broadcom.com>; linux-block@vger.kernel.org;
linux-scsi@vger.kernel.org; tj@kernel.org; linux-nvme@lists.infradead.org;
hare@suse.de
Cc: jsmart2021@gmail.com; emilne@redhat.com; mkumar@redhat.com;
pbonzini@redhat.com
Subject: Re: [PATCH v5 02/16] blkcg: Added a app identifier support for
blkcg

On 12/15/20 9:29 PM, Muneendra wrote:

Hi--

> ---
>  block/Kconfig              |  9 ++++++
>  include/linux/blk-cgroup.h | 56
> ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 65 insertions(+)
>
> diff --git a/block/Kconfig b/block/Kconfig index
> a2297edfdde8..1920388fb0e9 100644
> --- a/block/Kconfig
> +++ b/block/Kconfig
> @@ -144,6 +144,15 @@ config BLK_CGROUP_IOLATENCY
>
>  	Note, this is an experimental interface and could be changed
someday.
>
> +config BLK_CGROUP_FC_APPID
> +	bool "Enable support to track FC io Traffic across cgroup
applications"
> +	depends on BLK_CGROUP=y
> +	help
> +	Enabling this option enables the support to track FC io traffic
across
> +	cgroup applications.It enables the Fabric and the storage targets
to
> +	identify, monitor, and handle FC traffic based on vm tags by
inserting
> +	application specific identification into the FC frame.

Please follow coding-style for Kconfig files:

from Documentation/process/coding-style.rst, section 10):

For all of the Kconfig* configuration files throughout the source tree,
the indentation is somewhat different.  Lines under a ``config``
definition are indented with one tab, while help text is indented an
additional two spaces.


thanks.
--
~Randy

-- 
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: 4177 bytes --]

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH v5 02/16] blkcg: Added a app identifier support for blkcg
@ 2020-12-22  6:02       ` Muneendra Kumar M
  0 siblings, 0 replies; 73+ messages in thread
From: Muneendra Kumar M @ 2020-12-22  6:02 UTC (permalink / raw)
  To: Randy Dunlap, linux-block, linux-scsi, tj, linux-nvme, hare
  Cc: pbonzini, jsmart2021, mkumar, emilne


[-- Attachment #1.1: Type: text/plain, Size: 2592 bytes --]

Hi Randy,
Thanks for your comments.
I will incorporate your comments in my next version.

Regards,
Muneendra.

-----Original Message-----
From: Randy Dunlap [mailto:rdunlap@infradead.org]
Sent: Saturday, December 19, 2020 10:42 PM
To: Muneendra <muneendra.kumar@broadcom.com>; linux-block@vger.kernel.org;
linux-scsi@vger.kernel.org; tj@kernel.org; linux-nvme@lists.infradead.org;
hare@suse.de
Cc: jsmart2021@gmail.com; emilne@redhat.com; mkumar@redhat.com;
pbonzini@redhat.com
Subject: Re: [PATCH v5 02/16] blkcg: Added a app identifier support for
blkcg

On 12/15/20 9:29 PM, Muneendra wrote:

Hi--

> ---
>  block/Kconfig              |  9 ++++++
>  include/linux/blk-cgroup.h | 56
> ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 65 insertions(+)
>
> diff --git a/block/Kconfig b/block/Kconfig index
> a2297edfdde8..1920388fb0e9 100644
> --- a/block/Kconfig
> +++ b/block/Kconfig
> @@ -144,6 +144,15 @@ config BLK_CGROUP_IOLATENCY
>
>  	Note, this is an experimental interface and could be changed
someday.
>
> +config BLK_CGROUP_FC_APPID
> +	bool "Enable support to track FC io Traffic across cgroup
applications"
> +	depends on BLK_CGROUP=y
> +	help
> +	Enabling this option enables the support to track FC io traffic
across
> +	cgroup applications.It enables the Fabric and the storage targets
to
> +	identify, monitor, and handle FC traffic based on vm tags by
inserting
> +	application specific identification into the FC frame.

Please follow coding-style for Kconfig files:

from Documentation/process/coding-style.rst, section 10):

For all of the Kconfig* configuration files throughout the source tree,
the indentation is somewhat different.  Lines under a ``config``
definition are indented with one tab, while help text is indented an
additional two spaces.


thanks.
--
~Randy

-- 
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 #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 73+ messages in thread

end of thread, other threads:[~2020-12-22  6:03 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16  5:29 [PATCH v5 00/16] blkcg:Support to track FC storage blk io traffic Muneendra
2020-12-16  5:29 ` Muneendra
2020-12-16  5:29 ` [PATCH v5 01/16] cgroup: Added cgroup_get_from_id Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29 ` [PATCH v5 02/16] blkcg: Added a app identifier support for blkcg Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-19 17:12   ` Randy Dunlap
2020-12-19 17:12     ` Randy Dunlap
2020-12-22  6:02     ` Muneendra Kumar M
2020-12-22  6:02       ` Muneendra Kumar M
2020-12-16  5:29 ` [PATCH v5 03/16] nvme: Added a newsysfs attribute appid_store Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29 ` [PATCH v5 04/16] lpfc: vmid: Add the datastructure for supporting VMID in lpfc Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29 ` [PATCH v5 05/16] lpfc: vmid: Supplementary data structures for vmid and APIs Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29 ` [PATCH v5 06/16] lpfc: vmid: Forward declarations for APIs Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29 ` [PATCH v5 07/16] lpfc: vmid: VMID params initialization Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29 ` [PATCH v5 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16 15:13   ` kernel test robot
2020-12-16 15:13     ` kernel test robot
2020-12-16 15:13     ` kernel test robot
2020-12-19 15:58   ` kernel test robot
2020-12-19 15:58     ` kernel test robot
2020-12-19 15:58     ` kernel test robot
2020-12-16  5:29 ` [PATCH v5 09/16] lpfc: vmid: Implements ELS commands for appid patch Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16 15:47   ` kernel test robot
2020-12-16 15:47     ` kernel test robot
2020-12-16 15:47     ` kernel test robot
2020-12-19 18:04   ` kernel test robot
2020-12-19 18:04     ` kernel test robot
2020-12-19 18:04     ` kernel test robot
2020-12-16  5:29 ` [PATCH v5 10/16] lpfc: vmid: Functions to manage vmids Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16 16:23   ` kernel test robot
2020-12-16 16:23     ` kernel test robot
2020-12-16 16:23     ` kernel test robot
2020-12-19 20:20   ` kernel test robot
2020-12-19 20:20     ` kernel test robot
2020-12-19 20:20     ` kernel test robot
2020-12-16  5:29 ` [PATCH v5 11/16] lpfc: vmid: Implements CT commands for appid Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16 16:57   ` kernel test robot
2020-12-16 16:57     ` kernel test robot
2020-12-16 16:57     ` kernel test robot
2020-12-19 23:27   ` kernel test robot
2020-12-19 23:27     ` kernel test robot
2020-12-19 23:27     ` kernel test robot
2020-12-16  5:29 ` [PATCH v5 12/16] lpfc: vmid: Appends the vmid in the wqe before sending Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29 ` [PATCH v5 13/16] lpfc: vmid: Timeout implementation for vmid Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16 17:51   ` kernel test robot
2020-12-16 17:51     ` kernel test robot
2020-12-16 17:51     ` kernel test robot
2020-12-16  5:29 ` [PATCH v5 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16 18:31   ` kernel test robot
2020-12-16 18:31     ` kernel test robot
2020-12-16 18:31     ` kernel test robot
2020-12-16  5:29 ` [PATCH v5 15/16] lpfc: vmid: Introducing vmid in io path Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-16  5:29 ` [PATCH v5 16/16] scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID Muneendra
2020-12-16  5:29   ` Muneendra
2020-12-19 17:15   ` Randy Dunlap
2020-12-19 17:15     ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.