Commit Graph

105 Commits

Author SHA1 Message Date
thorpej f3b8515c0f Sync with HEAD. 2021-04-03 22:28:12 +00:00
chs b906de5d01 avoid the use of UVM internals in the iscsi ioctl code.
copyin/out are fine in this context.
2020-06-21 23:08:16 +00:00
kamil 9f15ed54af Catch up with the usage of struct vmspace::vm_refcnt
Use the dedicated reference counting routines.

Change the type of struct vmspace::vm_refcnt and struct vm_map::ref_count
to volatile.

Remove the unnecessary vm->vm_map.misc_lock locking in process_domem().

Reviewed by <ad>
2020-05-26 00:50:53 +00:00
jdolecek 75014c5064 make the iscsi attached message aprint_verbose(), no need to show normally 2020-05-13 21:59:45 +00:00
chs 02991323a4 in many device attach paths, allocate memory with KM_SLEEP instead of KM_NOSLEEP
and remove code to handle failures that can no longer happen.
2019-10-01 18:00:07 +00:00
pgoyette 97b627eca5 Many years ago someone created a new __link_set_sysctl_funcs to hold
the list of routines that need to be called for setting up sysctl
variables.  This worked great for all code included in the kernel
itself, but didn't deal with modules that want to create their own
sysctl data.  So, we ended up with a lot of #ifdef _MODULE blocks
so modules could explicitly call their setup functions when loaded
as non-built-in modules.

So today, we complete the task that was started so many years ago.

When modules are loaded, after we've called xxx_modcmd(INIT...) we
check if the module contains its own __link_set_sysctl_funcs, and
if so we call the functions listed.  We add a struct sysctllog member
to the struct module so we can call sysctl_teardown() when the module
gets unloaded.  (The sequence of events ensures that the sysctl stuff
doesn't get created until the rest of the module's init code does any
required memory allocation.)

So, no more need to explicitly call the sysctl setup routines when
built as a loadable module.
2019-08-07 00:38:01 +00:00
mlelstv eea8587cd3 register with pmf to allow suspend. 2019-07-13 17:06:00 +00:00
maya f93d65267a wether -> whether 2019-04-21 11:45:08 +00:00
mlelstv f1a7fa8c8a Replace build option to enable hex encoded bignum parameters with a sysctl. 2019-04-21 11:26:46 +00:00
kamil 894a43424d Fix CVS Id
NFCI
2019-04-11 11:40:58 +00:00
msaitoh 25629ef49d Fix typo in comment (s/numer/number/). 2019-04-01 06:20:40 +00:00
mrg cdf28a3078 fix FALLTRHOUGH spell-o. 2019-02-01 08:33:29 +00:00
mlelstv 40d825b97a interlock isn't taken when cleaning up. 2018-12-07 14:59:19 +00:00
mlelstv 7143608235 Return temporary errors when the session is trying to recover the last
connection. The scsipi layer will retry.
2018-03-04 07:39:45 +00:00
mlelstv 888922af0f Add sanity check. 2018-03-04 07:37:43 +00:00
ozaki-r 7475694f27 Fix typo 2017-12-06 04:29:58 +00:00
christos 8ab41cb9c8 - add a prefix to struct members (but not the ioctl ones because they affect
the API)
- use consistent variable names.
2017-12-03 19:07:10 +00:00
mlelstv 67cf3e04f7 unreference session only for responses to SCSI commands. 2017-12-03 07:24:47 +00:00
mlelstv 8add5d8468 use same lock for ref/deref. 2017-12-03 07:23:45 +00:00
mlelstv 501f6ddfbf add debug messages 2017-12-03 07:23:12 +00:00
christos ea05286d92 add fo_name so we can identify the fileops in a simple way. 2017-11-30 20:25:54 +00:00
mlelstv 0b6b65ff23 Fix session cleanup. 2017-06-24 11:31:26 +00:00
maya e0c33d5694 Remove redundant duplicate assignment.
from clang static analyzer
2017-04-18 17:28:18 +00:00
mlelstv 7442aaf8ef Use correct lock for session wakeup. 2017-02-25 12:03:57 +00:00
mlelstv 61e95c24aa Destroy callouts when cleaning up. 2017-02-05 12:05:46 +00:00
mlelstv 015f574c37 Lock correctly around CV calls.
Fix handling of session termination.
Enable MPSAFE processing for scsipi.
2016-12-25 06:55:28 +00:00
mlelstv d48455317c Work around an issue with MSG_WAITALL that would block for too long by
replacing it with a receive loop.
2016-06-15 04:33:52 +00:00
mlelstv bbe94f43d2 Remove throttling code, instead signal scsipi layer to reduce the openings
and retry the command. Start with a small openings number and let scsipi
request to grow it up to the current send window.

