Re: [PATCH v3 10/31] elx: libefc: FC Domain state machine interfaces

Hannes Reinecke
2020-04-15T12:50:24Z

On 4/12/20 5:32 AM, James Smart wrote:
> This patch continues the libefc library population.
>
> This patch adds library interface definitions for:
> - FC Domain registration, allocation and deallocation sequence
>
> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
>
> ---
> v3:
> Acquire efc->lock in efc_domain_cb to protect all the domain state
> transitions.
> Removed efc_assert and used WARN_ON.
> Note: Re: Locking:
> efc->lock is a global per port lock which is used to synchronize and
> serialize all the state machine event processing. As there is a
> single EQ all the events are serialized. This lock will protect the
> sport list, sport, node list, node, and vport list. All the libefc
> APIs called by the driver will take this lock internally.
> Note: Re: "It would even simplify the code, as several cases can be
> collapsed into one ..."
> The Hardware events cannot be collapsed as each events is different
> from State Machine events. The code present looks more readable than
> a mapping array in this case.
> ---
> drivers/scsi/elx/libefc/efc_domain.c | 1109 ++++++++++++++++++++++++++++++++++
> drivers/scsi/elx/libefc/efc_domain.h | 52 ++
> 2 files changed, 1161 insertions(+)
> create mode 100644 drivers/scsi/elx/libefc/efc_domain.c
> create mode 100644 drivers/scsi/elx/libefc/efc_domain.h
>

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

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer