summaryrefslogtreecommitdiff
path: root/usr.sbin/iscsid
AgeCommit message (Collapse)Author
2014-07-13Set KERN_PROC_NOBROADCASTKILL so that iscsid is not killed by initClaudio Jeker
when terminating multi-user so that we have a chance to sync the file systems mounted via iscsi.
2014-05-10Extend the connection and session FSMs so that connection failure isClaudio Jeker
handled more gracefully. Losing the TCP connection no longer results in an unrecoverable stop requiring a restart of iscsid.
2014-05-10Move the task cleanup from the task fail callback to taskq_cleanup.Claudio Jeker
This makes the one failure callback a lot simpler.
2014-04-21Bind to localAddr if specified and add some XXX comments about stuffClaudio Jeker
that is not prefect yet.
2014-04-21Start passing the initiator and target name in the show command.Claudio Jeker
2014-04-21Redo most of the control message handling. Switch it back to useClaudio Jeker
SOCK_SEQPACKET and provide functions to build the control messages that can also be used by iscsictl.
2014-04-21Handle EAGAIN, ENOBUFS and EINTR a bit better. Ignore them one layer aboveClaudio Jeker
and do not fail and tear down the world when they happen.
2014-04-21It is possible that we can't burst all of the data in the immediate dataClaudio Jeker
part of the write request. In that case R2T requests with be sent for the rest of the data. The amount of data we can send is defined by MaxRecvDataSegmentLength which is per connection and so a bit hackish to read out. In the long run the min() of all connection MaxRecvDataSegmentLength should be stored in the session struct.
2014-04-21Now that we properly negotiate the session params we can enable sendingClaudio Jeker
of immediate data for write commands. This gives a nice 20% performance boost on writes compared to the solicited data transaction we did before.
2014-04-20Introduce some basic stats for the vscsi layer. Just counting the commandsClaudio Jeker
and the bytes we push through vscsi(4).
2014-04-20After doing all of the loging dance to get the target's params it makesClaudio Jeker
sense to merge them into the active set. At least that way we run with the right params and finally do reads and writes that are > 8k.
2014-04-20Use only one style for "return foo;"Claudio Jeker
2014-04-20Move session params initialization to when we start a session and notClaudio Jeker
when it is created. That way the config params from the config file have a chance to stick.
2014-04-20Fix conn_gen_kvp and its caller to fill the kvp array properly (includingClaudio Jeker
the NULL terminator at the end). Now iscsid does proper LoginOperational negotiation (which will bump the MaxRecvDataSegmentLength to 64k)
2014-04-20Cleanup a bit, switch on bcopy to memcpy and move a function a bit upClaudio Jeker
2014-04-19COnveret the bcopy() to memcpy()Claudio Jeker
2014-04-19Replace a magic number.Claudio Jeker
2014-04-07To win the startup race on the control socket we need to listen to it asClaudio Jeker
well only then the connect() call from iscsictl will not fail. Move listen() into the init function and rename control_listen() to control_event_init() since it is now only doing that.
2014-02-17Call control_init() before daemon() so that iscsid && iscsictl reload worksClaudio Jeker
2013-08-14no longer any need to quote macro lines with >9 args;Jason McIntyre
From: Jan Stary
2013-07-16use .Mt for email addresses; from Jan Stary <hans at stare dot cz>; ok jmc@Ingo Schwarze
2013-03-11handle ECONNABORTED errors from accept(). In many code blocks they can beTheo de Raadt
ignored silently and without aborting, much like EINTR and EWOULDBLOCK are. ok's from various maintainers of these directories...
2012-09-26last stage of rfc changes, using consistent Rs/Re blocks, and moving theJason McIntyre
references into a STANDARDS section;
2012-06-26tweak previous;Jason McIntyre
2012-06-26There is a iscsi.conf man page now. Reminded by jmc@Claudio Jeker
2012-04-11accept() pacing on the control socket if E*FILE errors are returned.Claudio Jeker
Based on work by Theo for ospfd and friends. OK deraadt@
2011-08-20Add support for -v (enable verbose logging on the command line).Stuart Henderson
Previously only available via iscsictl. ok claudio@
2011-05-04Massive diff to handle logins more correctly. iscsid will now doClaudio Jeker
better operational parameter negotiation but more is needed. Tested by todd@ and myself.
2011-05-02Rework the logout code and use this to do a proper logout whenClaudio Jeker
exiting. This works well for idle sessions but still has some issues on busy session. It seems more task scheduler changes are needed to make this work. This also includes some mem-leak fixes in error pathes found by Igor Zinovik. go for it dlg@
2011-04-28Try to schedule a new task for the connection in conn_task_cleanup()Claudio Jeker
this removes the session_schedule() in the task_pdu_cb().
2011-04-28DATA OUT operations need to be piggibacked on the same connection asClaudio Jeker
the initial SCSI REQUEST so use conn_task_issue() in vscsi_dataout().
2011-04-27Implement CTRL_LOG_VERBOSE to toggle log verbosity.Claudio Jeker
2011-04-27Rename task_cleanup() to conn_task_cleanup() seems a better place forClaudio Jeker
this function since it does connections scheduling.
2011-04-27Add log_verbose() like all the other log.c users.Claudio Jeker
2011-04-27Start implementing the FSM. Introduce a session FSM that is run via aClaudio Jeker
callback and implement some of the connection FSM actions. Implement logouts so that discovery sessions do a nice login -> query -> logout. Fix the task scheduling especially for immediate and connection specific tasks. The session will now only schedule tasks to a session that is in LOGGED_IN state. looks good dlg@
2011-04-05Move session related code into session.c.Claudio Jeker
2011-04-05Log the SessionName so that it is possible to understand which sessionClaudio Jeker
caused the problem.
2011-01-10Remove 2 empty lines.Claudio Jeker
2011-01-06Ugly hack, call session_schedule in the task pdu callback handler.Claudio Jeker
Without this accessing both LU on my iscsi target will lock up because tasks a queued but no longer scheduled. We need a better task scheduler but this allows me to run iogen on both partitions without locking up.
2011-01-06Pass the magic LUN -1 to VSCSI_REQPROBE so that all LU are probedClaudio Jeker
by the midlayer. With help from dlg@
2011-01-06Add minimal LUN handling. Currently only single level LUN addressing isClaudio Jeker
supported because the vscsi ioctl interface is limited to that. Seems to work according to my iscsi target having 2 units per target. OK dlg@
2011-01-04Implememnt NOP-IN -> NOP-OUT handling. If the NOP-In was issued by theClaudio Jeker
target (itt = 0xffffffff) send back an immediate NOP-Out reusing the NOP-In PDU. This makes my iscsi target happy. Also plug a mem leak on error path which was found by Igor Zinovik.
2011-01-04Cleanup tasks with a NULL callback after queuing the PDU to be sent out.Claudio Jeker
This allows immediate responses (e.g. NOP-out) to be issued with a task instead of very special code. Also set expstatsn on all PDU that carry it.
2011-01-04Reset the resid before issuing the task callback so that the pdu canClaudio Jeker
be reused for sending out a message. This will be used soon for NOP handling.
2011-01-04Print itt, cmdsn and expstatsn as unsigned when printing a PDU.Claudio Jeker
2011-01-04Truncate the scsi sense data to 18 bytes if more data was supplied.Claudio Jeker
dlg@ said it is OK to do that since the additional data is optional. My connection to the iscsi target sending 64byte sense data is now much happier.
2011-01-04When translating a PDU to text strip all trailing \0 but one.Claudio Jeker
Fixes parsing of login responses that had additional padding.
2011-01-04Log the PDU which failed because no task was found.Claudio Jeker
Should help identify the messages that are issued by the target (e.g. NOP).
2011-01-04Add missing session parameter.Claudio Jeker
2010-09-25spacing, no binary changes.Igor Sobrado