public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: Daniel Wagner <dwagner@suse.de>
Cc: linux-scsi@vger.kernel.org, Ram Vegesna <ram.vegesna@broadcom.com>
Subject: Re: [PATCH 02/32] elx: libefc_sli: SLI Descriptors and Queue entries
Date: Fri, 25 Oct 2019 16:00:15 -0700	[thread overview]
Message-ID: <8fcf4f62-3a81-532b-8670-8fba60ea8ab3@gmail.com> (raw)
In-Reply-To: <20191025095922.spyfsn5wlnou2xj2@beryllium.lan>

Thanks. We mostly agree with the comment written and will work on the 
changes.

Exceptions or answers to questions are inline below.

-- james


On 10/25/2019 2:59 AM, Daniel Wagner wrote:

> I noticed sometimes there are also BIT() used. Wouldn't it make sense
> to the whole driver to use one or the other version of bit
> definitions?

We don't want to have BIT() used. Any references will be removed.


>> +
>> +/**
>> + * @brief Generic Common Create EQ/CQ/MQ/WQ/RQ Queue completion
>> + */
>> +struct sli4_rsp_cmn_create_queue_s {
>> +	struct sli4_rsp_hdr_s	hdr;
>> +	__le16	q_id;
>> +	u8	rsvd18;
>> +	u8	ulp;
>> +	__le32	db_offset;
>> +	__le16	db_rs;
>> +	__le16	db_fmt;
>> +};
> 
> Just wondering about all these definitions here: These structs
> describes the wire format, no? Shouldn't this marked with __packed? I
> keep forgetting the rules.

not wire format, but rather the endianness of the adapter interface.

yes, it's probably good practice to use __packed. The existing 
definitions should have been ok as the layouts should never have created 
a condition where pad would have been added. but... better safe than sorry.



> Picking up my question from patch #1, what's the idea about the enums
> and defines? Why are the last two ones not an enum?

Well, its a code volume issue. We migrated old code which was mostly 
defines. When close attention was made to properly code for endianness 
in register definitions and things at the lower interfaces, we used 
enums.  Some things changed while others didn't.  Upon conclusion, we 
saw a large amount of both and it is a lot of work for no technical gain 
and limited readability gain to make them all one way or the other.

I asked around as to whether we must be all one type or not and there's 
not a mandate to be one or the other or even specifically when to do 
what. So we've stuck with what we have.

> 
>> +/**
>> + * @brief WQ_CREATE
>> + *
>> + * Create a Work Queue for FC.
>> + */
>> +#define SLI4_WQ_CREATE_V0_MAX_PAGES	4
>> +struct sli4_rqst_wq_create_s {
>> +	struct sli4_rqst_hdr_s	hdr;
>> +	u8		num_pages;
>> +	u8		dua_byte;
>> +	__le16		cq_id;
>> +	struct sli4_dmaaddr_s page_phys_addr[SLI4_WQ_CREATE_V0_MAX_PAGES];
>> +	u8		bqu_byte;
>> +	u8		ulp;
>> +	__le16		rsvd;
>> +};
>> +
>> +struct sli4_rsp_wq_create_s {
>> +	struct sli4_rsp_cmn_create_queue_s q_rsp;
>> +};
>> +
>> +/**
>> + * @brief WQ_CREATE_V1
>> + *
>> + * Create a version 1 Work Queue for FC use.
>> + */
> 
> Why does the workqueue code encode a version? Isn't this pure driver
> code?

