summaryrefslogtreecommitdiffstats
path: root/usr.bin/iscsictl
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-02-05 06:37:59 +0000
committertrasz <trasz@FreeBSD.org>2015-02-05 06:37:59 +0000
commite9295a0f2d24e7af6336d08da5937b029fb9f3b5 (patch)
tree20fba2173fa09918784fa0c8342c8e206d67f763 /usr.bin/iscsictl
parent607b4e91ba9ae6ed7256bed8b120415048f66643 (diff)
downloadFreeBSD-src-e9295a0f2d24e7af6336d08da5937b029fb9f3b5.zip
FreeBSD-src-e9295a0f2d24e7af6336d08da5937b029fb9f3b5.tar.gz
Make it possible to set (via iscsi.conf(5)) and query (via iscsictl -v)
initiator iSCSI offload. Pass maximum data segment size supported by chosen offload module to iscsid(8), and make iscsid(8) not try to negotiate anything larger than that. MFC after: 1 month Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.bin/iscsictl')
-rw-r--r--usr.bin/iscsictl/iscsi.conf.54
-rw-r--r--usr.bin/iscsictl/iscsictl.c4
-rw-r--r--usr.bin/iscsictl/iscsictl.h1
-rw-r--r--usr.bin/iscsictl/parse.y14
-rw-r--r--usr.bin/iscsictl/token.l1
5 files changed, 21 insertions, 3 deletions
diff --git a/usr.bin/iscsictl/iscsi.conf.5 b/usr.bin/iscsictl/iscsi.conf.5
index 0343385..c0c326a 100644
--- a/usr.bin/iscsictl/iscsi.conf.5
+++ b/usr.bin/iscsictl/iscsi.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 17, 2013
+.Dd February 4, 2015
.Dt ISCSI.CONF 5
.Os
.Sh NAME
@@ -110,6 +110,8 @@ flag of
The following are not specified in the
.Sy RFC 3720
.Bl -tag -width sockbufsize
+.It Cm offload
+Name of selected iSCSI hardware offload driver.
.It Cm port
The iSCSI port used by the iSCSI protocol, defaults to 3260.
.It Cm tags
diff --git a/usr.bin/iscsictl/iscsictl.c b/usr.bin/iscsictl/iscsictl.c
index a27e32b..e6abf93 100644
--- a/usr.bin/iscsictl/iscsictl.c
+++ b/usr.bin/iscsictl/iscsictl.c
@@ -327,6 +327,9 @@ conf_from_target(struct iscsi_session_conf *conf,
conf->isc_discovery = 1;
if (targ->t_protocol == PROTOCOL_ISER)
conf->isc_iser = 1;
+ if (targ->t_offload != NULL)
+ strlcpy(conf->isc_offload, targ->t_offload,
+ sizeof(conf->isc_offload));
if (targ->t_header_digest == DIGEST_CRC32C)
conf->isc_header_digest = ISCSI_DIGEST_CRC32C;
else
@@ -517,6 +520,7 @@ kernel_list(int iscsi_fd, const struct target *targ __unused,
state->iss_immediate_data ? "Yes" : "No");
printf("iSER (RDMA): %s\n",
conf->isc_iser ? "Yes" : "No");
+ printf("Offload driver: %s\n", state->iss_offload);
printf("Device nodes: ");
print_periphs(state->iss_id);
printf("\n\n");
diff --git a/usr.bin/iscsictl/iscsictl.h b/usr.bin/iscsictl/iscsictl.h
index e8d4768..727e8ae 100644
--- a/usr.bin/iscsictl/iscsictl.h
+++ b/usr.bin/iscsictl/iscsictl.h
@@ -72,6 +72,7 @@ struct target {
int t_auth_method;
int t_session_type;
int t_protocol;
+ char *t_offload;
char *t_user;
char *t_secret;
char *t_mutual_user;
diff --git a/usr.bin/iscsictl/parse.y b/usr.bin/iscsictl/parse.y
index e6343f8..7beb53e 100644
--- a/usr.bin/iscsictl/parse.y
+++ b/usr.bin/iscsictl/parse.y
@@ -57,8 +57,8 @@ extern void yyrestart(FILE *);
%token AUTH_METHOD HEADER_DIGEST DATA_DIGEST TARGET_NAME TARGET_ADDRESS
%token INITIATOR_NAME INITIATOR_ADDRESS INITIATOR_ALIAS USER SECRET
-%token MUTUAL_USER MUTUAL_SECRET SEMICOLON SESSION_TYPE PROTOCOL IGNORED
-%token EQUALS OPENING_BRACKET CLOSING_BRACKET
+%token MUTUAL_USER MUTUAL_SECRET SEMICOLON SESSION_TYPE PROTOCOL OFFLOAD
+%token IGNORED EQUALS OPENING_BRACKET CLOSING_BRACKET
%union
{
@@ -117,6 +117,8 @@ target_entry:
|
session_type
|
+ offload
+ |
protocol
|
ignored
@@ -250,6 +252,14 @@ session_type: SESSION_TYPE EQUALS STR
}
;
+offload: OFFLOAD EQUALS STR
+ {
+ if (target->t_offload != NULL)
+ errx(1, "duplicated offload at line %d", lineno);
+ target->t_offload = $3;
+ }
+ ;
+
protocol: PROTOCOL EQUALS STR
{
if (target->t_protocol != PROTOCOL_UNSPECIFIED)
diff --git a/usr.bin/iscsictl/token.l b/usr.bin/iscsictl/token.l
index 06af167..8cf2fec 100644
--- a/usr.bin/iscsictl/token.l
+++ b/usr.bin/iscsictl/token.l
@@ -63,6 +63,7 @@ tgtChapSecret { return MUTUAL_SECRET; }
AuthMethod { return AUTH_METHOD; }
SessionType { return SESSION_TYPE; }
protocol { return PROTOCOL; }
+offload { return OFFLOAD; }
port { return IGNORED; }
MaxConnections { return IGNORED; }
TargetAlias { return IGNORED; }
OpenPOWER on IntegriCloud