Commit Graph

765 Commits

Author SHA1 Message Date
Bart Van Assche
56684eee96 ib_srpt: Change return value of srpt_handle_tsk_mgmt() from u8 into void
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4220 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-24 07:54:33 +00:00
Bart Van Assche
cd3f9bfea8 ib_srpt: Process receive completions on the context of an SCST worker thread
instead of on the context of an srpt thread. Improves performance for many
configurations but decreases performance up to 10% in some cases.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4219 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-21 11:51:48 +00:00
Vladislav Bolkhovitin
eb95049061 Copyrights updated + cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4216 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-18 02:26:39 +00:00
Bart Van Assche
2d71d64481 ib_srpt: Remove a superfluous test
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4212 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-14 13:04:11 +00:00
Bart Van Assche
1c4b023f83 ib_srpt: Only enable the recently added gcc workaround for gcc 4.6 and earlier
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4211 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-14 12:56:36 +00:00
Bart Van Assche
f022a827ba ib_srpt: Close active sessions when disabling a target
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4202 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-10 15:02:13 +00:00
Bart Van Assche
e4bc6f2b2b ib_srpt: Workaround for an openSUSE 12.1 compiler bug (see also http://bugzilla.novell.com/show_bug.cgi?id=756235)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4201 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-10 14:59:26 +00:00
Bart Van Assche
b675a6b02c ib_srpt: Make sure that pre-RTU requests are processed before post-RTU requests
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4200 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-10 14:58:31 +00:00
Bart Van Assche
1285dd1dad ib_srpt: Update ChangeLog
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4197 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-07 09:13:50 +00:00
Bart Van Assche
3c2957284c ib_srpt: Avoid that sessions are not unregistered properly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4193 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-06 08:11:47 +00:00
Bart Van Assche
4c36a0632a ib_srpt: Fix a race triggered by the code for handling IB CM RTU notifications
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4192 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-06 08:00:14 +00:00
Vladislav Bolkhovitin
90670b1c83 scst_rx_mgmt_fn_lun(): Change 3rd arg from u8 * into void *
This change allows to remove several casts and hence improves
source code readability.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4169 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-27 01:40:45 +00:00
Bart Van Assche
968d3b17fe nightly build: Add 3.3 support patches
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4167 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-24 07:12:56 +00:00
Bart Van Assche
b07403a23d ib_srpt: Remove an obsolete patch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4150 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-04 13:16:27 +00:00
Bart Van Assche
30615c003c ib_srpt: Clarify a comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4147 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-25 08:59:13 +00:00
Bart Van Assche
2553057f73 ib_srpt: Disallow new logins during module removal
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-25 08:58:50 +00:00
Bart Van Assche
2d12dae7b4 ib_srpt: Whitespace-only change
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4145 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-24 07:21:24 +00:00
Bart Van Assche
c4d91e67d9 ib_srpt: Follow-up for r4143
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4144 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-24 07:20:52 +00:00
Vladislav Bolkhovitin
50120c37b3 scst_cmd_aborted() is a bad and ambiguous name. Rename it to scst_cmd_aborted_on_xmit() and create a new version, which truly reflects its semantic.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4143 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-24 02:24:06 +00:00
Bart Van Assche
440e1a405e ib_srpt: Document LUN masking
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4141 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-18 13:32:45 +00:00
Bart Van Assche
6e55334a9f ib_srpt: Fix QP use-after-free triggered by SRP logout.
Fixed this by destroying cm_id before QP instead of after. The following
messages were logged if the use-after-free occurred:

mlx4_core 0000:08:00.0: command 0x19 failed: fw status = 0x9
ib_srpt: ***ERROR***: srpt_init_ch_qp() failed (-9)
ib_srpt: ***ERROR***: rejected SRP_LOGIN_REQ because creating a new RDMA channel failed.
ib_srpt: Rejecting login with reason 0x10001


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4139 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-18 10:24:25 +00:00
Bart Van Assche
1a6c43b1bc ib_srpt: Revert r4123
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4138 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-18 07:03:41 +00:00
Bart Van Assche
dfaf6388f2 ib_srpt: Display the qpn when QP initialization fails
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4128 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-14 19:48:07 +00:00
Bart Van Assche
fab05915ad ib_srpt: Reset a QP before transitioning it to the INIT state. That
should avoid that an error message like the following is generated if
driver and HCA QP state get out of sync:

mlx4_core 0000:03:00.0: command 0x19 failed: fw status = 0x9


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4123 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-13 17:06:50 +00:00
Bart Van Assche
a5a4d5ca6c ib_srpt: Increase RDMA_COMPL_TIMEOUT_S in order to avoid that the IB completion timeout fires too early on flaky motherboards
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4122 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-11 10:29:22 +00:00
Bart Van Assche
b8a38346eb ib_srpt: Update ChangeLog
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4086 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-21 18:03:30 +00:00
Bart Van Assche
6fbdc157d6 ib_srpt: Revert r3920 because the performance improvement is minor and with certain initiators it can cause performance to fluctuate
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4083 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-21 17:47:48 +00:00
Bart Van Assche
a8f25c1cc2 ib_srpt: Remove an obsolete section from the README file and add a FAQ section
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4082 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-21 16:58:53 +00:00
Bart Van Assche
10bcf70cc6 Add files necessary for 3.2 nightly build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4078 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-19 07:58:37 +00:00
Bart Van Assche
4904b9d0e3 ib_srpt: Make the srp_max_rdma_size module parameter non-executable.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-18 18:53:56 +00:00
Bart Van Assche
6ee7d621d6 ib_srpt: Clear the cm_id->context pointer before freeing a channel
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4071 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-13 19:49:44 +00:00
Bart Van Assche
704410f264 ib_srpt: Builds again on kernel 3.1 and before / avoid uninitialized fields in srq_attr in case that structure is extended once more in the future
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4069 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-13 14:05:23 +00:00
Bart Van Assche
02be9382b5 ib_srpt: Initialize ib_srq_init_attr.srq_type such that ib_qip doesn't return -ENOSYS when trying to create an SRQ
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4068 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-13 13:50:23 +00:00
Bart Van Assche
ddbe1c0770 ib_srpt: Rework r4063
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4067 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-12 19:17:50 +00:00
Bart Van Assche
4c9f5a4b14 ib_srpt: Fix (unlikely) race between wake_up_process() and kthread_stop()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4063 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-11 19:17:23 +00:00
Bart Van Assche
dae7bfc068 ib_srpt: Add a comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4062 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-11 19:16:18 +00:00
Bart Van Assche
edcddde130 ib_srpt: Simplify the code for port_num range checking in srpt_event_handler()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4061 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-11 19:15:43 +00:00
Bart Van Assche
5cedc7a926 ib_srpt: Make port number range checking more strict
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4059 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-10 12:47:37 +00:00
Bart Van Assche
68ab66d75a ib_srpt: Introduce ARRAY_SIZE() in srpt_add_one()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4058 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-10 12:30:40 +00:00
Bart Van Assche
b3abcb8f60 ib_srpt: Test procedure update
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4052 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-07 09:34:09 +00:00
Bart Van Assche
2e13c64ff6 ib_srpt: Update test procedure
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4045 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-01 19:26:44 +00:00
Bart Van Assche
f55b8d2fd0 ib_srpt: Avoid using __WARN()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4041 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-29 14:05:02 +00:00
Bart Van Assche
a8ddbf4545 ib_srpt: Correct version number
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4040 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-29 13:32:57 +00:00
Bart Van Assche
a6c36f7795 ib_srpt: Update ChangeLog
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4039 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-29 13:32:05 +00:00
Bart Van Assche
831fe6de2f ib_srpt: Follow-up for r4035
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4036 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-29 12:06:44 +00:00
Bart Van Assche
8b1948c182 ib_srpt: Make the Makefile independent of the location of the SCST directory
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4035 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-29 11:32:17 +00:00
Bart Van Assche
cda113058b ib_srpt: Add "make release-archive" target in Makefile
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4034 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-29 11:21:20 +00:00
Bart Van Assche
d6318a0092 ib_srpt: Reorder statements in Makefile
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4033 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-29 10:39:18 +00:00
Bart Van Assche
393fed29d2 ib_srpt: Log a message when closing a channel because of relogin
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4024 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 09:24:45 +00:00
Bart Van Assche
31403966b6 ib_srpt: Avoid that very rapidly successive logins from the same initiator cause a crash
Fixes this bug report:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000518
IP: [<ffffffff81080112>] __lock_acquire+0x62/0x1d40
PGD 1b226f067 PUD 1b2241067 PMD 0
Oops: 0000 [#1] SMP
CPU 0
Modules linked in: ib_srpt scst_vdisk crc32c libcrc32c scst netconsole configfs snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device af_packet rdma_ucm rdma_cm iw_cm ib_addr ib_ipoib ib_cm ib_sa ib_uverbs ib_umad mlx4_ib ib_mad ib_core microcode cpufreq_co
nservative cpufreq_userspace cpufreq_powersave acpi_cpufreq mperf dm_mod snd_hda_codec_hdmi snd_hda_codec_analog snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_timer snd intel_agp sr_mod mlx4_core sg intel_gtt cdrom i2c_i801 agpgart soundcore i2c_co
re snd_page_alloc pcspkr button uhci_hcd ehci_hcd sd_mod crc_t10dif usbcore edd ext3 mbcache jbd fan ata_generic ata_piix pata_marvell ahci libahci libata scsi_mod thermal processor thermal_sys hwmon

Pid: 4, comm: kworker/0:0 Not tainted 3.1.5-debug+ #1 System manufacturer P5Q DELUXE/P5Q DELUXE
RIP: 0010:[<ffffffff81080112>]  [<ffffffff81080112>] __lock_acquire+0x62/0x1d40
RSP: 0018:ffff8801b50c9950  EFLAGS: 00010046
RAX: 0000000000000046 RBX: 0000000000000518 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000518
RBP: ffff8801b50c9a40 R08: 0000000000000002 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801b50aae20
R13: 0000000000000000 R14: 0000000000000002 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8801bfc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000518 CR3: 00000001b1a4d000 CR4: 00000000000406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process kworker/0:0 (pid: 4, threadinfo ffff8801b50c8000, task ffff8801b50aae20)
Stack:
 0000000000000006 0000000000000001 ffffffff8191ca20 ffff8801b50c99b8
 ffffffff81082cae 0000000000000003 ffff8801b50aae20 0000000000000003
 0000000000000002 0000000000000000 ffff8801b50c9aa0 0000000000000046
Call Trace:
 [<ffffffff81082cae>] ? mark_held_locks+0x6e/0x130
 [<ffffffff810823c5>] lock_acquire+0x95/0x130
 [<ffffffff8103d4ee>] ? try_to_wake_up+0x2e/0x2b0
 [<ffffffff813d618c>] ? _raw_spin_lock_irqsave+0x1c/0x60
 [<ffffffff813d61bb>] _raw_spin_lock_irqsave+0x4b/0x60
 [<ffffffff8103d4ee>] ? try_to_wake_up+0x2e/0x2b0
 [<ffffffff8103d4ee>] try_to_wake_up+0x2e/0x2b0
 [<ffffffff8103d7a5>] wake_up_process+0x15/0x20
 [<ffffffffa0463fda>] srpt_set_ch_state_to_disc+0x5a/0x80 [ib_srpt]
 [<ffffffffa0464016>] __srpt_close_ch+0x16/0xa0 [ib_srpt]
 [<ffffffffa04698e6>] srpt_cm_req_recv+0x806/0xbe0 [ib_srpt]
 [<ffffffffa046ac0d>] srpt_cm_handler+0x7d/0x160 [ib_srpt]
 [<ffffffffa0315c85>] cm_process_work+0x25/0x110 [ib_cm]
 [<ffffffffa031716c>] cm_req_handler+0x67c/0xa00 [ib_cm]
 [<ffffffffa031761d>] cm_work_handler+0x12d/0x1480 [ib_cm]
 [<ffffffff810629c8>] process_one_work+0x198/0x520
 [<ffffffff81062959>] ? process_one_work+0x129/0x520
 [<ffffffffa03174f0>] ? cm_req_handler+0xa00/0xa00 [ib_cm]
 [<ffffffff810646aa>] worker_thread+0x16a/0x350
 [<ffffffff81064540>] ? manage_workers+0x250/0x250
 [<ffffffff81069656>] kthread+0x96/0xa0
 [<ffffffff813e0b74>] kernel_thread_helper+0x4/0x10
 [<ffffffff813d6d9d>] ? retint_restore_args+0xe/0xe
 [<ffffffff810695c0>] ? __init_kthread_worker+0x70/0x70
 [<ffffffff813e0b70>] ? gs_change+0xb/0xb
Code: 25 00 b6 00 00 4c 89 7d f8 85 c9 48 89 fb 45 0f 45 f0 41 89 f5 85 d2 0f 84 44 0d 00 00 8b 05 5a 3a 6f 00 85 c0 0f 84 c6 01 00 00
 8b 03 ba 01 00 00 00 48 3d c0 75 7b 81 44 0f 44 f2 41 83 fd
RIP  [<ffffffff81080112>] __lock_acquire+0x62/0x1d40
 RSP <ffff8801b50c9950>
CR2: 0000000000000518
---[ end trace efbb413a57b805cb ]---


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4020 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-20 20:39:20 +00:00