The same command can have multiple forms. yes, there's no need to be 
calling out the version if they are the same between versions. We'll fix 
this.




  reply	other threads:[~2019-10-25 23:00 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 21:55 [PATCH 00/32] [NEW] efct: Broadcom (Emulex) FC Target driver James Smart
2019-10-23 21:55 ` [PATCH 01/32] elx: libefc_sli: SLI-4 register offsets and field definitions James Smart
2019-10-24 16:22   ` Daniel Wagner
2019-10-25 23:04     ` James Smart
2019-10-23 21:55 ` [PATCH 02/32] elx: libefc_sli: SLI Descriptors and Queue entries James Smart
2019-10-25  9:59   ` Daniel Wagner
2019-10-25 23:00     ` James Smart [this message]
2019-10-23 21:55 ` [PATCH 03/32] elx: libefc_sli: Data structures and defines for mbox commands James Smart
2019-10-25 11:19   ` Daniel Wagner
2019-10-25 12:20     ` Steffen Maier
2019-10-25 22:10       ` James Smart
2019-10-25 22:42     ` James Smart
2019-10-23 21:55 ` [PATCH 04/32] elx: libefc_sli: queue create/destroy/parse routines James Smart
2019-10-25 15:35   ` Daniel Wagner
2019-10-25 22:24     ` James Smart
2019-10-23 21:55 ` [PATCH 05/32] elx: libefc_sli: Populate and post different WQEs James Smart
2019-10-23 21:55 ` [PATCH 06/32] elx: libefc_sli: bmbx routines and SLI config commands James Smart
2019-10-23 21:55 ` [PATCH 07/32] elx: libefc_sli: APIs to setup SLI library James Smart
2019-10-23 21:55 ` [PATCH 08/32] elx: libefc: Generic state machine framework James Smart
2019-10-23 21:55 ` [PATCH 09/32] elx: libefc: Emulex FC discovery library APIs and definitions James Smart
2019-10-23 21:55 ` [PATCH 10/32] elx: libefc: FC Domain state machine interfaces James Smart
2019-10-23 21:55 ` [PATCH 11/32] elx: libefc: SLI and FC PORT " James Smart
2019-10-23 21:55 ` [PATCH 12/32] elx: libefc: Remote node " James Smart
2019-10-23 21:55 ` [PATCH 13/32] elx: libefc: Fabric " James Smart
2019-10-23 21:55 ` [PATCH 14/32] elx: libefc: FC node ELS and state handling James Smart
2019-10-23 21:55 ` [PATCH 15/32] elx: efct: Data structures and defines for hw operations James Smart
2019-10-23 21:55 ` [PATCH 16/32] elx: efct: Driver initialization routines James Smart
2019-10-23 21:55 ` [PATCH 17/32] elx: efct: Hardware queues creation and deletion James Smart
2019-10-23 21:55 ` [PATCH 18/32] elx: efct: RQ buffer, memory pool allocation and deallocation APIs James Smart
2019-10-23 21:55 ` [PATCH 19/32] elx: efct: Hardware IO and SGL initialization James Smart
2019-10-23 21:55 ` [PATCH 20/32] elx: efct: Hardware queues processing James Smart
2019-10-23 21:55 ` [PATCH 21/32] elx: efct: Unsolicited FC frame processing routines James Smart
2019-10-23 21:55 ` [PATCH 22/32] elx: efct: Extended link Service IO handling James Smart
2019-10-23 21:55 ` [PATCH 23/32] elx: efct: SCSI IO handling routines James Smart
2019-10-23 21:55 ` [PATCH 24/32] elx: efct: LIO backend interface routines James Smart
2019-10-24 22:27   ` Bart Van Assche
2019-10-28 17:49     ` James Smart
2019-10-28 18:31       ` Bart Van Assche
2019-10-23 21:55 ` [PATCH 25/32] elx: efct: Hardware IO submission routines James Smart
2019-10-23 21:55 ` [PATCH 26/32] elx: efct: link statistics and SFP data James Smart
2019-10-23 21:55 ` [PATCH 27/32] elx: efct: xport and hardware teardown routines James Smart
2019-10-23 21:55 ` [PATCH 28/32] elx: efct: IO timeout handling routines James Smart
2019-10-23 21:55 ` [PATCH 29/32] elx: efct: Firmware update, async link processing James Smart
2019-10-23 21:55 ` [PATCH 30/32] elx: efct: scsi_transport_fc host interface support James Smart
2019-10-23 21:55 ` [PATCH 31/32] elx: efct: Add Makefile and Kconfig for efct driver James Smart
2019-10-25 15:55   ` Daniel Wagner
2019-10-25 22:47     ` James Smart
2019-10-23 21:55 ` [PATCH 32/32] elx: efct: Tie into kernel Kconfig and build process James Smart
2019-10-26  0:34   ` kbuild test robot
2019-10-26  0:39     ` Randy Dunlap
2019-10-26 14:13   ` kbuild test robot
2019-10-26 14:13   ` [RFC PATCH] elx: efct: efct_libefc_templ can be static kbuild test robot
2019-10-25 15:56 ` [PATCH 00/32] [NEW] efct: Broadcom (Emulex) FC Target driver Daniel Wagner
2019-10-25 22:31   ` James Smart

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=8fcf4f62-3a81-532b-8670-8fba60ea8ab3@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=dwagner@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --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