History log of /drivers/scsi/bnx2i/bnx2i_iscsi.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
587a1f1659e8b330b8738ef4901832a2b63f0bed 24-Jul-2011 Al Viro <viro@zeniv.linux.org.uk> switch ->is_visible() to returning umode_t

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
f27fb2ef7bd88c9c5f67befe4d85e2155aa0e1a8 25-Jul-2011 Mike Christie <michaelc@cs.wisc.edu> [SCSI] iscsi class: sysfs group is_visible callout for iscsi host attrs

The iscsi class currently does not support writable sysfs
attrs for LLD sysfs settings. This patch converts the
iscsi class and driver's host attrs to use the attribute
container sysfs group and the sysfs group's is_visible callout
to be able to support readable or writable sysfs attrs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
1d063c17298d7cd26cfe350f1e93e1727b4aa53f 25-Jul-2011 Mike Christie <michaelc@cs.wisc.edu> [SCSI] iscsi class: sysfs group is_visible callout for session attrs

The iscsi class currently does not support writable sysfs
attrs for LLD sysfs settings. This patch converts the
iscsi class and driver's session attrs to use the attribute
container sysfs group and the sysfs group's is_visible callout
to be able to support readable or writable sysfs attrs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
3128c6c73cdf3df92c3165bfb785ae50114d18bf 25-Jul-2011 Mike Christie <michaelc@cs.wisc.edu> [SCSI] iscsi cls: sysfs group is_visible callout for conn attrs

The iscsi class currently does not support writable sysfs
attrs for LLD sysfs settings. This patch converts the
iscsi class and drivers to use the attribute container
sysfs group and the sysfs group's is_visible callout
to be able to support readable or writable sysfs attrs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
91d41fdf31f74e6e2e5f3cb018eca4200e36e202 27-Jul-2011 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
target: Convert to DIV_ROUND_UP_SECTOR_T usage for sectors / dev_max_sectors
kernel.h: Add DIV_ROUND_UP_ULL and DIV_ROUND_UP_SECTOR_T macro usage
iscsi-target: Add iSCSI fabric support for target v4.1
iscsi: Add Serial Number Arithmetic LT and GT into iscsi_proto.h
iscsi: Use struct scsi_lun in iscsi structs instead of u8[8]
iscsi: Resolve iscsi_proto.h naming conflicts with drivers/target/iscsi
123521830c0ea35055b900d2ff0b73bb129e08cb 27-May-2011 Nicholas Bellinger <nab@linux-iscsi.org> iscsi: Resolve iscsi_proto.h naming conflicts with drivers/target/iscsi

This patch renames the following iscsi_proto.h structures to avoid
namespace issues with drivers/target/iscsi/iscsi_target_core.h:

*) struct iscsi_cmd -> struct iscsi_scsi_req
*) struct iscsi_cmd_rsp -> struct iscsi_scsi_rsp
*) struct iscsi_login -> struct iscsi_login_req

This patch includes useful ISCSI_FLAG_LOGIN_[CURRENT,NEXT]_STAGE*,
and ISCSI_FLAG_SNACK_TYPE_* definitions used by iscsi_target_mod, and
fixes the incorrect definition of struct iscsi_snack to following
RFC-3720 Section 10.16. SNACK Request.

Also, this patch updates libiscsi, iSER, be2iscsi, and bn2xi to
use the updated structure definitions in a handful of locations.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
ea9582d721a0d711fb046a25f5e94dcbbc5be410 24-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
b5cf6b63f73abdc051035f0050b367beeb2ef94c 24-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
9ae58e144df1a4ecc91dcd9eea5a3f4a6d13b5fc 16-May-2011 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Optimized the iSCSI offload performance

Modified the event coalescing code for iSCSI offload to combat both
corner cases and optimize performance as follows:

1. Added mechanism to loop back a second time to process any leftover
CQEs that was generated by the hardware during the time the driver is
busy processing previous CQEs in the bh. This not only helps the
performance but also fixes the corner case when no more CQEs are being
generated in the pipeline; so those leftover CQEs will get a a chance
to be processed.

