diff options
author | Chris Leech <cleech@redhat.com> | 2016-01-29 14:43:42 -0800 |
---|---|---|
committer | Mike Christie <mchristi@redhat.com> | 2016-02-01 11:31:31 -0600 |
commit | 4c1f2d90ef1c73e33d9f1e4ae9c206ffe015a8f9 (patch) | |
tree | 5af143b977ee8ef553f47d7bdf8dde8e826457f5 /usr | |
parent | 0fa43f292d1e2a55ebd874e6a5b4444b886ee9fe (diff) | |
download | open-iscsi-4c1f2d90ef1c73e33d9f1e4ae9c206ffe015a8f9.tar.gz |
make use of all 24 bits of ISID qualifier space
For some reason, our ISID has only ever had 8-bits of uniqueness. We
use the OUI format, which leaves 24-bits of qualifier space that we
could be using.
This simple change uses the lower 24-bits bits of our 32-bit session id.
I've tested this using multiple sessions to a single target portal.
Previously ISIDs would start to be reused after 256 connections, causing
the target to disconnect existing sessions where there was a collision.
With this I can maintain 2048 stable TCP connections to a single target
portal. I tried 4096, but something went wrong with 4027 active sessions
and I'm not sure where the issue was yet.
CC: shiva krishna merla <shivakrishna.merla@gmail.com>
Signed-off-by: Chris Leech <cleech@redhat.com>
Diffstat (limited to 'usr')
-rw-r--r-- | usr/discovery.c | 4 | ||||
-rw-r--r-- | usr/initiator.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/usr/discovery.c b/usr/discovery.c index 43c2359..593d226 100644 --- a/usr/discovery.c +++ b/usr/discovery.c @@ -1152,7 +1152,9 @@ static int iscsi_create_leading_conn(struct iscsi_session *session) } log_debug(2, "%s discovery created session %u", __FUNCTION__, session->id); - session->isid[3] = session->id; + session->isid[3] = (session->id >> 16) & 0xff; + session->isid[4] = (session->id >> 8) & 0xff; + session->isid[5] = session->id & 0xff; log_debug(2, "%s discovery create conn", __FUNCTION__); rc = ipc->create_conn(t->handle, session->id, conn->id, &conn->id); diff --git a/usr/initiator.c b/usr/initiator.c index efaa965..8cd1896 100644 --- a/usr/initiator.c +++ b/usr/initiator.c @@ -1571,7 +1571,9 @@ static void session_conn_poll(void *data) * TODO: use the iface number or some other value * so this will be persistent */ - session->isid[3] = session->id; + session->isid[3] = (session->id >> 16) & 0xff; + session->isid[4] = (session->id >> 8) & 0xff; + session->isid[5] = session->id & 0xff; if (ipc->bind_conn(session->t->handle, session->id, conn->id, conn->transport_ep_handle, |