Adjust ccb and pdu counts to avoid ressource shortages. These are still
very ad-hoc numbers, but seem to be sufficient for a Gigabit link.

Use separate condvar for PDU pool and add counter to help debugging.

Revert setting PDU disposition to UNUSED before freeing. free_pdu
uses this as a flag to detect already returned PDUs.

Add reference counter for open commands to defer unmapping a session
that would lead to crashes in scsipi.

Move session cleanup to cleanup thread.

Use get_sernum to retrieve current serial number where possible and
make it check for immediate commands itself.

Adjust debug output.
2016-06-15 04:30:30 +00:00
mlelstv ae0ee83b73 drop unused debug helper routine 2016-06-15 03:51:55 +00:00
mlelstv e27d88e376 Fix field name in response pdu. 2016-06-15 03:40:59 +00:00
mlelstv eafa082213 use correct comparison of serial numbers 2016-06-05 15:04:31 +00:00
mlelstv 35a1d99d03 Don't resume throttled CCBs when connection is terminating, except for
those being actively waited for. Stop unthrottling when reaching MaxCmdSN
again.
2016-06-05 14:00:12 +00:00
mlelstv 3e27116260 Handle freeing of PDU when referencing CCB is freed. 2016-06-05 13:54:28 +00:00
mlelstv 7465018a7b More debug output. Dump pending CCBs when cleaning up. 2016-06-05 13:45:56 +00:00
mlelstv 7b7c8b93ad more debug output 2016-06-05 11:01:39 +00:00
mlelstv 62f45d0b81 acquire session lock when changing throttling queue 2016-06-05 09:21:14 +00:00
mlelstv 6bd66ce750 wrong assertion. 2016-06-05 09:12:48 +00:00
mlelstv c13976ae8f Need session mutex to read serial number. 2016-06-05 09:09:57 +00:00
mlelstv 3f22eb9b95 initialize before check. 2016-06-05 09:03:10 +00:00
mlelstv 7610d4bd71 appease compiler 2016-06-05 08:30:13 +00:00
mlelstv 44d00f8ce2 Add missing mutex_exit(). 2016-06-05 06:19:59 +00:00
mlelstv 3e2f1d8997 ensure that timeout counter is cleared when ccb is (re-)used. 2016-06-05 05:41:53 +00:00
mlelstv aba29f3a78 Whitespace, braces. 2016-06-05 05:40:29 +00:00
mlelstv 334be04930 Replace the simple tag counter with the command tag coming down from scsipi.
Also set attributes according to tag types.
2016-06-05 05:36:57 +00:00
mlelstv 530dbb3782 No need to acquire KERNEL_LOCK when entering network code.
Also use the socket callbacks.
2016-06-05 05:31:43 +00:00
mlelstv 36dadbea16 Keep 1 CCB free for private use. This avoids frequent recovery in scsipi when
resources appear to be exhausted.
2016-06-05 05:29:01 +00:00
mlelstv 68dc548575 Make PDU init routines record serial number in CCB too. 2016-06-05 05:25:59 +00:00
mlelstv aac72e4bc4 Fix locking for pdu flags here, in particular PDUF_INQUEUE. 2016-06-05 05:18:58 +00:00
mlelstv febd01647c Handle ExpCmdSN and MaxCmdSN updates as specified. Don't compare
serial numbers as integers.
2016-06-05 05:11:57 +00:00
mlelstv d5741a228e Fix serial number check and account for commands in flight to avoid
unnecessary recovery actions.
2016-06-05 05:07:23 +00:00