History log of /linux-master/drivers/scsi/bfa/bfa_svc.h
Revision Date Author Comments
# 37126399 22-Feb-2024 Arnd Bergmann <arnd@arndb.de>

scsi: bfa: Fix function pointer type mismatch for state machines

The bfa driver is full of state machines and a generic abstraction layer
for them. This relies on casting function pointers, but that is no longer
allowed when CONFIG_CFI_CLANG is enabled and causes a huge number of
warnings like:

drivers/scsi/bfa/bfad.c:169:3: error: cast from 'void (*)(struct bfad_s *, enum bfad_sm_event)' to 'bfa_sm_t' (aka 'void (*)(void *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
bfa_sm_set_state(bfad, bfad_sm_created);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Rework the mechanism to no longer require the function pointer casts, by
having separate types for each individual state machine. This in turn
requires moving the enum definitions for each state machine into the header
files in order to define the typedef.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240222124433.2046570-2-arnd@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 52fa7bf9 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 292

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license gpl version 2
as published by the free software foundation this program is
distributed in the hope that it will be useful but without any
warranty without even the implied warranty of merchantability or
fitness for a particular purpose see the gnu general public license
for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 66 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141901.606369721@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f604a03 10-Nov-2017 Arnd Bergmann <arnd@arndb.de>

scsi: bfa: use proper time accessor for stats_reset_time

We use the deprecated do_gettimeofday() function to read the current
time when resetting the statistics in both bfa_port and bfa_svc. This
works fine because overflow is handled correctly, but we want to get rid
of do_gettimeofday() and using a non-monotonic time suffers from
concurrent settimeofday calls and other problems.

This uses the ktime_get_seconds() function instead, which does what we
need here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Anil Gurumurthy <Anil.Gurumurthy@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 31e1d569 26-Nov-2015 Anil Gurumurthy <anil.gurumurthy@qlogic.com>

bfa: File header and user visible string changes

Signed-off-by: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 889d0d42 26-Nov-2015 Anil Gurumurthy <anil.gurumurthy@qlogic.com>

bfa: Update copyright messages

Signed-off-by: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 1a898a79 13-May-2013 Vijaya Mohan Guvva <vmohan@brocade.com>

[SCSI] bfa: Add dynamic diagnostic port support

D-Port is a new port type created with the intention of running link
level diagnostic tests like loopback, traffic test. In static D-port
mode, user configures the port to D-port mode and starts the test, but
in dynamic D-port, once the Brocade switch port is configured to
D-port, it will reject the regular FLOGI from HBA with reason that it is
in D-port mode. So based on the reason code HBA port will turn itself into
D-port and start diagnostic test.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@brocade.com>
Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 4e1e0d8d 13-May-2013 Vijaya Mohan Guvva <vmohan@brocade.com>

[SCSI] bfa: Forward Error Correction status query

This patch includes changes to get FC HBA feature Forward Error
Correction (FEC) (enabled at 16Gig speed) status from firmware and to
return to brocade HBA management utility.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# bbe37a67 13-May-2013 Vijaya Mohan Guvva <vmohan@brocade.com>

[SCSI] bfa: Support for FC BB credit recovery

This patch includes changes to 1) Enable/disable fc credit recovery on
Brocade FC adapter port operating at max supported speed. 2) Get credit
recovery status and stats related to credit loss and recovered credits

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 6894f013 21-Sep-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add support for user to configure bandwidth on QoS priorities

Made changes to provide an option for user to configure the
bandwidth percentage for High/Medium/Low QoS priorities.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@brocade.com>
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# e353546e 21-Sep-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add diagnostic port (D-Port) support

- Introduced support for D-Port which is a new port mode during which
link level diagnostics can be run.
- Provided mechanism to dynamically configure D-Port and initiate diagnostic
tests to isolate any link level issues.
- In D-Port mode, the HBA port does not participate in fabric or login to the
remote device or run data traffic.
- Diagnostic tests include running various loopback tests in conjunction with
the attached device.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# bc0e2c2a 21-Sep-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add support for FC Arbitrated Loop topology.

- Add private loop topology support at 2G/4G/8G speeds with following
limitations
1. No support for multiple initiators in the loop
2. No public loop support. If attached to a loop with an FL_Port,
device continues to work as a private NL_Port in the loop
3. No auto topology detection. User has to manually set the
configured topology to loop if attaching to loop.
- When loop topology is configured, enabling FC port features
QoS/Trunk/TRL are not allowed and vice versa.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 881c1b3c 22-Aug-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add PowerPC support and enable PCIE AER handling.

- Added few missing endian swap changes to support BFA on PowerPC.
- Added PCIE AER support to BFA:
a) Implemented the PCI error handler entry points.
b) Made changes to FCS state machine to handle STOP event from the
PCI error detected entry point.
c) Made changes to the IO Controller state machine to handle SUSPEND
event from the PCI error detected entry point.
d) Made changes to restart the BFA operations on a slot_reset completion.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# c3f1b123 22-Aug-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Make changes to FCXP resource management.