2. Added ARM_CQE_FP to distinguish between fast path arming versus
slow path arming. This change will guarantee that the CQEs will
always get a chance to be re-armed during fast path completions.

3. Removed the inline event coalescing division for perf optimization.
Also fixed a division-by-zero error when the event_coal_div module
param was set to 0.

4. Changed the default SQ WQEs size from 256 to 128 to match chip
default.

5. Changed the cmd_per_lun from 32 to 24.

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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
d5307a078bb0288945c900c6f4a2fd77ba6d0817 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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
7287c63e986fe1a51a89f4bb1327320274a7a741 16-May-2011 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Fixed packet error created when the sq_size is set to 16

The number of chip's internal command cell, which is use to generate
SCSI cmd packets to the target, was not initialized correctly by
the driver when the sq_size is changed from the default 128.
This, in turn, will create a problem where the chip's transmit pipe
will erroneously reuse an old command cell that is no longer valid.
The fix is to correctly initialize the chip's command cell upon setup.

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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
d8585bcd7da071f4278710f1c39e18dfe7cb0280 16-Feb-2011 Mike Christie <michaelc@cs.wisc.edu> [SCSI] bnx2i: fix null ptr ref in conn get param

bnx2i has some checks to try and make sure the ep
is not destroyed while the addr/port is getting
read. However, if after this check:

if (!(bnx2i_conn && bnx2i_conn->ep && bnx2i_conn->ep->hba))
goto out;

bnx2i_conn->ep is cleared by ep_disconnect then we will
oops.

This patches fixes the problem by having the driver
use the get_ep_param callback instead of get_conn_param.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
09813ba5bc1a09e39402d66c1671715af0124942 16-Feb-2011 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Added iSCSI text pdu support for iSCSI offload

This is part of an effort to support send target discovery via
the iSCSI offload path.

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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
ec8933b4bc27c6e143ca3ed4159f2e2c69b5499b 16-Feb-2011 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Allow ep CONNECT_FAILED condition to go through proper cleanup

Allow CNIC to go through the proper cleanup procedure for an endpoint
which failed to connect. Proper cleanup is necessary for the chip
to reset back to the initial state for the offloaded endpoint.

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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
11cec1e2e9d94bcda3446f52a868a2099a2eba4f 24-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
a91031a6526441ff36552d53363037c3bbca0c5b 24-Nov-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Cleaned up various error conditions in ep_connect/disconnect

Various error conditions inside ep_connect and ep_disconnect were
either not being handled or not being handled correctly. This patch
fixes all those issues.

Signed-off-by: Eddie Wai <eddie.wai@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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
bee348770dcaeafa57bbd32129ce0cb16a4342d6 24-Nov-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Added return code check for chip kwqe submission request

Added the handling for cases when a chip request is made to the
CNIC module but the hardware is not ready to accept. This would
lead to many unnecessary wait timeouts.
This code adds check in the connect establishment and destruction
path.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
842158d7b7bc3b1a49c31f43ac20414234c33a8d 24-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
016ef69076f3e8f9e42f31152157f46812d25566 24-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
7a2962c77ced218faeeb7b5eda48abfebc578df2 24-Nov-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Added mutex lock protection to conn_get_param

Added net_dev mutex lock protection before accessing the csk
parameters.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
252e44805bcfff5de2e05dd126f69a18e0b760f0 24-Nov-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Allow to abort the connection if connect request times out

In the situation where the connect completion response arrives after
the connect request has already timed out, the connection was not being
aborted but only the resource was being freed. This creates a problem
for 5771X (10g) as the chip flags this with an assertion.

This change will properly aborts the connection before freeing the
resource.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
94810e824df1509ad3ba401e57f74b922fd928c5 24-Nov-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Fixed the remote TCP RST handling for the 570X (1g)

Modified the handling of the remote TCP RST code so the chip can now
flush the tx pipe accordingly upon a remote TCP RST reception.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
5bf3f39f9bda2750145a7da69ea9ae76d0054956 24-Nov-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Fixed a cid leak issue for 5771X (10g)

