Report negotiated MaxBurstLength and FirstBurstLength in "iscsictl -v"

and "ctladm islist -v" outputs.

MFC after:	1 month
This commit is contained in:
trasz 2016-06-05 08:48:37 +00:00
parent e8a86f6b00
commit c29ddfe43a
9 changed files with 27 additions and 5 deletions

View File

@ -1514,6 +1514,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
cs->cs_statsn = cihp->statsn;
cs->cs_max_data_segment_length = cihp->max_recv_data_segment_length;
cs->cs_max_burst_length = cihp->max_burst_length;
cs->cs_first_burst_length = cihp->first_burst_length;
cs->cs_immediate_data = !!cihp->immediate_data;
if (cihp->header_digest == CTL_ISCSI_DIGEST_CRC32C)
cs->cs_conn->ic_header_crc32c = true;
@ -1652,6 +1653,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci)
"<header_digest>%s</header_digest>"
"<data_digest>%s</data_digest>"
"<max_data_segment_length>%zd</max_data_segment_length>"
"<max_burst_length>%zd</max_burst_length>"
"<first_burst_length>%zd</first_burst_length>"
"<immediate_data>%d</immediate_data>"
"<iser>%d</iser>"
"<offload>%s</offload>"
@ -1663,6 +1666,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci)
cs->cs_conn->ic_header_crc32c ? "CRC32C" : "None",
cs->cs_conn->ic_data_crc32c ? "CRC32C" : "None",
cs->cs_max_data_segment_length,
cs->cs_max_burst_length,
cs->cs_first_burst_length,
cs->cs_immediate_data,
cs->cs_conn->ic_iser,
cs->cs_conn->ic_offload);

View File

@ -86,6 +86,7 @@ struct cfiscsi_session {
bool cs_tasks_aborted;
size_t cs_max_data_segment_length;
size_t cs_max_burst_length;
size_t cs_first_burst_length;
bool cs_immediate_data;
char cs_initiator_name[CTL_ISCSI_NAME_LEN];
char cs_initiator_addr[CTL_ISCSI_ADDR_LEN];

View File

@ -1934,6 +1934,8 @@ iscsi_ioctl_session_list(struct iscsi_softc *sc, struct iscsi_session_list *isl)
iss.iss_data_digest = ISCSI_DIGEST_NONE;
iss.iss_max_data_segment_length = is->is_max_data_segment_length;
iss.iss_max_burst_length = is->is_max_burst_length;
iss.iss_first_burst_length = is->is_first_burst_length;
iss.iss_immediate_data = is->is_immediate_data;
iss.iss_connected = is->is_connected;

View File

@ -93,7 +93,8 @@ struct iscsi_session_state {
int iss_connected;
char iss_reason[ISCSI_REASON_LEN];
char iss_offload[ISCSI_OFFLOAD_LEN];
int iss_spare[2];
int iss_max_burst_length;
int iss_first_burst_length;
};
/*

View File

@ -567,6 +567,10 @@ kernel_list(int iscsi_fd, const struct target *targ __unused,
"CRC32C" : "None");
xo_emit("{L:/%-18s}{V:dataSegmentLen/%d}\n",
"DataSegmentLen:", state->iss_max_data_segment_length);
xo_emit("{L:/%-18s}{V:maxBurstLen/%d}\n",
"MaxBurstLen:", state->iss_max_burst_length);
xo_emit("{L:/%-18s}{V:firstBurstLen/%d}\n",
"FirstBurstLen:", state->iss_first_burst_length);
xo_emit("{L:/%-18s}{V:immediateData/%s}\n",
"ImmediateData:", state->iss_immediate_data ? "Yes" : "No");
xo_emit("{L:/%-18s}{V:iSER/%s}\n",

View File

@ -2795,6 +2795,8 @@ struct cctl_islist_conn {
char *header_digest;
char *data_digest;
char *max_data_segment_length;;
char *max_burst_length;;
char *first_burst_length;;
char *offload;;
int immediate_data;
int iser;
@ -2909,6 +2911,12 @@ cctl_islist_end_element(void *user_data, const char *name)
} else if (strcmp(name, "max_data_segment_length") == 0) {
cur_conn->max_data_segment_length = str;
str = NULL;
} else if (strcmp(name, "max_burst_length") == 0) {
cur_conn->max_burst_length = str;
str = NULL;
} else if (strcmp(name, "first_burst_length") == 0) {
cur_conn->first_burst_length = str;
str = NULL;
} else if (strcmp(name, "offload") == 0) {
cur_conn->offload = str;
str = NULL;
@ -3031,6 +3039,8 @@ cctl_islist(int fd, int argc, char **argv, char *combinedopt)
printf("Header digest: %s\n", conn->header_digest);
printf("Data digest: %s\n", conn->data_digest);
printf("DataSegmentLen: %s\n", conn->max_data_segment_length);
printf("MaxBurstLen: %s\n", conn->max_burst_length);
printf("FirstBurstLen: %s\n", conn->first_burst_length);
printf("ImmediateData: %s\n", conn->immediate_data ? "Yes" : "No");
printf("iSER (RDMA): %s\n", conn->iser ? "Yes" : "No");
printf("Offload driver: %s\n", conn->offload);

View File

@ -244,6 +244,7 @@ struct connection {
size_t conn_data_segment_limit;
size_t conn_max_data_segment_length;
size_t conn_max_burst_length;
size_t conn_first_burst_length;
int conn_immediate_data;
int conn_header_digest;
int conn_data_digest;

View File

@ -900,6 +900,7 @@ kernel_handoff(struct connection *conn)
req.data.handoff.max_recv_data_segment_length =
conn->conn_max_data_segment_length;
req.data.handoff.max_burst_length = conn->conn_max_burst_length;
req.data.handoff.first_burst_length = conn->conn_first_burst_length;
req.data.handoff.immediate_data = conn->conn_immediate_data;
if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) {

View File

@ -582,10 +582,7 @@ login_negotiate_key(struct pdu *request, const char *name,
tmp, conn->conn_data_segment_limit);
tmp = conn->conn_data_segment_limit;
}
/*
* We don't pass the value to the kernel; it only enforces
* hardcoded limit anyway.
*/
conn->conn_first_burst_length = tmp;
keys_add_int(response_keys, name, tmp);
} else if (strcmp(name, "DefaultTime2Wait") == 0) {
keys_add(response_keys, name, value);