- Made changes to split FCXP resources as request and response resources.
- The split will reduce the contention for FCXP resources in an open zone
config.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# db9d8a75 13-Mar-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.

Made changes to the Fabric Assigned Address(FAA) feature implementation.
Introduced the IOCFC state machine, which now handles the FAA logic,
IOC and BFA sub-modules enablement.
Removed un-wanted FAA enable/disable routines; FAA is enabled by default.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 8ca2dd87 20-Dec-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Revert back the current LUN Masking Implementation.

This patch reverts the current LUN Masking Implementation. We re-implemented
this feature using the SCSI Slave Callout's as per the review comments.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 83763d59 20-Jul-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Introduced initiator based lun masking feature.

- Added support to enable initiator based lun masking.
- Initiator based Lun masking works similar to zoning where
initiator port is allowed to see only those LUNs which are
configured to be seen.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 37ea0558 20-Jul-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Added support to collect and reset fcport stats

- Added support to collect and reset fcport stats.
- Modified design to allow multiple requests for fcport stats.
- fcport will remember the stats request in its stats_pending
queue and service each of the queued requests after receiving
a firmware response for the prior request.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 3d7fc66d 24-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Added HBA diagnostics support.

- Added diagnostics sub-module to BFA.
- Implemented interface to perform memtest/loopback test
and some other diagnostics tests.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 4507025d 24-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: DMA memory allocation enhancement.

- Modified the design such that each BFA sub-module will provide
the amount of DMA and KVA memory needed by it and queues the
same request to the global dma and kva info queues.
- During the memory allocation we iterate over this queue to allocate
the dma and kva memory requested by sub-modules.
- The change is needed to avoid requesting the aggregate amount of memory
needed by all the BFA sub-modules as one contiguous chunk.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 3fd45980 24-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Brocade-1860 Fabric Adapter vHBA support.

- Introduced partitioning of the BFA resources.
- Added h/w queue ID in CPE messages, firmware uses h/w queue ID
from messages to pick a matching RME queue.
- Added message header to bfa_reqq_produce(). h/w queue ID is set
in the message header and firmware modules use h/w queue ID from
message header instead of from cpqe event.
- Made changes to allow using all 256 queues of Brocade-1860 asic.
Previously only a single queue per queue group was used.
- Added function tag to BFI message header. Only used by FC BFI
messages. Used to translate host tag to firmware tag. bfa_lpuid()
is changed to bfa_fn_lpu() that encodes both PCI function and port
ID in BFI message header.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# a714134a 24-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Added Fabric Assigned Address(FAA) support

- Updated/added data structures and definitions to support FAA protocol.
- Modified the IOC state machine to support FAA.
- Introduced FAA feature configuration - enable/disable/query.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# be540a99 13-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: FC credit recovery and misc bug fixes.

- Introduce FC credit recovery.
- Added module parameter to enable/disable credit recovery.

Bug Fixes:
- Removed check for ignoring plogi from initiator in switched fabric mode.
- The ABTS for PLOGI is going out few millisecs earlier due to FW
timer calibration (around 300 miilisecs earlier). So there is a
window if an accept comes during this time HBA would have initiated
an ABORT.
- Added 1 to FC_ELS_TOV for compensating for FW timer.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 43ffdf4d 13-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add pbc port disable check and fix LPS message name

- Add PBC port Disabled condition check.
- Rename incorrectly named LPS I2H messages.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# b704495c 13-Dec-2010 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: direct attach mode fix.

- Direct attach is not working due to the check of PID in fcxp_send request.
- Added logic to set the lps->lp_pid with the PID assigned for n2n mode.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# f3a060ca 13-Dec-2010 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Store port configuration in flash for persistency.

When the bfa driver is loaded a flogi is sent without the knowledge of
trunking configuration. This normal flogi causes the switch ports
which had trunking enabled to go to persistent offline. Solution is
to store the port configuration (which has trunking info) in the flash
for persistency. The firmware will read this configuration when the
very first fcport enable is received.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# f7f73812 09-Dec-2010 Maggie Zhang <xmzhang@brocade.com>

[SCSI] bfa: clean up one line functions

Cleaned up one line functions.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# df0f1933 09-Dec-2010 Maggie Zhang <xmzhang@brocade.com>

[SCSI] bfa: remove unused and empty functions

Removed unused and empty functions.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <xmzhang@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# acdc79a6 18-Oct-2010 Jing Huang <huangj@brocade.com>

[SCSI] bfa: fix comments for header files

This patch addresses the comments from Randy Dunlap (Randy.Dunlap@oracle.com)
regarding comment blocks that begining with "/**". bfa driver comments
currently do not follow kernel-doc convention, we hence replace all
/** with /* and **/ with */.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# a36c61f9 15-Sep-2010 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: cleanup driver

We have flattened the BFA hierarchy and also reduced the number of
source and header files we used to have earlier.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>