@@ -402,6 +402,26 @@ static int is_enabled_by_rules_file(struct target_details *target)
}
+static bool use_imm_data(void)
+{
+ bool ret = false;
+ char flag = 0;
+ int cnt;
+ int fd = open("/sys/module/ib_srp/parameters/has_max_it_iu_size", O_RDONLY);
+
+ if (fd < 0)
+ return false;
+ cnt = read(fd, &flag, 1);
+ if (cnt != 1) {
+ close(fd);
+ return false;
+ }
+
+ if (!strncmp(&flag, "Y", 1))
+ ret = true;
+ close(fd);
+ return ret;
+}
static int add_non_exist_target(struct target_details *target)
{
@@ -581,6 +601,19 @@ static int add_non_exist_target(struct target_details *target)
}
}
+ if (use_imm_data()) {
+ len += snprintf(target_config_str+len,
+ sizeof(target_config_str) - len,
+ ",max_it_iu_size=%d",
+ be32toh(target->ioc_prof.send_size));
+
+ if (len >= sizeof(target_config_str)) {
+ pr_err("Target config string is too long, ignoring target\n");
+ closedir(dir);
+ return -1;
+ }
+ }
+
target_config_str[len] = '\0';
pr_cmd(target_config_str, not_connected);
@@ -1360,6 +1393,10 @@ static void print_config(struct config_t *conf)
printf(" Print initiator_ext\n");
else
printf(" Do not print initiator_ext\n");
+ if (use_imm_data())
+ printf(" Print maximum initiator to target IU size\n");
+ else
+ printf(" Do not print maximum initiator to target IU size\n");
if (conf->recalc_time)
printf(" Performs full target rescan every %d seconds\n", conf->recalc_time);
else