History log of /linux-master/drivers/scsi/bfa/bfa_fcs_rport.c
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>


# df561f66 23-Aug-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# e95fcb77 23-Jul-2020 Lee Jones <lee.jones@linaro.org>

scsi: bfa: Remove unused variable 'adisc'

Fixes the following W=1 kernel build warning(s):

drivers/scsi/bfa/bfa_fcs_rport.c: In function ‘bfa_fcs_rport_process_adisc’:
drivers/scsi/bfa/bfa_fcs_rport.c:2243:21: warning: variable ‘adisc’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20200723122446.1329773-28-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# f71ded01 20-Apr-2020 Jason Yan <yanaijie@huawei.com>

scsi: bfa: Remove unneeded semicolon in bfa_fcs_rport.c

Fix the following coccicheck warning:

drivers/scsi/bfa/bfa_fcs_rport.c:2452:2-3: Unneeded semicolon
drivers/scsi/bfa/bfa_fcs_rport.c:1578:3-4: Unneeded semicolon

Link: https://lore.kernel.org/r/20200421033957.27783-1-yanaijie@huawei.com
Signed-off-by: Jason Yan <yanaijie@huawei.com>
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>


# d14e4cd4 27-Nov-2018 Gustavo A. R. Silva <gustavo@embeddedor.com>

scsi: bfa: bfa_fcs_rport: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where
we are expecting to fall through.

Notice that I replaced "!! fall through !!" and "!!! fall through !!!"
comments with "fall through" annotations, which is what GCC is expecting to
find.

Addresses-Coverity-ID: 744899 ("Missing break in switch")
Addresses-Coverity-ID: 744900 ("Missing break in switch")
Addresses-Coverity-ID: 744901 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Sudarsana Kalluru <Sudarsana.Kalluru@qlogic.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>


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

[SCSI] bfa: Fix bug_on condition in RPSC rsp handling

Fix bug_on condition check in RPSC (Report Port Speed Capabilities)
response processing.

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>


# 07cdc046 13-May-2013 Vijay Mohan Guvva <vmohan@Brocade.com>

[SCSI] bfa: fix for FC Direct Attach LUN discovery failure

Resending the patch as it didn't make the linux-scsi list.

This patch fixes fcs rport state machine to address ocassional Brocade
FC Direct Attach LUN discovery failure due to not sending PLOGI accept
to the target.

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


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

[SCSI] bfa: Add support for IO throttling at port level

Add capability to limit the number of exchanges on a port to
avoid queue-full conditions from the target side.

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>


# 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>


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

[SCSI] bfa: Add support for max target ports discovery

- Changes to avoid discovering NPIV port as remote port by the other
NPIV ports created on same physical port when all the NPIV ports are
part of the same zone in a fabric.
- Provided mechanism to support maximum number of target ports for a
given initiator port (physical port + NPIV ports) irrespective of the
way in which the initiator and target ports are zoned in the fabric.
- Introduced module_parameter max_rport_logins to restrict number of
remote ports discovery which includes target and initiator remote ports.

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>


# 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>


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

[SCSI] bfa: FCS remote port enhancements.

- Introduced rport qualifier structure and modified design to
export remote ports with valid pid or valid pwwn to the user space.
- Introduced old_pid field in the rport structure and made changes to
prevent re-creating a new remote port for an already existing rport
that is transitioning to a delete state. (Happens if we receive a RSCN
on the existing remote port that is getting deleted).

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


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

[SCSI] bfa: BSG and User interface fixes.

Made changes to set the rport maxfrsize param to use a value that is
equal to or less than the Buffer-to-Buffer Receive Data_Field size
specified in the Common Service Parameters.
Increased the diag memtest timeout for the Brocade-1860 adapters.
Made changes to enable valid port speed configuration check for all adapters.
Made changes to increase the max hw segments in a request, in order to
support larger data transfers from user space.

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


# 7826f304 20-Jul-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add FC-transport based Asynchronous Event Notification support.

- Added support to post vendor unique events on fc_host.
- Supports adapter, port, ioc, flash and remote port based AEN events.

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


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

[SCSI] bfa: Extend BSG interface.

- Added support to collect driver/fw stats.
- Added support to perform adapter/ioc enable, disable operations.

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


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

[SCSI] bfa: FCS bug fixes.

- Added logic to initiate a PLOGI to the target, while processing a LOGO
from the same target in Direct attach mode.
- Added logic to generate a FCCT Reject indicating unsupported command,
upon receiving FCCT/FCGS requests.
- Added logic to set the fcpim in offline state and avoid any PRLI retries
if a PRLI response is a reject with a reason Command Not Supported.
- Updated the FDMI Supported/Current speeds.
- Added logic to wait for the response from the firmware before sending
ACC to PLOGI and transitioning to subsequent states - while processing an
Incoming PLOGI in online state.
- Added a wait state in the fcs_vport state machine - For case where
FDISC is in progress and we get a vport delete request we wait for
fdisc response and will transition to the appropriate state based on
rsp status, else its causing both driver/fw resources to be not
freed.
- Remove the fc_credit_recovery module param.

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>


# d4b671c5 26-Dec-2010 Jing Huang <huangj@brocade.com>

[SCSI] bfa: replace bfa_assert with WARN_ON

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


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

[SCSI] bfa: remove unused functions and misc cleanups

Remove unused functions and fix checkpatch errors. Misc cleanups in
comment and formatting.

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>


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

[SCSI] bfa: remove all OS wrappers

Remove OS wrapper functions/macros, and as a result remove bfa_os_inc.h.

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>


# 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>


# 50444a34 29-Nov-2010 Maggie <xmzhang@brocade.com>

[SCSI] bfa: fix endianess sparse check warnings

First round of fix for the endianess check warnings from make C=2 CF="-D__CHECK_ENDIAN__".

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


# 52f94b6f 29-Nov-2010 Maggie <xmzhang@brocade.com>

[SCSI] bfa: fix regular sparse check warnings.

Fix all sparse check warnings from make C=2.

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


# 88166242 09-Dec-2010 Jing Huang <huangj@brocade.com>

[SCSI] bfa: rename log_level to bfa_log_level

Rename log_level to bfa_log_level to make the global variable more bfa
specific and avoid clashes with other drivers which was causing a
build failure.

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


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

[SCSI] bfa: fix comments for c 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>


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

[SCSI] bfa: replace endian swap macros with the ones provided by linux

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


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

[SCSI] bfa: remove os wrapper and unused functions

This patch removes os wrapper and unused functions.
bfa_os_assign(), bfa_os_memset(), bfa_os_memcpy(), bfa_os_udelay()
bfa_os_vsprintf(), bfa_os_snprintf(), and bfa_os_get_clock() are replaced with
direct assignment or native linux functions. Some unused functions related to VF
(Vitual fabric) are also removed.

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>