A cid leak issue was found when the connect destroy request exceeded
the driver's disconnection timeout. This will lead to a cid resource
leak issue.
The fix is to allow the cid cleanup even when this happens.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-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@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
250ae982e2864aa0e06a09137382f44e58b51683 13-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
2c2255e08dee510c68d641195f83d40899897c65 13-Aug-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Recouple the CFC delete cleanup with cm_abort/close completion

Specific to the Broadcom 10g chipset, the CFC delete operation must be
coupled with the cm_abort/close with does the SRC delete/terminate offload
operation prior.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Michael Chan <mchan@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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
39304072ac401015ee3c0fbfa724574dbedb46b5 13-Aug-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Fixed a protocol violation on nopout responses

According to RFC3720, nopout packet sent in response to unsolicited
nopin packet requesting a response must retain the TTT of the requester.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
625986c22e5c122b3e2f4e985680393453d8c5ce 02-Jul-2010 Michael Chan <mchan@broadcom.com> [SCSI] bnx2i: Added host param ISCSI_HOST_PARAM_IPADDRESS

This sysfs attribute is proven to be useful during pivot_root.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Eddie Wai <eddie.wai@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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
2eefb20dbf3032da1ad111c1ce178f899bc4859a 02-Jul-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Fixed the TCP graceful termination initiation

In compliance to RFC793, a TCP graceful termination will be used
instead of an abortive termination for the case where the remote
has initiated the close of the connection.
Additionally, a TCP abortive termination will be used to close the
connection when a logout response is not received in time after a
logout request has been initiated.

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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
e37d2c4791480e27c2e2e4a556e4d2ba1d353ff8 02-Jul-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Fine tuned conn destroy and context destroy timeout values

Added variables to separate the fine tuned timeout values for
connection destroy and context destroy for both 1g and 10g devices.

v2: Extended the 5771X disconnect timeout from 10s to 20s as the firmware
has a retransmission timeout of 16s. This fixes one of the iscsi_endpoint
leak issues when the target is slow or non-responsive to our TCP FIN.

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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
55e15c975cbf9ef8b765eba9ebadc96f2a2e5752 02-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
46012e8b8de325472790d154f4cfb1cf2d4fc49a 02-Jul-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Created an active linklist which holds bnx2i endpoints

This introduces a new active linklist which would link up all active
bnx2i_endpoints. This will be used by subsequent patches that
follows.

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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
6447f286326690a936c35f9f913499307f869934 02-Jul-2010 Eddie Wai <eddie.wai@broadcom.com> [SCSI] bnx2i: Separated the hardware's cleanup procedure from ep_disconnect

This patch introduces a new bnx2i_hw_ep_disconnect routine which
contains all chip related disconnect and clean up procedure of
iSCSI offload connections. This separation is intended as a
preparation for the subsequent bnx2i_stop patch.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
490475a9938f3480e1ab3a67063e547cea41c295 09-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
309ce156aa27f29338438011d292a8d6496623d3 20-Feb-2010 Jayamohan Kallickal <jayamohank@serverengines.com> [SCSI] libiscsi: Make iscsi_eh_target_reset start with session reset

The iscsi_eh_target_reset has been modified to attempt
target reset only. If it fails, then iscsi_eh_session_reset
will be called.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
9f9127fd0cfac1ccbcf4a9456b3d36bc6971355e 10-Feb-2010 Mike Christie <michaelc@cs.wisc.edu> [SCSI] bnx2i: set change_queue_depth function

No reason that we cannot set the change_queue_depth
function for bnx2i. We just forgot to when the
driver was created.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
d9573e7af16de0e3aa55db1703dbe544faf391de 10-Feb-2010 Joe Perches <joe@perches.com> [SCSI] cxgb3i, bnx2i: remove uses of nipquad use %pi4

