diff options
author | dmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6> | 2005-09-13 16:53:53 +0000 |
---|---|---|
committer | dmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6> | 2005-09-13 16:53:53 +0000 |
commit | 19042512104127fc651851992e92090b73500cab (patch) | |
tree | b05dace00ae238f5b8b83d0fce69c8b499e0cf8f /usr | |
parent | b5b99e6b79d7c99a451fe404e503282747dcd592 (diff) | |
download | open-iscsi-19042512104127fc651851992e92090b73500cab.tar.gz |
Erez Zilber: AF and RDMA provider properties
git-svn-id: svn://svn.berlios.de/open-iscsi@410 d7303112-9cec-0310-bdd2-e83a94d6c2b6
Diffstat (limited to 'usr')
-rw-r--r-- | usr/initiator.c | 5 | ||||
-rw-r--r-- | usr/initiator.h | 33 | ||||
-rw-r--r-- | usr/ioctl.c | 2 | ||||
-rw-r--r-- | usr/netlink.c | 14 |
4 files changed, 39 insertions, 15 deletions
diff --git a/usr/initiator.c b/usr/initiator.c index 3a16b86..1cd7a84 100644 --- a/usr/initiator.c +++ b/usr/initiator.c @@ -437,6 +437,10 @@ __session_conn_create(iscsi_session_t *session, int cid) conn_rec->address, host); } + /* Set the address family according to the value + that was received from a specific provider */ + conn->saddr.ss_family = session->provider->af; + conn->state = STATE_FREE; conn->session = session; @@ -465,6 +469,7 @@ __session_create(node_rec_t *rec, iscsi_provider_t *provider) /* opened at daemon load time (iscsid.c) */ session->ctrl_fd = control_fd; session->transport_handle = provider->handle; + session->provider = provider; /* save node record. we might need it for redirection */ memcpy(&session->nrec, rec, sizeof(node_rec_t)); diff --git a/usr/initiator.h b/usr/initiator.h index b3b3c54..d533181 100644 --- a/usr/initiator.h +++ b/usr/initiator.h @@ -209,12 +209,30 @@ typedef struct queue_task { } u; } queue_task_t; +typedef enum iscsi_provider_status_e { + PROVIDER_STATUS_UNKNOWN = 0, + PROVIDER_STATUS_OPERATIONAL = 1, + PROVIDER_STATUS_FAILED = 2, +} iscsi_provider_status_e; + +/* represents data path provider */ +typedef struct iscsi_provider_t { + uint64_t handle; + uint32_t caps; + unsigned short af; + unsigned short rdma; + iscsi_provider_status_e status; + char name[ISCSI_TRANSPORT_NAME_MAXLEN]; + struct qelem sessions; +} iscsi_provider_t; + /* daemon's session structure */ typedef struct iscsi_session { struct qelem item; /* must stay at the top */ uint32_t id; uint64_t transport_handle; uint64_t handle; + iscsi_provider_t *provider; node_rec_t nrec; /* copy of original Node record in database */ int vendor_specific_keys; unsigned int irrelevant_keys_bitmap; @@ -271,21 +289,6 @@ typedef struct iscsi_session { queue_t *queue; } iscsi_session_t; -typedef enum iscsi_provider_status_e { - PROVIDER_STATUS_UNKNOWN = 0, - PROVIDER_STATUS_OPERATIONAL = 1, - PROVIDER_STATUS_FAILED = 2, -} iscsi_provider_status_e; - -/* represents data path provider */ -typedef struct iscsi_provider_t { - uint64_t handle; - uint32_t caps; - iscsi_provider_status_e status; - char name[ISCSI_TRANSPORT_NAME_MAXLEN]; - struct qelem sessions; -} iscsi_provider_t; - /* iscsid.c */ extern iscsi_provider_t provider[ISCSI_TRANSPORT_MAX]; diff --git a/usr/ioctl.c b/usr/ioctl.c index 28ad4c3..df42f38 100644 --- a/usr/ioctl.c +++ b/usr/ioctl.c @@ -404,6 +404,8 @@ ktrans_list(void) strncpy(provider[i].name, ev.r.t_list.elements[i].name, ISCSI_TRANSPORT_NAME_MAXLEN); provider[i].caps = ev.r.t_list.elements[i].caps; + provider[i].af = ev.r.t_list.elements[i].af; + provider[i].rdma = ev.r.t_list.elements[i].rdma; } } return 0; diff --git a/usr/netlink.c b/usr/netlink.c index a82af6e..3687d63 100644 --- a/usr/netlink.c +++ b/usr/netlink.c @@ -666,6 +666,20 @@ ktrans_list(void) "0x%x"); if (err) break; + + sprintf(filename, ISCSI_TRANSPORT_DIR"/%s/af", + provider[i].name); + err = read_transport_file(filename, &provider[i].af, + "%u"); + if (err) + break; + + sprintf(filename, ISCSI_TRANSPORT_DIR"/%s/rdma", + provider[i].name); + err = read_transport_file(filename, &provider[i].rdma, + "%u"); + if (err) + break; } for (i++; i < n; i++) |