History log of /linux-master/drivers/scsi/bnx2i/bnx2i_init.c
Revision Date Author Comments
# 8d82557e 17-May-2023 Azeem Shaikh <azeemshaikh38@gmail.com>

scsi: bnx2i: Replace all non-returning strlcpy with strscpy

strlcpy() reads the entire source buffer first.
This read may exceed the destination size limit.
This is both inefficient and can lead to linear read
overflows if a source string is not NUL-terminated [1].
In an effort to remove strlcpy() completely [2], replace
strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89

Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230517143130.1519941-1-azeemshaikh38@gmail.com


# 97d0e04d 16-Sep-2020 Qinglang Miao <miaoqinglang@huawei.com>

scsi: bnx2i: Remove unnecessary mutex_init()

The mutex bnx2i_dev_lock is initialized statically. It is unnecessary to
initialize by mutex_init().

Link: https://lore.kernel.org/r/20200916062133.191000-1-miaoqinglang@huawei.com
Acked-by: Manish Rangankar <mrangankar@marvell.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


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

scsi: bnx2i: Fix parameter misnaming in function header

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

drivers/scsi/bnx2i/bnx2i_init.c:83: warning: Function parameter or member 'dev' not described in 'bnx2i_identify_device'
drivers/scsi/bnx2i/bnx2i_init.c:83: warning: Excess function parameter 'cnic' description in 'bnx2i_identify_device'

Link: https://lore.kernel.org/r/20200723122446.1329773-5-lee.jones@linaro.org
Cc: QLogic-Storage-Upstream@qlogic.com
Cc: Anil Veerabhadrappa <anilgv@broadcom.com>
Cc: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# f9f22a86 23-Jul-2017 Thomas Gleixner <tglx@linutronix.de>

scsi: bnx2i: Simplify cpu hotplug code

The CPU hotplug related code of this driver can be simplified by:

1) Consolidating the callbacks into a single state. The CPU thread can be
torn down on the CPU which goes offline. There is no point in delaying
that to the CPU dead state

2) Let the core code invoke the online/offline callbacks and remove the
extra for_each_online_cpu() loops.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 2fa2fa1a 23-Jul-2017 Thomas Gleixner <tglx@linutronix.de>

scsi: bnx2i: Prevent recursive cpuhotplug locking

The BNX2I module init/exit code installs/removes the hotplug callbacks with
the cpu hotplug lock held. This worked with the old CPU locking
implementation which allowed recursive locking, but with the new percpu
rwsem based mechanism this is not longer allowed.

Use the _cpuslocked() variants to fix this.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# e210faa2 21-Dec-2016 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

scsi/bnx2i: Convert to hotplug state machine

Install the callbacks via the state machine. No functional change.

This is the minimal fixup so we can remove the hotplug notifier mess
completely.

The real rework of this driver to use work queues is still stuck in
review/testing on the SCSI mailing list.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: QLogic-Storage-Upstream@qlogic.com
Cc: Johannes Thumshirn <jth@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20161221192111.836895753@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>


# e090cc92 17-Jul-2014 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

bnx2i: Update driver version to 2.7.10.1

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# f39a7757 03-Jul-2014 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

bnx2i: Rebranding bnx2i driver

QLogic has acquired the NetXtremeII products and drivers from Broadcom.
This patch re-brands bnx2i driver as a QLogic driver

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Acked-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# bc0003c9 10-Mar-2014 Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>

scsi, bnx2i: Fix CPU hotplug callback registration

Subsystems that want to register CPU hotplug callbacks, as well as perform
initialization for the CPUs that are already online, often do it as shown
below:

get_online_cpus();

for_each_online_cpu(cpu)
init_cpu(cpu);

register_cpu_notifier(&foobar_cpu_notifier);

put_online_cpus();

This is wrong, since it is prone to ABBA deadlocks involving the
cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
with CPU hotplug operations).

Instead, the correct and race-free way of performing the callback
registration is:

cpu_notifier_register_begin();

for_each_online_cpu(cpu)
init_cpu(cpu);

/* Note the use of the double underscored version of the API */
__register_cpu_notifier(&foobar_cpu_notifier);

cpu_notifier_register_done();

Fix the bnx2i code in scsi by using this latter form of callback registration.

Cc: Eddie Wai <eddie.wai@broadcom.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 0b3bf387 11-Jul-2013 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Update version and copyright year 2013

Old version: 2.7.2.2
New version: 2.7.6.2

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 9e9402eb 02-Aug-2013 Michael Chan <mchan@broadcom.com>

cnic, bnx2i: Fix bug on some bnx2x devices that don't support iSCSI

On some bnx2x devices, iSCSI is determined to be unsupported only after
firmware is downloaded. We need to check max_iscsi_conn again after
NETDEV_UP and block iSCSI init operations. Without this fix, iscsiadm
can hang as the firmware will not respond to the iSCSI init message.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 6f039790 21-Dec-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Drivers: scsi: remove __dev* attributes.

CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Adam Radford <linuxraid@lsi.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b83908ce 15-Oct-2012 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: removed the individual PCI DEVICE ID checking

Removed the individual PCI DEVICE ID checking inside bnx2i. The device
type can easily be read from the corresponding cnic->flags. This will
free bnx2i from having to get updated for every new device ID that gets
added.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 12aba9e7 29-Jun-2012 Dan Carpenter <dan.carpenter@oracle.com>

bnx2i: use strlcpy() instead of memcpy() for strings

DRV_MODULE_VERSION here is "2.7.2.2" which is only 8 chars but we copy
12 bytes from the stack so it's a small information leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Acked-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 2e499d3c 25-Jun-2012 Barak Witkowski <barak@broadcom.com>

bnx2x, bnx2fc, bnx2i, cnic: Add statistics support and FCoE capabilities advertisement

1. When FCoE offload driver is registered, copy its capabilities to the chip
scratchpad.
2. Copy FCoE/iSCSI MAC addresses in aligned manner to chip scratchpad.
3. Add FCoE/iSCSI statistics collection support

Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 9ebd99c5 25-Apr-2012 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Updated version and copyright year

Old version: 2.7.0.3
New version: 2.7.2.2

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 70fc872c 02-Feb-2012 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Fixed the override of the error_mask module param

The error_mask module param overrides has a bug which prevented
the new module param values to take effect.

Also changed the type attribute of the error_mask1/2 module params
from int to uint to allow the MSB to be set.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 93713f3b 02-Feb-2012 Eric Dumazet <eric.dumazet@gmail.com>

[SCSI] bnx2i: use kthread_create_on_node()

bnx2i_percpu_thread_create() create per cpu kthread, and should use
proper NUMA aware API.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# ea9582d7 23-Jun-2011 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Updated copyright and bump version

Bumped version from 2.6.2.3 to 2.7.0.3

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 3601b531 23-Jun-2011 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Modified to skip CNIC registration if iSCSI is not supported

The init routine will now examine the cnic->max_iscsi_conn variable
before registering to CNIC during ulp_init.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# b5cf6b63 23-Jun-2011 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Added the use of kthreads to handle SCSI cmd completion

This patch breaks the SCSI cmd completion into two parts:
1. The bh will allocate and queued work to the cmd specific CPU IO
completion kthread. The CPU for the cmd is from the sc->request->cpu.

2. The CPU specific IO completion kthread will call the scsi_cmd_resp
routine to do the actual cmd completion.

In the normal case, these IO completion kthreads should complete before
the blk IO times out at 60s. However, in the case when these kthreads
are blocked for whatever reason and exceeded the timeout, the call
to conn_destroy will have to iterate and exhaust all related work in the
percpu work list for all online CPUs. This will guarantee the protection
of the work->session and conn pointers before they get freed.

Also modified the event coalescing formula to have at least the
event_coal_min outstanding cmds in the pipeline so the SCSI producer
would not get underrun.

Also changed the following SCSI parameters:
- can_queue from 1024 to 2048
- cmds_per_lun from 24 to 128

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Benjamin Li <benli@broadcom.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# f4b5ad26 20-Jun-2011 Michael Chan <mchan@broadcom.com>

cnic, bnx2i: Add support for new devices - 57800, 57810, and 57840

And change iSCSI RQ doorbell size from 16B to 64B to match new firmware.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# d5307a07 16-May-2011 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Updated the connection shutdown/cleanup timeout

Modified the 10s wait time for inflight offload connections to
advance to the next state to 2s based on test result.
Modified the 20s shutdown timeout to 30s based on test result.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>


# fc336387 16-Feb-2011 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Updated to version 2.6.2.3

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 8a4a0f3a 16-Feb-2011 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Added support for the 57712(E) devices

Moved all PCI_DEVICE_ID_NX2_57712(E) definitions to pci_ids.h

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# a977d2c9 16-Feb-2011 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Added handling for unsupported iSCSI offload hba

The hba will now be unregistered and freed when iSCSI offload
is not supported by the NIC.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 3db86353 23-Nov-2010 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Updated version to 2.6.2.2

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 11cec1e2 23-Nov-2010 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Updated copyright and maintainer info

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 842158d7 23-Nov-2010 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Modified the bnx2i stop path to compensate for in progress ops

The stop path has been augmented to wait a max of 10s for all in
progress offload and destroy activities to complete before proceeding
to terminate all active connections (via iscsid or forcefully).

Note that any new offload and destroy requests are now blocked and
return to the caller immediately.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 016ef690 23-Nov-2010 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Removed the dynamic registration of CNIC

The code no longer needs to dynamically register and unregister
the CNIC device. The CNIC device will be kept registered until
module unload.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# fc91961c 12-Aug-2010 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Updated version to bnx2i-2.1.3

Also updated maintainer info.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 250ae982 12-Aug-2010 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Added chip cleanup for the remove module path

