From: Hannes Reinecke <hare@suse.de>
To: James Smart <jsmart2021@gmail.com>, linux-scsi@vger.kernel.org
Cc: maier@linux.ibm.com, dwagner@suse.de, bvanassche@acm.org,
Ram Vegesna <ram.vegesna@broadcom.com>
Subject: Re: [PATCH v2 03/32] elx: libefc_sli: Data structures and defines for mbox commands
Date: Wed, 8 Jan 2020 08:32:30 +0100 [thread overview]
Message-ID: <479ac7f4-80ac-babe-7aa6-aa91e257ec8f@suse.de> (raw)
In-Reply-To: <20191220223723.26563-4-jsmart2021@gmail.com>
On 12/20/19 11:36 PM, James Smart wrote:
> This patch continues the libefc_sli SLI-4 library population.
>
> This patch adds definitions for SLI-4 mailbox commands
> and responses.
>
> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
> drivers/scsi/elx/libefc_sli/sli4.h | 1728 +++++++++++++++++++++++++++++++++++-
> 1 file changed, 1727 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/elx/libefc_sli/sli4.h b/drivers/scsi/elx/libefc_sli/sli4.h
> index f86a9e72ed43..c9bd3f71b27b 100644
> --- a/drivers/scsi/elx/libefc_sli/sli4.h
> +++ b/drivers/scsi/elx/libefc_sli/sli4.h
> @@ -1995,7 +1995,7 @@ struct sli4_fc_xri_aborted_cqe {
> #define SLI4_ELS_REQUEST64_DIR_READ 0x1
>
> #define SLI4_ELS_REQUEST64_OTHER 0x0
> -#define SLI4_ELS_REQUEST64_LOGO 0x1
> +#define SLI4_ELS_REQUEST64_LOGO 0x1
> #define SLI4_ELS_REQUEST64_FDISC 0x2
> #define SLI4_ELS_REQUEST64_FLOGIN 0x3
> #define SLI4_ELS_REQUEST64_PLOGI 0x4
Shouldn't this rather be merged with the previous patch?
> @@ -2004,4 +2004,1730 @@ struct sli4_fc_xri_aborted_cqe {
> #define SLI4_ELS_REQUEST64_CMD_NON_FABRIC 0x0c
> #define SLI4_ELS_REQUEST64_CMD_FABRIC 0x0d
>
> +#define SLI_PAGE_SIZE (1 << 12) /* 4096 */
> +#define SLI_SUB_PAGE_MASK (SLI_PAGE_SIZE - 1)
> +#define SLI_ROUND_PAGE(b) (((b) + SLI_SUB_PAGE_MASK) & ~SLI_SUB_PAGE_MASK)
> +
> +#define SLI4_BMBX_TIMEOUT_MSEC 30000
> +#define SLI4_FW_READY_TIMEOUT_MSEC 30000
> +
> +#define SLI4_BMBX_DELAY_US 1000 /* 1 ms */
> +#define SLI4_INIT_PORT_DELAY_US 10000 /* 10 ms */
> +
> +static inline u32
> +sli_page_count(size_t bytes, u32 page_size)
> +{
> + if (!page_size)
> + return 0;
> +
> + return (bytes + (page_size - 1)) >> __ffs(page_size);
> +}
> +
> +/*************************************************************************
> + * SLI-4 mailbox command formats and definitions
> + */
> +
> +struct sli4_mbox_command_header {
> + u8 resvd0;
> + u8 command;
> + __le16 status; /* Port writes to indicate success/fail */
> +};
> +
> +enum {
> + MBX_CMD_CONFIG_LINK = 0x07,
> + MBX_CMD_DUMP = 0x17,
> + MBX_CMD_DOWN_LINK = 0x06,
> + MBX_CMD_INIT_LINK = 0x05,
> + MBX_CMD_INIT_VFI = 0xa3,
> + MBX_CMD_INIT_VPI = 0xa4,
> + MBX_CMD_POST_XRI = 0xa7,
> + MBX_CMD_RELEASE_XRI = 0xac,
> + MBX_CMD_READ_CONFIG = 0x0b,
> + MBX_CMD_READ_STATUS = 0x0e,
> + MBX_CMD_READ_NVPARMS = 0x02,
> + MBX_CMD_READ_REV = 0x11,
> + MBX_CMD_READ_LNK_STAT = 0x12,
> + MBX_CMD_READ_SPARM64 = 0x8d,
> + MBX_CMD_READ_TOPOLOGY = 0x95,
> + MBX_CMD_REG_FCFI = 0xa0,
> + MBX_CMD_REG_FCFI_MRQ = 0xaf,
> + MBX_CMD_REG_RPI = 0x93,
> + MBX_CMD_REG_RX_RQ = 0xa6,
> + MBX_CMD_REG_VFI = 0x9f,
> + MBX_CMD_REG_VPI = 0x96,
> + MBX_CMD_RQST_FEATURES = 0x9d,
> + MBX_CMD_SLI_CONFIG = 0x9b,
> + MBX_CMD_UNREG_FCFI = 0xa2,
> + MBX_CMD_UNREG_RPI = 0x14,
> + MBX_CMD_UNREG_VFI = 0xa1,
> + MBX_CMD_UNREG_VPI = 0x97,
> + MBX_CMD_WRITE_NVPARMS = 0x03,
> + MBX_CMD_CFG_AUTO_XFER_RDY = 0xAD,
> +
> + MBX_STATUS_SUCCESS = 0x0000,
> + MBX_STATUS_FAILURE = 0x0001,
> + MBX_STATUS_RPI_NOT_REG = 0x1400,
> +};
> +
Make this two enums, one 'enum sli4_mbx_cmd' and one 'enum sli4_mbx_status'.
> +/* CONFIG_LINK */
> +enum {
> + SLI4_CFG_LINK_BBSCN = 0xf00,
> + SLI4_CFG_LINK_CSCN = 0x1000,
> +};
> +
> +struct sli4_cmd_config_link {
> + struct sli4_mbox_command_header hdr;
> + u8 maxbbc;
> + u8 rsvd5;
> + u8 rsvd6;
> + u8 rsvd7;
> + u8 alpa;
> + __le16 n_port_id;
> + u8 rsvd11;
> + __le32 rsvd12;
> + __le32 e_d_tov;
> + __le32 lp_tov;
> + __le32 r_a_tov;
> + __le32 r_t_tov;
> + __le32 al_tov;
> + __le32 rsvd36;
> + __le32 bbscn_dword;
> +};
> +
> +enum {
> + SLI4_DUMP4_TYPE = 0xf,
> +};
Single enum should rather be converted into a #define ..
> +
> +#define SLI4_WKI_TAG_SAT_TEM 0x1040
> +
> +struct sli4_cmd_dump4 {
> + struct sli4_mbox_command_header hdr;
> + __le32 type_dword;
> + __le16 wki_selection;
> + __le16 rsvd10;
> + __le32 rsvd12;
> + __le32 returned_byte_cnt;
> + __le32 resp_data[59];
> +};
> +
> +/* INIT_LINK - initialize the link for a FC port */
> +#define FC_TOPOLOGY_FCAL 0
> +#define FC_TOPOLOGY_P2P 1
> +
> +#define SLI4_INIT_LINK_F_LOOP_BACK (1 << 0)
> +#define SLI4_INIT_LINK_F_UNFAIR (1 << 6)
> +#define SLI4_INIT_LINK_F_NO_LIRP (1 << 7)
> +#define SLI4_INIT_LINK_F_LOOP_VALID_CHK (1 << 8)
> +#define SLI4_INIT_LINK_F_NO_LISA (1 << 9)
> +#define SLI4_INIT_LINK_F_FAIL_OVER (1 << 10)
> +#define SLI4_INIT_LINK_F_NO_AUTOSPEED (1 << 11)
> +#define SLI4_INIT_LINK_F_PICK_HI_ALPA (1 << 15)
> +
> +#define SLI4_INIT_LINK_F_P2P_ONLY 1
> +#define SLI4_INIT_LINK_F_FCAL_ONLY 2
> +
> +#define SLI4_INIT_LINK_F_FCAL_FAIL_OVER 0
> +#define SLI4_INIT_LINK_F_P2P_FAIL_OVER 1
> +
> +enum {
> + SLI4_INIT_LINK_SEL_RESET_AL_PA = 0xff,
> + SLI4_INIT_LINK_FLAG_LOOPBACK = 0x1,
> + SLI4_INIT_LINK_FLAG_TOPOLOGY = 0x6,
> + SLI4_INIT_LINK_FLAG_UNFAIR = 0x40,
> + SLI4_INIT_LINK_FLAG_SKIP_LIRP_LILP = 0x80,
> + SLI4_INIT_LINK_FLAG_LOOP_VALIDITY = 0x100,
> + SLI4_INIT_LINK_FLAG_SKIP_LISA = 0x200,
> + SLI4_INIT_LINK_FLAG_EN_TOPO_FAILOVER = 0x400,
> + SLI4_INIT_LINK_FLAG_FIXED_SPEED = 0x800,
> + SLI4_INIT_LINK_FLAG_SEL_HIGHTEST_AL_PA = 0x8000,
> +};
> +
Why is this an enum, and the above SLI4_INIT_LINK_F_XXX value are defines?
Please be consistent.
And this applies throughout the remainder of the patch.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
next prev parent reply other threads:[~2020-01-08 7:32 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-20 22:36 [PATCH v2 00/32] [NEW] efct: Broadcom (Emulex) FC Target driver James Smart
2019-12-20 22:36 ` [PATCH v2 01/32] elx: libefc_sli: SLI-4 register offsets and field definitions James Smart
2020-01-08 7:11 ` Hannes Reinecke
2020-01-09 0:59 ` James Smart
2019-12-20 22:36 ` [PATCH v2 02/32] elx: libefc_sli: SLI Descriptors and Queue entries James Smart
2020-01-08 7:24 ` Hannes Reinecke
2020-01-09 1:00 ` James Smart
2019-12-20 22:36 ` [PATCH v2 03/32] elx: libefc_sli: Data structures and defines for mbox commands James Smart
2020-01-08 7:32 ` Hannes Reinecke [this message]
2020-01-09 1:03 ` James Smart
2019-12-20 22:36 ` [PATCH v2 04/32] elx: libefc_sli: queue create/destroy/parse routines James Smart
2020-01-08 7:45 ` Hannes Reinecke
2020-01-09 1:04 ` James Smart
2019-12-20 22:36 ` [PATCH v2 05/32] elx: libefc_sli: Populate and post different WQEs James Smart
2020-01-08 7:54 ` Hannes Reinecke
2020-01-09 1:04 ` James Smart
2019-12-20 22:36 ` [PATCH v2 06/32] elx: libefc_sli: bmbx routines and SLI config commands James Smart
2020-01-08 8:05 ` Hannes Reinecke
2019-12-20 22:36 ` [PATCH v2 07/32] elx: libefc_sli: APIs to setup SLI library James Smart
2020-01-08 8:22 ` Hannes Reinecke
2020-01-09 1:29 ` James Smart
2019-12-20 22:36 ` [PATCH v2 08/32] elx: libefc: Generic state machine framework James Smart
2020-01-09 7:05 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 09/32] elx: libefc: Emulex FC discovery library APIs and definitions James Smart
2020-01-09 7:16 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 10/32] elx: libefc: FC Domain state machine interfaces James Smart
2020-01-09 7:27 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 11/32] elx: libefc: SLI and FC PORT " James Smart
2020-01-09 7:34 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 12/32] elx: libefc: Remote node " James Smart
2020-01-09 8:31 ` Hannes Reinecke
2020-01-09 9:57 ` Daniel Wagner
2019-12-20 22:37 ` [PATCH v2 13/32] elx: libefc: Fabric " James Smart
2020-01-09 8:34 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 14/32] elx: libefc: FC node ELS and state handling James Smart
2020-01-09 8:39 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 15/32] elx: efct: Data structures and defines for hw operations James Smart
2020-01-09 8:41 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 16/32] elx: efct: Driver initialization routines James Smart
2020-01-09 9:01 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 17/32] elx: efct: Hardware queues creation and deletion James Smart
2020-01-09 9:10 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 18/32] elx: efct: RQ buffer, memory pool allocation and deallocation APIs James Smart
2020-01-09 9:13 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 19/32] elx: efct: Hardware IO and SGL initialization James Smart
2020-01-09 9:22 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 20/32] elx: efct: Hardware queues processing James Smart
2020-01-09 9:24 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 21/32] elx: efct: Unsolicited FC frame processing routines James Smart
2020-01-09 9:26 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 22/32] elx: efct: Extended link Service IO handling James Smart
2020-01-09 9:38 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 23/32] elx: efct: SCSI IO handling routines James Smart
2020-01-09 9:41 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 24/32] elx: efct: LIO backend interface routines James Smart
2020-01-09 3:56 ` Bart Van Assche
2019-12-20 22:37 ` [PATCH v2 25/32] elx: efct: Hardware IO submission routines James Smart
2020-01-09 9:52 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 26/32] elx: efct: link statistics and SFP data James Smart
2020-01-09 10:12 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 27/32] elx: efct: xport and hardware teardown routines James Smart
2020-01-09 10:14 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 28/32] elx: efct: IO timeout handling routines James Smart
2020-01-09 11:27 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 29/32] elx: efct: Firmware update, async link processing James Smart
2020-01-09 11:45 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 30/32] elx: efct: scsi_transport_fc host interface support James Smart
2020-01-09 11:46 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 31/32] elx: efct: Add Makefile and Kconfig for efct driver James Smart
2019-12-20 23:17 ` Randy Dunlap
2020-01-09 11:47 ` Hannes Reinecke
2019-12-20 22:37 ` [PATCH v2 32/32] elx: efct: Tie into kernel Kconfig and build process James Smart
2019-12-24 7:45 ` kbuild test robot
2019-12-24 21:01 ` Nathan Chancellor
2019-12-25 16:09 ` James Smart
2020-01-09 11:47 ` Hannes Reinecke
2019-12-29 18:27 ` [PATCH v2 00/32] [NEW] efct: Broadcom (Emulex) FC Target driver Sebastian Herbszt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=479ac7f4-80ac-babe-7aa6-aa91e257ec8f@suse.de \
--to=hare@suse.de \
--cc=bvanassche@acm.org \
--cc=dwagner@suse.de \
--cc=jsmart2021@gmail.com \
--cc=linux-scsi@vger.kernel.org \
--cc=maier@linux.ibm.com \
--cc=ram.vegesna@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox