diff options
author | trasz <trasz@FreeBSD.org> | 2015-02-06 21:03:25 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-02-06 21:03:25 +0000 |
commit | ba70dc0f4deacb9392d178bd7b48c20556486a5c (patch) | |
tree | 87c429dd203f72c20ec2b1a4649579aab5189db6 /usr.sbin/ctld/ctld.c | |
parent | 83fb4b4e9bdce5fa574089d1a3272a152b4a4a18 (diff) | |
download | FreeBSD-src-ba70dc0f4deacb9392d178bd7b48c20556486a5c.zip FreeBSD-src-ba70dc0f4deacb9392d178bd7b48c20556486a5c.tar.gz |
Make it possible to set (via ctl.conf(5)) and query (via ctladm islist -v)
target iSCSI offload. Add mechanism to query maximum receive data segment
size supported by chosen hardware offload module, and use it in ctld(8)
to determine the value to advertise to the other side.
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin/ctld/ctld.c')
-rw-r--r-- | usr.sbin/ctld/ctld.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 513e073..dd864b9 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1272,6 +1272,22 @@ target_set_redirection(struct target *target, const char *addr) return (0); } +int +target_set_offload(struct target *target, const char *offload) +{ + + if (target->t_offload != NULL) { + log_warnx("cannot set offload to \"%s\" for " + "target \"%s\"; already defined", + offload, target->t_name); + return (1); + } + + target->t_offload = checked_strdup(offload); + + return (0); +} + struct lun * lun_new(struct conf *conf, const char *name) { @@ -1514,6 +1530,8 @@ conf_print(struct conf *conf) fprintf(stderr, "target %s {\n", targ->t_name); if (targ->t_alias != NULL) fprintf(stderr, "\t alias %s\n", targ->t_alias); + if (targ->t_offload != NULL) + fprintf(stderr, "\t offload %s\n", targ->t_offload); fprintf(stderr, "}\n"); } } |