In the case when an ep_connect request is interrupted due to route
request stall, if the iSCSI daemon is terminated by the user, the chip
will be left in a state which will not get cleaned up upon module
removal. Upon module reload, when the same context id is used for a
new connection, chip panic would occur.

This patch adds chip cleanup in the module removal path.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# a2f1d139 01-Jul-2010 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Updated version from 2.1.1 to 2.1.2

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 55e15c97 01-Jul-2010 Eddie Wai <eddie.wai@broadcom.com>

[SCSI] bnx2i: Optimized the bnx2i_stop connection clean up procedure

For cases where the iSCSI disconnection procedure times out due to
the iSCSI daemon being slow or unresponsive, the bnx2i_stop routine
will now perform hardware cleanup via bnx2i_hw_ep_disconnect on all
active endpoints so that subsequent operations will perform properly.
Also moved the mutex locks inside ep_connect and ep_disconnect so
that proper exclusivity can resolve simultaneous calls to the
ep_disconnect routine.

v2: Removed the unnecessary read lock in the bnx2i_stop

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 490475a9 08-Apr-2010 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: Bug fixes related to MTU change issue when there are active iscsi sessions

bnx2i driver has to wait and cleanup all iscsi endpoints before
returning from bnx2i_stop(). This is to make sure all chip resources
are freed before chip is reset.

As the requirements for 1G and 10G chipsets is different, added
per-device 'hba_shutdown_tmo' parameter to adapter structure

If the connections are not torn down by the daemon within this timeout
period, 'cid's will be leaked in 10G device. 1G devices are more
flexible and do not leak any resources because the whole chip ports
gets reset when MTU is changed or ethtool selftest is run

fixed a minor issue in bnx2i_ep_poll() which unnecessarily forced
error return code when driver timed out waiting for TCP connect
request to complete

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 457549da 25-Mar-2010 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: Update version and module description

missing 10G drivers added to description

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# ce2d763a 25-Mar-2010 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: link bnx2i hba and cnic device before registering the device

When bnx2/cnic/bnx2i drivers are loaded in certain order, bnx2i will
will not initialize the device correctly because 'hba->cnic' will be
NULL when bnx2i_start() is called from register_device() context.
Under this condition 'ifdown' and 'ifup' of associated network
interface is required to bring iscsi adapter state to ready state so
that it will accept iscsi connection setup within the chip

Initializing 'hba->cnic' before calling register_device() will fix
this issue

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 45ca38e7 07-Dec-2009 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: minor code cleanup and update driver version

Removed duplicate function call and not-so-useful comment line

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 8776193b 07-Dec-2009 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: update CQ arming algorith for 5771x chipsets

Only affects 5771x (10G chipsets) devices

This is an optimized CQ arming algoritm which takes into account the
number of outstanding tasks

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# f8c9abe7 07-Dec-2009 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: Adjust sq_size module parametr to power of 2 only if a non-zero value is specified

This issue was discovered during 10G iscsi testing

Default value of 'sq_size' module parameter is '0' which means driver
should use predefined SQ queue size when setting up iscsi connection.

roundup_pow_of_two(0) results in '1' and forces driver to setup
connections with send queue size of '1' and results in lower
performance as well

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 5d9e1fa9 07-Dec-2009 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: Add 5771E device support to bnx2i driver

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# fac3cc45 08-Jul-2009 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: register given device with cnic if shost != NULL in ep_connect()

When using iface, bnx2i was unable to offload further connections after all
active sessions are logged out. bnx2i will unregister the device from cnic
when the last connection is torn down. Next call to ep_connect() will fail
because the device is not registered. This issue is not seen if shost == NULL
is passed to ep_connect() call because in that case bnx2i will registers all
known devices with cnic before doing a route look-up. When shost != NULL,
bnx2i knows the device on which to offload the connection and has to register
this device before attempting to offload the connection

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 3be924fb 23-Jun-2009 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: convert bnx2i_dev_lock to mutex

convert bnx2i_dev_lock to type mutex from rwlock_t because
cnic->register_device() can sleep for various reasons including memory
allocation, waiting for ISCSI_INIT completion and while acquiring mutex lock,
cnic_lock.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 4e85f151 23-Jun-2009 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: bug fixes in bnx2i_init_one to handle error conditions

Fixed bnx2i_init_one() to properly handle return code of
cnic->register_device() and propagate it back to the caller. No need to check
for BNX2I_CNIC_REGISTERED, because unless the adapter is added to adapter_list
it will not be registered in ep_connect context

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 1ed0f6a3 23-Jun-2009 Anil Veerabhadrappa <anilgv@broadcom.com>

[SCSI] bnx2i: remove global variable bnx2i_reg_devices

Removed bnx2i_reg_devices as this counter is not really
used in a meaningful way

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# cf4e6363 08-Jun-2009 Michael Chan <mchan@broadcom.com>

[SCSI] bnx2i: Add bnx2i iSCSI driver.

New iSCSI driver for Broadcom BNX2 devices. The driver interfaces with
the CNIC driver to access the hardware.

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>