Remove uses of NIPQUAD, use %pI4

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
45ca38e753016432a266a18679268a4c4674fb52 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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
4ef58d4e2ad1fa2a3e5bbf41af2284671fca8cf8 10-Dec-2009 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits)
tree-wide: fix misspelling of "definition" in comments
reiserfs: fix misspelling of "journaled"
doc: Fix a typo in slub.txt.
inotify: remove superfluous return code check
hdlc: spelling fix in find_pvc() comment
doc: fix regulator docs cut-and-pasteism
mtd: Fix comment in Kconfig
doc: Fix IRQ chip docs
tree-wide: fix assorted typos all over the place
drivers/ata/libata-sff.c: comment spelling fixes
fix typos/grammos in Documentation/edac.txt
sysctl: add missing comments
fs/debugfs/inode.c: fix comment typos
sgivwfb: Make use of ARRAY_SIZE.
sky2: fix sky2_link_down copy/paste comment error
tree-wide: fix typos "couter" -> "counter"
tree-wide: fix typos "offest" -> "offset"
fix kerneldoc for set_irq_msi()
spidev: fix double "of of" in comment
comment typo fix: sybsystem -> subsystem
...
3fe5ae8b4c4d3a82c755074878da7ddb9dde381e 11-Nov-2009 Mike Christie <michaelc@cs.wisc.edu> [SCSI] libiscsi: add warm target reset tmf support

This implements warm target reset tmf support for
the scsi-ml target reset callback. Previously we would
just drop the session in that callback. This patch will
now try a target reset and if that fails drop the session.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
24246de77503978cfcd7e76f06404e60e399992f 11-Nov-2009 Mike Christie <michaelc@cs.wisc.edu> [SCSI] bnx2i: use common iscsi suspend queue

This just has bnx2i use the iscsi_suspend_queue helper.

The suspend works as follows:

When ep_poll has succeeed iscsid will call conn_bind, the LLD will
then call iscsi_conn_bind which will clear the suspend bit.
When ep_disconnect is called (or if there is a conn error) we set
the suspend bit. For the ep_disconnect case I added a helper
in the previous kernel that will take the session lock to make sure
iscsi_queuecommand/xmit_task is not running and it will set
the suspend bit.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
94e2bd688820aed72b4f8092f88c2ccf64e003de 16-Oct-2009 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> tree-wide: fix some typos and punctuation in comments

fix some typos and punctuation in comments

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
b8b9e1b8128d8854cf55740f9ceba3010143520d 22-Sep-2009 Jayamohan Kallickal <jayamohank@serverengines.com> [SCSI] libiscsi: iscsi_session_setup to allow for private space

This patch contains changes that allow iscsi_session_setup
to allocate private space for LLD's

Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
c19dcd011238118ad07d3ab7ed1bbc4916826324 30-Jul-2009 Anil Veerabhadrappa <anilgv@broadcom.com> [SCSI] bnx2i : Fix "cid #n not valid" issue

When bnx2i_adapter_ready() fails, connection handle(cid) = 0 is wrongly freed
because 'cid' is not yet allocated for the endpoint. Fix is to initialize
bnx2i_ep->ep_iscsi_cid to '-1' in bnx2i_alloc_ep() and not in
bnx2i_ep_connect() to avoid releasing invalid 'cid'. There is already a check
in bnx2i_free_iscsi_cid() not to free invalid iscsi connection handle (-1)

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
534cc9c165017dd29ae0f4458832893dc8033c6f 30-Jul-2009 Anil Veerabhadrappa <anilgv@broadcom.com> [SCSI] bnx2i : Fix command session number jump issue seen during cable pull test

Without the fix bnx2i would fail tt->xmit_task() when link is down and
libiscsi would have already incremented session->cmdsn before calling bnx2i's
xmit_task() entry point and will just return the command to SCSI-ML when
xmit_task() fails. libiscsi does not retract the session->cmdsn as the command
was never sent on wire. It is generally good idea for LLD, bnx2i to accept
the scsi cmnd/nopout and let upper layer timeout and go though normal session
recovery process. When link is down, unsolicited nopout will not be accepted
by bnx2i and connection will never enter recovery state. This fix is required
for MPIO to work corectly

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
fac3cc458fc2f8272bcc1ff1903474ff41715723 09-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c
cf4e6363859d30f24f8cd3e8930dbff399cc3550 09-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>
/drivers/scsi/bnx2i/bnx2i_iscsi.c