diff mbox series

[v2,01/13] scsi: fnic: Modify definitions to sync with VIC firmware

Message ID 20231027180302.418676-2-kartilak@cisco.com
State Superseded
Headers show
Series Introduce support for multiqueue (MQ) in fnic | expand

Commit Message

Karan Tilak Kumar (kartilak) Oct. 27, 2023, 6:02 p.m. UTC
VIC firmware has updated definitions.
Modify structure and definitions to sync with the latest VIC firmware.

Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
---
 drivers/scsi/fnic/vnic_scsi.h | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Comments

Hannes Reinecke Nov. 2, 2023, 7:23 a.m. UTC | #1
On 10/27/23 20:02, Karan Tilak Kumar wrote:
> VIC firmware has updated definitions.
> Modify structure and definitions to sync with the latest VIC firmware.
> 
> Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
> ---
>   drivers/scsi/fnic/vnic_scsi.h | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/vnic_scsi.h b/drivers/scsi/fnic/vnic_scsi.h
> index 4e12f7b32d9d..f715f7942bfe 100644
> --- a/drivers/scsi/fnic/vnic_scsi.h
> +++ b/drivers/scsi/fnic/vnic_scsi.h
> @@ -26,7 +26,7 @@
>   #define VNIC_FNIC_RATOV_MAX                 255000
>   
>   #define VNIC_FNIC_MAXDATAFIELDSIZE_MIN      256
> -#define VNIC_FNIC_MAXDATAFIELDSIZE_MAX      2112
> +#define VNIC_FNIC_MAXDATAFIELDSIZE_MAX      2048
>   
>   #define VNIC_FNIC_FLOGI_RETRIES_MIN         0
>   #define VNIC_FNIC_FLOGI_RETRIES_MAX         0xffffffff
> @@ -55,7 +55,7 @@
>   #define VNIC_FNIC_PORT_DOWN_IO_RETRIES_MAX  255
>   
>   #define VNIC_FNIC_LUNS_PER_TARGET_MIN       1
> -#define VNIC_FNIC_LUNS_PER_TARGET_MAX       1024
> +#define VNIC_FNIC_LUNS_PER_TARGET_MAX       4096
>   
>   /* Device-specific region: scsi configuration */
>   struct vnic_fc_config {
> @@ -79,10 +79,19 @@ struct vnic_fc_config {
>   	u16 ra_tov;
>   	u16 intr_timer;
>   	u8 intr_timer_type;
> +	u8 intr_mode;
> +	u8 lun_queue_depth;
> +	u8 io_timeout_retry;
> +	u16 wq_copy_count;
>   };
>   
>   #define VFCF_FCP_SEQ_LVL_ERR	0x1	/* Enable FCP-2 Error Recovery */
>   #define VFCF_PERBI		0x2	/* persistent binding info available */
>   #define VFCF_FIP_CAPABLE	0x4	/* firmware can handle FIP */
>   
> +#define VFCF_FC_INITIATOR         0x20    /* FC Initiator Mode */
> +#define VFCF_FC_TARGET            0x40    /* FC Target Mode */
> +#define VFCF_FC_NVME_INITIATOR    0x80    /* FC-NVMe Initiator Mode */
> +#define VFCF_FC_NVME_TARGET       0x100   /* FC-NVMe Target Mode */
> +
>   #endif /* _VNIC_SCSI_H_ */

I would have thought that you may want to check for the firmware version 
here; updating some limits with no check for the version will mean the 
driver might fail on older firmware, no?

But this is arguably not part of this patch, so:

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Karan Tilak Kumar (kartilak) Nov. 6, 2023, 7:47 p.m. UTC | #2
On Thursday, November 2, 2023 12:24 AM, Hannes Reinecke <hare@suse.de> wrote:
>
>I would have thought that you may want to check for the firmware version here; updating some limits with no check for the version will mean the driver might fail on older firmware, no?
>
>But this is arguably not part of this patch, so:
>
>Reviewed-by: Hannes Reinecke <hare@suse.de>
>

Thanks for your review and review comments, Hannes. 
Support for these limits has been in firmware for a long time. We are adding support in driver only now.

Regards,
Karan
diff mbox series

Patch

diff --git a/drivers/scsi/fnic/vnic_scsi.h b/drivers/scsi/fnic/vnic_scsi.h
index 4e12f7b32d9d..f715f7942bfe 100644
--- a/drivers/scsi/fnic/vnic_scsi.h
+++ b/drivers/scsi/fnic/vnic_scsi.h
@@ -26,7 +26,7 @@ 
 #define VNIC_FNIC_RATOV_MAX                 255000
 
 #define VNIC_FNIC_MAXDATAFIELDSIZE_MIN      256
-#define VNIC_FNIC_MAXDATAFIELDSIZE_MAX      2112
+#define VNIC_FNIC_MAXDATAFIELDSIZE_MAX      2048
 
 #define VNIC_FNIC_FLOGI_RETRIES_MIN         0
 #define VNIC_FNIC_FLOGI_RETRIES_MAX         0xffffffff
@@ -55,7 +55,7 @@ 
 #define VNIC_FNIC_PORT_DOWN_IO_RETRIES_MAX  255
 
 #define VNIC_FNIC_LUNS_PER_TARGET_MIN       1
-#define VNIC_FNIC_LUNS_PER_TARGET_MAX       1024
+#define VNIC_FNIC_LUNS_PER_TARGET_MAX       4096
 
 /* Device-specific region: scsi configuration */
 struct vnic_fc_config {
@@ -79,10 +79,19 @@  struct vnic_fc_config {
 	u16 ra_tov;
 	u16 intr_timer;
 	u8 intr_timer_type;
+	u8 intr_mode;
+	u8 lun_queue_depth;
+	u8 io_timeout_retry;
+	u16 wq_copy_count;
 };
 
 #define VFCF_FCP_SEQ_LVL_ERR	0x1	/* Enable FCP-2 Error Recovery */
 #define VFCF_PERBI		0x2	/* persistent binding info available */
 #define VFCF_FIP_CAPABLE	0x4	/* firmware can handle FIP */
 
+#define VFCF_FC_INITIATOR         0x20    /* FC Initiator Mode */
+#define VFCF_FC_TARGET            0x40    /* FC Target Mode */
+#define VFCF_FC_NVME_INITIATOR    0x80    /* FC-NVMe Initiator Mode */
+#define VFCF_FC_NVME_TARGET       0x100   /* FC-NVMe Target Mode */
+
 #endif /* _VNIC_SCSI_H_ */