mirror of
https://github.com/SCST-project/scst.git
synced 2026-07-20 06:52:18 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -196,7 +196,7 @@ clean:
|
||||
@if [ -d $(EMULEX_DIR) ]; then cd $(EMULEX_DIR) && $(MAKE) $@; fi
|
||||
|
||||
extraclean:
|
||||
-rm -f TAGS
|
||||
-rm -f TAGS tags cscope.out
|
||||
cd $(SCST_DIR) && $(MAKE) $@
|
||||
@if [ -d $(DOC_DIR) ]; then cd $(DOC_DIR) && $(MAKE) $@; fi
|
||||
@if [ -d $(QLA_INI_DIR) ]; then cd $(QLA_INI_DIR) && $(MAKE) $@; fi
|
||||
|
||||
+115
-43
@@ -114,40 +114,23 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
GOALS:=$(if $(MAKECMDGOALS),$(MAKECMDGOALS),all)
|
||||
OTHER_GOALS:=$(foreach goal,$(MAKECMDGOALS),$(subst all,,$(goal)))
|
||||
# echo:=$(shell echo 'GOALS = $(GOALS)' >&2)
|
||||
# echo:=$(shell echo 'OTHER_GOALS = $(OTHER_GOALS)' >&2)
|
||||
ifneq ("$(GOALS)","$(OTHER_GOALS)")
|
||||
run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if $(MAKE) -C $(KDIR) V=$(V) SUBDIRS="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" 1>&2 2>$${output}; then echo "$2"; else echo "$3"; fi)
|
||||
USE_PRE_440_WR_STRUCTURE := $(call run_conftest,use_pre_440_wr_structure,-DUSE_PRE_440_WR_STRUCTURE)
|
||||
CREATE_CQ_FLAG := $(call run_conftest,create_cq,-DIB_CREATE_CQ_HAS_INIT_ATTR)
|
||||
CLIENT_REMOVE := $(call run_conftest,ib_client_remove,-DIB_CLIENT_REMOVE_TAKES_TWO_ARGS)
|
||||
HAVE_IB_DMA_MAP_OPS := $(call run_conftest,ib_dma_map_ops,-DHAVE_IB_DMA_MAP_OPS)
|
||||
HAVE_IB_SET_CPI_RESP_TIME := $(call run_conftest,ib_set_cpi_resp_time,-DHAVE_IB_SET_CPI_RESP_TIME)
|
||||
GID_CHANGE_FLAG := $(call run_conftest,gid_change,-DHAVE_IB_EVENT_GID_CHANGE)
|
||||
PD_HAS_LOCAL_DMA_LKEY := $(call run_conftest,pd_has_local_dma_lkey,-DIB_PD_HAS_LOCAL_DMA_LKEY)
|
||||
RDMA_CREATE_ID := $(call run_conftest,rdma_create_id_net,-DRDMA_CREATE_ID_TAKES_NET_ARG=1,-DRDMA_CREATE_ID_TAKES_NET_ARG=0)
|
||||
QUERY_DEVICE := $(call run_conftest,query_device,-DHAVE_IB_QUERY_DEVICE)
|
||||
QUERY_DEVICE_HAS_ATTR_ARG := $(call run_conftest,query_device_attr_arg,-DIB_QUERY_DEVICE_HAS_ATTR_ARG)
|
||||
QUERY_GID_FLAG := $(call run_conftest,query_gid,-DIB_QUERY_GID_HAS_ATTR_ARG)
|
||||
PRE_CFLAGS=$(OFED_CFLAGS) \
|
||||
$(USE_PRE_440_WR_STRUCTURE) \
|
||||
$(CLIENT_REMOVE) \
|
||||
$(CREATE_CQ_FLAG) \
|
||||
$(IB_CLIENT_REMOVE_TAKES_TWO_ARGS) \
|
||||
$(HAVE_IB_DMA_MAP_OPS) \
|
||||
$(HAVE_IB_SET_CPI_RESP_TIME) \
|
||||
$(GID_CHANGE_FLAG) \
|
||||
$(PD_HAS_LOCAL_DMA_LKEY) \
|
||||
$(RDMA_CREATE_ID) \
|
||||
$(QUERY_GID_FLAG) \
|
||||
$(QUERY_DEVICE) \
|
||||
$(QUERY_DEVICE_HAS_ATTR_ARG) \
|
||||
-DOFED_FLAVOR=$(OFED_FLAVOR)
|
||||
endif
|
||||
run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if $(MAKE) -C $(KDIR) V=$(V) SUBDIRS="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" 1>&2 2>$${output}; then echo "$(strip $2)"; else echo "$(strip $3)"; fi)
|
||||
run_conftest_bool = $(call run_conftest,$1,-D$(strip $2)=1,-D$(strip $2)=0)
|
||||
|
||||
mods: include/iscsi_scst_itf_ver.h Modules.symvers Module.symvers
|
||||
CONFTESTS = $(shell ls -d conftest/*)
|
||||
CONFTEST_OUTPUTS = $(shell \
|
||||
for t in $(CONFTESTS); do \
|
||||
echo $$t/result-$(KVER).txt; \
|
||||
done)
|
||||
|
||||
PRE_CFLAGS = $(OFED_CFLAGS) \
|
||||
-DOFED_FLAVOR=$(OFED_FLAVOR) \
|
||||
$(shell for t in $(CONFTESTS); do \
|
||||
cat $$t/result-$(KVER).txt 2>/dev/null; \
|
||||
done)
|
||||
|
||||
mods: include/iscsi_scst_itf_ver.h Modules.symvers Module.symvers \
|
||||
$(CONFTEST_OUTPUTS)
|
||||
$(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(KMOD) modules
|
||||
echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)"
|
||||
if $(INFINIBAND_ENABLED); then \
|
||||
@@ -227,18 +210,107 @@ clean:
|
||||
kernel/isert-scst/Modules.symvers kernel/isert-scst/Module.symvers \
|
||||
kernel/isert-scst/Module.markers kernel/isert-scst/modules.order \
|
||||
include/iscsi_scst_itf_ver.h
|
||||
rm -rf conftest/*/*.ko conftest/*/*.mod.c conftest/*/Module.symvers conftest/*/*.o \
|
||||
conftest/*/*.o.cmd conftest/*/*.ko.cmd conftest/*/.*.o.cmd conftest/*/.*.ko.cmd \
|
||||
conftest/*/*.order conftest/*/.*.o.d conftest/*/.tmp_versions/ \
|
||||
conftest/*/result*.txt
|
||||
|
||||
extraclean:
|
||||
$(MAKE) -C usr $@
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(KMOD) clean
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(ISERTMOD) clean
|
||||
rm -f kernel/Modules.symvers kernel/Module.symvers \
|
||||
kernel/Module.markers kernel/modules.order \
|
||||
kernel/isert-scst/Modules.symvers kernel/isert-scst/Module.symvers \
|
||||
kernel/isert-scst/Module.markers kernel/isert-scst/modules.order \
|
||||
include/iscsi_scst_itf_ver.h \
|
||||
kernel/*.orig kernel/*.rej \
|
||||
extraclean: clean
|
||||
rm -f kernel/*.orig kernel/*.rej \
|
||||
kernel/isert-scst/*.orig kernel/isert-scst/*.rej
|
||||
rm -rf conftest/*/*.rej conftest/*/*.orig
|
||||
|
||||
conftest/cm_listen/result-$(KVER).txt: \
|
||||
conftest/cm_listen/cm_listen.c \
|
||||
conftest/cm_listen/Makefile
|
||||
echo "$(call run_conftest,cm_listen, \
|
||||
-DIB_CM_LISTEN_TAKES_FOURTH_ARG)" >"$@"
|
||||
|
||||
conftest/create_cq/result-$(KVER).txt: \
|
||||
conftest/create_cq/create_cq.c \
|
||||
conftest/create_cq/Makefile
|
||||
echo "$(call run_conftest,create_cq, \
|
||||
-DIB_CREATE_CQ_HAS_INIT_ATTR)" >"$@"
|
||||
|
||||
conftest/create_send_mad_ah/result-$(KVER).txt: \
|
||||
conftest/create_send_mad_ah/create_send_mad_ah.c \
|
||||
conftest/create_send_mad_ah/Makefile
|
||||
echo "$(call run_conftest,create_send_mad_ah, \
|
||||
-DCREATE_SEND_MAD_HAS_AH_ARG)" >"$@"
|
||||
|
||||
conftest/create_send_mad_base/result-$(KVER).txt: \
|
||||
conftest/create_send_mad_base/create_send_mad_base.c \
|
||||
conftest/create_send_mad_base/Makefile
|
||||
echo "$(call run_conftest,create_send_mad_base, \
|
||||
-DCREATE_SEND_MAD_HAS_BASE_ARG)" >"$@"
|
||||
|
||||
conftest/gid_change/result-$(KVER).txt: \
|
||||
conftest/gid_change/gid_change.c \
|
||||
conftest/gid_change/Makefile
|
||||
echo "$(call run_conftest,gid_change,-DHAVE_IB_EVENT_GID_CHANGE)" >"$@"
|
||||
|
||||
conftest/ib_client_remove/result-$(KVER).txt: \
|
||||
conftest/ib_client_remove/ib_client_remove.c \
|
||||
conftest/ib_client_remove/Makefile
|
||||
echo "$(call run_conftest,ib_client_remove, \
|
||||
-DIB_CLIENT_REMOVE_TAKES_TWO_ARGS)" >"$@"
|
||||
|
||||
conftest/ib_dma_map_ops/result-$(KVER).txt: \
|
||||
conftest/ib_dma_map_ops/ib_dma_map_ops.c \
|
||||
conftest/ib_dma_map_ops/Makefile
|
||||
echo "$(call run_conftest,ib_dma_map_ops,-DHAVE_IB_DMA_MAP_OPS)" >"$@"
|
||||
|
||||
conftest/ib_set_cpi_resp_time/result-$(KVER).txt: \
|
||||
conftest/ib_set_cpi_resp_time/ib_set_cpi_resp_time.c \
|
||||
conftest/ib_set_cpi_resp_time/Makefile
|
||||
echo "$(call run_conftest,ib_set_cpi_resp_time, \
|
||||
-DHAVE_IB_SET_CPI_RESP_TIME)" >"$@"
|
||||
|
||||
conftest/mad_handler_takes_send_buf/result-$(KVER).txt: \
|
||||
conftest/mad_handler_takes_send_buf/mad_handler_takes_send_buf.c\
|
||||
conftest/mad_handler_takes_send_buf/Makefile
|
||||
echo "$(call run_conftest,mad_handler_takes_send_buf, \
|
||||
-DMAD_HANDLER_TAKES_SEND_BUF)" >"$@"
|
||||
|
||||
conftest/pd_has_local_dma_lkey/result-$(KVER).txt: \
|
||||
conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c \
|
||||
conftest/pd_has_local_dma_lkey/Makefile
|
||||
echo "$(call run_conftest,pd_has_local_dma_lkey, \
|
||||
-DIB_PD_HAS_LOCAL_DMA_LKEY)" >"$@"
|
||||
|
||||
conftest/query_device/result-$(KVER).txt: \
|
||||
conftest/query_device/query_device.c \
|
||||
conftest/query_device/Makefile
|
||||
echo "$(call run_conftest,query_device,-DHAVE_IB_QUERY_DEVICE)" >"$@"
|
||||
|
||||
conftest/query_device_attr_arg/result-$(KVER).txt: \
|
||||
conftest/query_device_attr_arg/query_device_attr_arg.c \
|
||||
conftest/query_device_attr_arg/Makefile
|
||||
echo "$(call run_conftest,query_device_attr_arg, \
|
||||
-DIB_QUERY_DEVICE_HAS_ATTR_ARG)" >"$@"
|
||||
|
||||
conftest/query_gid/result-$(KVER).txt: \
|
||||
conftest/query_gid/query_gid.c \
|
||||
conftest/query_gid/Makefile
|
||||
echo "$(call run_conftest,query_gid,-DIB_QUERY_GID_HAS_ATTR_ARG)" >"$@"
|
||||
|
||||
conftest/rdma_create_id_net/result-$(KVER).txt: \
|
||||
conftest/rdma_create_id_net/rdma_create_id_net.c \
|
||||
conftest/rdma_create_id_net/Makefile
|
||||
echo "$(call run_conftest_bool,rdma_create_id_net, \
|
||||
RDMA_CREATE_ID_TAKES_NET_ARG)" >"$@"
|
||||
|
||||
conftest/register_mad_agent/result-$(KVER).txt: \
|
||||
conftest/register_mad_agent/register_mad_agent.c \
|
||||
conftest/register_mad_agent/Makefile
|
||||
echo "$(call run_conftest,register_mad_agent, \
|
||||
-DREGISTER_MAD_AGENT_HAS_FLAGS_ARG)" >"$@"
|
||||
|
||||
conftest/use_pre_440_wr_structure/result-$(KVER).txt: \
|
||||
conftest/use_pre_440_wr_structure/use_pre_440_wr_structure.c \
|
||||
conftest/use_pre_440_wr_structure/Makefile
|
||||
echo "$(call run_conftest,use_pre_440_wr_structure, \
|
||||
-DUSE_PRE_440_WR_STRUCTURE)" >"$@"
|
||||
|
||||
2release:
|
||||
sed -i.aa s/"^E\?XTRA_CFLAGS += \-DCONFIG_SCST_EXTRACHECKS"/"#EXTRA_CFLAGS += \-DCONFIG_SCST_EXTRACHECKS"/ $(KMOD)/Makefile
|
||||
|
||||
@@ -1126,7 +1126,8 @@ void iscsi_extracheck_is_rd_thread(struct iscsi_conn *conn)
|
||||
local_bh_enable();
|
||||
pr_emerg("rd_state %x\n", conn->rd_state);
|
||||
pr_emerg("rd_task %p\n", conn->rd_task);
|
||||
pr_emerg("rd_task->pid %d\n", conn->rd_task->pid);
|
||||
if (conn->rd_task)
|
||||
pr_emerg("rd_task->pid %d\n", conn->rd_task->pid);
|
||||
BUG();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,6 +509,11 @@ void cmnd_done(struct iscsi_cmnd *cmnd)
|
||||
if (cmnd->sg != &dummy_sg)
|
||||
scst_free_sg(cmnd->sg, cmnd->sg_cnt);
|
||||
#ifdef CONFIG_SCST_DEBUG
|
||||
/*
|
||||
* We can make correct behavior depend on this, so
|
||||
* a bug can disappear whenever you enable debugging,
|
||||
* but probability of failure on zero/NULL is much bigger
|
||||
*/
|
||||
cmnd->own_sg = 0;
|
||||
cmnd->sg = NULL;
|
||||
cmnd->sg_cnt = -1;
|
||||
@@ -2911,7 +2916,7 @@ out:
|
||||
return;
|
||||
}
|
||||
|
||||
static void set_cork(struct socket *sock, int on)
|
||||
static inline void set_cork(struct socket *sock, int on)
|
||||
{
|
||||
int opt = on;
|
||||
mm_segment_t oldfs;
|
||||
|
||||
@@ -1689,6 +1689,8 @@ static int tx_padding(struct iscsi_cmnd *cmnd, int state)
|
||||
struct kvec iov;
|
||||
static const uint32_t padding;
|
||||
|
||||
BUG_ON(rest < 1);
|
||||
BUG_ON(rest >= sizeof(uint32_t));
|
||||
iscsi_extracheck_is_wr_thread(cmnd->conn);
|
||||
|
||||
TRACE_DBG("Sending %d padding bytes (cmd %p)", rest, cmnd);
|
||||
|
||||
@@ -65,7 +65,7 @@ static int iscsi_session_alloc(struct iscsi_target *target,
|
||||
|
||||
#ifdef CONFIG_SCST_PROC
|
||||
name = kmalloc(strlen(info->user_name) + strlen(info->initiator_name) +
|
||||
1, GFP_KERNEL);
|
||||
2, GFP_KERNEL); /* +1 (for '\0') +1 (for '@') */
|
||||
if (name == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto err;
|
||||
|
||||
@@ -105,6 +105,9 @@ static u8 decode_base64_digit(char base64)
|
||||
else if ((base64 >= '0') && (base64 <= '9'))
|
||||
return 52 + (base64 - '0');
|
||||
else
|
||||
//XXX This return value should be unsigned; and anyway
|
||||
//XXX in case of a bad character in the string, our
|
||||
//XXX caller (sometimes) checks for 65, not 255 or -1
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -146,6 +149,8 @@ static void decode_base64_string(char *string, u8 *intnum, int int_len)
|
||||
num[1] = decode_base64_digit(string[count + 1]);
|
||||
num[2] = decode_base64_digit(string[count + 2]);
|
||||
num[3] = decode_base64_digit(string[count + 3]);
|
||||
//XXX Check for the special "bad character in string" value here like above?
|
||||
//XXX Also check the string for missing/incorrect padding?
|
||||
if ((num[0] == 64) || (num[1] == 64))
|
||||
return;
|
||||
if (num[2] == 64) {
|
||||
|
||||
+16
-12
@@ -41,9 +41,9 @@
|
||||
* be the last to confirm expectations of __config_account_add()!!
|
||||
*/
|
||||
struct iscsi_key user_keys[] = {
|
||||
{"IncomingUser",},
|
||||
{"OutgoingUser",},
|
||||
{NULL,},
|
||||
{ .name = "IncomingUser",},
|
||||
{ .name = "OutgoingUser",},
|
||||
{ .name = NULL,},
|
||||
};
|
||||
|
||||
static struct __qelem discovery_users_in = LIST_HEAD_INIT(discovery_users_in);
|
||||
@@ -856,11 +856,12 @@ int config_params_set(u32 tid, u64 sid, int type, u32 partial,
|
||||
|
||||
if (type == key_session) {
|
||||
for (i = 0; i < session_key_last; i++) {
|
||||
uint32_t in_val = params[i].val;
|
||||
if (partial & (1 << i)) {
|
||||
err = params_check_val(session_keys, i, ¶ms[i].val);
|
||||
if (err < 0) {
|
||||
log_error("Wrong value %u for parameter %s\n",
|
||||
params[i].val, session_keys[i].name);
|
||||
log_error("%s: Wrong value %u->%u for session parameter %s\n",
|
||||
__func__, in_val, params[i].val, session_keys[i].name);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -871,11 +872,12 @@ int config_params_set(u32 tid, u64 sid, int type, u32 partial,
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < target_key_last; i++) {
|
||||
uint32_t in_val = params[i].val;
|
||||
if (partial & (1 << i)) {
|
||||
err = params_check_val(target_keys, i, ¶ms[i].val);
|
||||
if (err < 0) {
|
||||
log_error("Wrong value %u for parameter %s\n",
|
||||
params[i].val, target_keys[i].name);
|
||||
log_error("%s: Wrong value %u->%u for target parameter %s\n",
|
||||
__func__, in_val, params[i].val, target_keys[i].name);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -962,10 +964,11 @@ int config_parse_main(const char *data, u32 cookie)
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t in_val = val;
|
||||
res = params_check_val(target_keys, idx, &val);
|
||||
if (res < 0) {
|
||||
log_error("Wrong value %u for parameter %s\n",
|
||||
val, target_keys[idx].name);
|
||||
log_error("%s: Wrong value %u->%u for target parameter %s\n",
|
||||
__func__, in_val, val, target_keys[idx].name);
|
||||
continue;
|
||||
}
|
||||
target->target_params[idx] = val;
|
||||
@@ -986,10 +989,11 @@ int config_parse_main(const char *data, u32 cookie)
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t in_val = val;
|
||||
res = params_check_val(session_keys, idx, &val);
|
||||
if (res < 0) {
|
||||
log_error("Wrong value %u for parameter %s\n",
|
||||
val, session_keys[idx].name);
|
||||
log_error("%s: Wrong value %u->%u for session parameter %s\n",
|
||||
__func__, in_val, val, session_keys[idx].name);
|
||||
continue;
|
||||
}
|
||||
target->session_params[idx] = val;
|
||||
@@ -1140,7 +1144,7 @@ int config_load(const char *config_name)
|
||||
|
||||
err = config_isns_load(buf);
|
||||
if ((err == 0) && (isns_server != NULL)) {
|
||||
int rc = isns_init();
|
||||
rc = isns_init();
|
||||
|
||||
if (rc != 0) {
|
||||
log_error("iSNS server %s init failed: %d", isns_server, rc);
|
||||
|
||||
@@ -232,14 +232,15 @@ static void create_iser_listen_socket(struct pollfd *array)
|
||||
|
||||
iser_fd = create_and_open_dev("isert_scst", 1);
|
||||
|
||||
poll_array[POLL_ISER_LISTEN].fd = iser_fd;
|
||||
if (iser_fd != -1) {
|
||||
if (iser_fd >= 0) {
|
||||
poll_array[POLL_ISER_LISTEN].fd = iser_fd;
|
||||
poll_array[POLL_ISER_LISTEN].events = POLLIN;
|
||||
|
||||
/* RDMAExtensions */
|
||||
session_keys[key_rdma_extensions].max = 1;
|
||||
session_keys[key_rdma_extensions].local_def = 1;
|
||||
} else {
|
||||
poll_array[POLL_ISER_LISTEN].fd = -1;
|
||||
poll_array[POLL_ISER_LISTEN].events = 0;
|
||||
return;
|
||||
}
|
||||
@@ -508,8 +509,11 @@ again:
|
||||
case IOSTATE_READ_BHS:
|
||||
case IOSTATE_READ_AHS_DATA:
|
||||
read_again:
|
||||
errno = 0; /* for the log_debug() */
|
||||
res = read(pollfd->fd, conn->buffer, conn->rwsize);
|
||||
if (res <= 0) {
|
||||
log_debug(1, "read(%u, %p, %u) returned %d, errno=%u",
|
||||
pollfd->fd, conn->buffer, conn->rwsize, res, errno);
|
||||
if (res == 0 || (errno != EINTR && errno != EAGAIN)) {
|
||||
conn->state = STATE_DROP;
|
||||
goto out;
|
||||
@@ -576,6 +580,8 @@ again:
|
||||
conn->cork_transmit(pollfd->fd);
|
||||
res = write(pollfd->fd, conn->buffer, conn->rwsize);
|
||||
if (res < 0) {
|
||||
log_debug(1, "write(%u, %p, %u) returned %d, errno=%u",
|
||||
pollfd->fd, conn->buffer, conn->rwsize, res, errno);
|
||||
if (errno != EINTR && errno != EAGAIN) {
|
||||
conn->state = STATE_DROP;
|
||||
goto out;
|
||||
@@ -746,7 +752,8 @@ static void event_loop(void)
|
||||
(conn->state == STATE_DROP)) {
|
||||
struct session *sess = conn->sess;
|
||||
|
||||
log_debug(1, "closing conn %p", conn);
|
||||
log_debug(1, "closing conn %p state=0x%x fd=%u",
|
||||
conn, conn->state, pollfd->fd);
|
||||
conn_free_pdu(conn);
|
||||
close(pollfd->fd);
|
||||
pollfd->fd = -1;
|
||||
|
||||
@@ -37,15 +37,15 @@ static u32 get_next_ttt(struct connection *conn __attribute__((unused)))
|
||||
}
|
||||
|
||||
static struct iscsi_key login_keys[] = {
|
||||
{"InitiatorName",},
|
||||
{"InitiatorAlias",},
|
||||
{"SessionType",},
|
||||
{"TargetName",},
|
||||
{"InitiatorRecvDataSegmentLength",},
|
||||
{"MaxAHSLength",},
|
||||
{"TaggedBufferForSolicitedDataOnly",},
|
||||
{"iSERHelloRequired",},
|
||||
{NULL,},
|
||||
{ .name = "InitiatorName",},
|
||||
{ .name = "InitiatorAlias",},
|
||||
{ .name = "SessionType",},
|
||||
{ .name = "TargetName",},
|
||||
{ .name = "InitiatorRecvDataSegmentLength",},
|
||||
{ .name = "MaxAHSLength",},
|
||||
{ .name = "TaggedBufferForSolicitedDataOnly",},
|
||||
{ .name = "iSERHelloRequired",},
|
||||
{ .name = NULL,},
|
||||
};
|
||||
|
||||
char *text_key_find(struct connection *conn, const char *searchKey)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "iscsid.h"
|
||||
|
||||
int driver_major(const char *dev)
|
||||
static int driver_major(const char *dev)
|
||||
{
|
||||
FILE *f;
|
||||
char devname[256];
|
||||
|
||||
@@ -415,7 +415,8 @@ int target_create(const char *name, struct target **out_target)
|
||||
}
|
||||
|
||||
memset(target, 0, sizeof(*target));
|
||||
memcpy(target->name, name, sizeof(target->name) - 1);
|
||||
strncpy(target->name, name, sizeof(target->name) - 1);
|
||||
target->name[sizeof(target->name)-1] = '\0';
|
||||
|
||||
params_set_defaults(target->target_params, target_keys);
|
||||
params_set_defaults(target->session_params, session_keys);
|
||||
|
||||
@@ -77,6 +77,11 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
|
||||
* 230fa253df6352af12ad0a16128760b5cb3f92df).
|
||||
*/
|
||||
#define READ_ONCE(x) (*(volatile typeof(x) *)&(x))
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
|
||||
#define ACCESS_ONCE(x) READ_ONCE(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* <linux/cpumask.h> */
|
||||
|
||||
+2
-2
@@ -4077,8 +4077,8 @@ static inline enum scst_exec_context __scst_estimate_context(bool atomic)
|
||||
else if (in_atomic())
|
||||
return SCST_CONTEXT_DIRECT_ATOMIC;
|
||||
else
|
||||
return atomic ? SCST_CONTEXT_DIRECT :
|
||||
SCST_CONTEXT_DIRECT_ATOMIC;
|
||||
return atomic ? SCST_CONTEXT_DIRECT_ATOMIC :
|
||||
SCST_CONTEXT_DIRECT;
|
||||
#else
|
||||
return SCST_CONTEXT_THREAD;
|
||||
#endif
|
||||
|
||||
@@ -83,7 +83,7 @@ static struct scst_trace_log vdisk_local_trace_tbl[] = {
|
||||
#define SCST_FIO_VENDOR "SCST_FIO"
|
||||
#define SCST_BIO_VENDOR "SCST_BIO"
|
||||
/* 4 byte ASCII Product Revision Level - left aligned */
|
||||
#define SCST_FIO_REV " 330"
|
||||
#define SCST_FIO_REV "330 "
|
||||
|
||||
#define MAX_USN_LEN (20+1) /* For '\0' */
|
||||
#define MAX_INQ_VEND_SPECIFIC_LEN (INQ_BUF_SZ - 96)
|
||||
@@ -137,7 +137,7 @@ static struct scst_trace_log vdisk_local_trace_tbl[] = {
|
||||
|
||||
#define DEF_DPICZ SCST_DPICZ_CHECK_ON_xPROT_0
|
||||
|
||||
#define DEF_DIF_FILENAME_TMPL (SCST_VAR_DIR "/dif_tags/%s.dif")
|
||||
#define DEF_DIF_FILENAME_TMPL SCST_VAR_DIR "/dif_tags/%s.dif"
|
||||
|
||||
#ifdef CONFIG_SCST_PROC
|
||||
#define VDISK_PROC_HELP "help"
|
||||
@@ -1077,12 +1077,12 @@ check:
|
||||
#endif
|
||||
|
||||
if (virt_dev->blockio) {
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32) || \
|
||||
(defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 6)
|
||||
struct request_queue *q;
|
||||
|
||||
sBUG_ON(!fd_open);
|
||||
q = bdev_get_queue(file_inode(fd)->i_bdev);
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32) || \
|
||||
(defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 6)
|
||||
virt_dev->unmap_opt_gran = q->limits.discard_granularity >> block_shift;
|
||||
virt_dev->unmap_align = q->limits.discard_alignment >> block_shift;
|
||||
if (virt_dev->unmap_opt_gran == virt_dev->unmap_align)
|
||||
@@ -1158,6 +1158,8 @@ static int vdisk_get_file_size(const char *filename, bool blockio,
|
||||
} else if (S_ISBLK(inode->i_mode)) {
|
||||
inode = inode->i_bdev->bd_inode;
|
||||
} else {
|
||||
PRINT_ERROR("File %s unsupported mode: mode=0%o\n",
|
||||
filename, inode->i_mode);
|
||||
res = -EINVAL;
|
||||
goto out_close;
|
||||
}
|
||||
@@ -2079,8 +2081,11 @@ static int vdisk_format_dif(struct scst_cmd *cmd, uint64_t start_lba,
|
||||
goto out_set_fs;
|
||||
} else if (err < full_len) {
|
||||
/*
|
||||
* Probably that's wrong, but sometimes write() returns
|
||||
* value less, than requested. Let's restart.
|
||||
* If a write() is interrupted by a signal handler before
|
||||
* any bytes are written, then the call fails with the
|
||||
* error EINTR; if it is interrupted after at least one
|
||||
* byte has been written, the call succeeds, and returns
|
||||
* the number of bytes written -- manpage write(2)
|
||||
*/
|
||||
left += full_len - err;
|
||||
done -= full_len - err;
|
||||
@@ -2943,6 +2948,9 @@ static bool vdisk_parse_offset(struct vdisk_cmd_params *p, struct scst_cmd *cmd)
|
||||
TRACE(TRACE_ORDER, "HQ cmd %p (op %s)", cmd,
|
||||
scst_get_opcode_name(cmd));
|
||||
break;
|
||||
case SCST_CMD_QUEUE_ACA:
|
||||
case SCST_CMD_QUEUE_SIMPLE:
|
||||
case SCST_CMD_QUEUE_UNTAGGED:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -7885,6 +7893,8 @@ static void vdev_destroy(struct scst_vdisk_dev *virt_dev)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SCST_PROC
|
||||
|
||||
static void vdev_check_node(struct scst_vdisk_dev **pvirt_dev, int orig_nodeid)
|
||||
{
|
||||
struct scst_vdisk_dev *virt_dev = *pvirt_dev;
|
||||
@@ -7912,8 +7922,6 @@ out:
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SCST_PROC
|
||||
|
||||
static int vdev_parse_add_dev_params(struct scst_vdisk_dev *virt_dev,
|
||||
char *params, const char *const allowed_params[])
|
||||
{
|
||||
@@ -8115,6 +8123,7 @@ static int vdev_parse_add_dev_params(struct scst_vdisk_dev *virt_dev,
|
||||
} else if (!strcasecmp("blocksize", p)) {
|
||||
virt_dev->blk_shift = scst_calc_block_shift(val);
|
||||
if (virt_dev->blk_shift < 9) {
|
||||
PRINT_ERROR("blocksize %u too small", 1<<virt_dev->blk_shift);
|
||||
res = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
@@ -10357,6 +10366,7 @@ static int vdisk_write_proc(char *buffer, char **start, off_t offset,
|
||||
|
||||
block_shift = scst_calc_block_shift(block_size);
|
||||
if (block_shift < 9) {
|
||||
PRINT_ERROR("blocksize %u too small", 1<<block_shift);
|
||||
res = -EINVAL;
|
||||
goto out_free_vdev;
|
||||
}
|
||||
@@ -10424,7 +10434,7 @@ static int vdisk_write_proc(char *buffer, char **start, off_t offset,
|
||||
PRINT_ERROR("File path \"%s\" is not "
|
||||
"absolute", filename);
|
||||
res = -EINVAL;
|
||||
goto out_up;
|
||||
goto out_free_vdev;
|
||||
}
|
||||
|
||||
virt_dev->filename = kstrdup(filename, GFP_KERNEL);
|
||||
|
||||
+11
-7
@@ -5223,6 +5223,7 @@ int scst_tgt_dev_setup_threads(struct scst_tgt_dev *tgt_dev)
|
||||
tgtt->threads_num);
|
||||
break;
|
||||
}
|
||||
case SCST_THREADS_POOL_TYPE_INVALID:
|
||||
default:
|
||||
PRINT_CRIT_ERROR("Unknown threads pool type %d (dev %s)",
|
||||
dev->threads_pool_type, dev->virt_name);
|
||||
@@ -9379,6 +9380,9 @@ static int scst_do_dif(struct scst_cmd *cmd,
|
||||
res = generate_fn(cmd);
|
||||
break;
|
||||
|
||||
case SCST_DIF_CHECK_APP_TAG:
|
||||
case SCST_DIF_CHECK_GUARD_TAG:
|
||||
case SCST_DIF_CHECK_REF_TAG:
|
||||
default:
|
||||
EXTRACHECKS_BUG_ON(1);
|
||||
/* go through */
|
||||
@@ -11805,15 +11809,15 @@ uint64_t scst_unpack_lun(const uint8_t *lun, int len)
|
||||
case 2:
|
||||
break;
|
||||
case 8:
|
||||
if ((*((__be64 *)lun) & cpu_to_be64(0x0000FFFFFFFFFFFFLL)) != 0)
|
||||
if ((*((__be64 const *)lun) & cpu_to_be64(0x0000FFFFFFFFFFFFLL)) != 0)
|
||||
goto out_err;
|
||||
break;
|
||||
case 4:
|
||||
if (*((__be16 *)&lun[2]) != 0)
|
||||
if (*((__be16 const *)&lun[2]) != 0)
|
||||
goto out_err;
|
||||
break;
|
||||
case 6:
|
||||
if (*((__be32 *)&lun[2]) != 0)
|
||||
if (*((__be32 const *)&lun[2]) != 0)
|
||||
goto out_err;
|
||||
break;
|
||||
case 1:
|
||||
@@ -13977,10 +13981,10 @@ EXPORT_SYMBOL(scst_reassign_retained_sess_states);
|
||||
char *scst_get_next_lexem(char **token_str)
|
||||
{
|
||||
char *p, *q;
|
||||
static const char blank = '\0';
|
||||
static char blank = '\0';
|
||||
|
||||
if ((token_str == NULL) || (*token_str == NULL))
|
||||
return (char *)␣
|
||||
return ␣
|
||||
|
||||
for (p = *token_str; (*p != '\0') && (isspace(*p) || (*p == '=')); p++)
|
||||
;
|
||||
@@ -14981,7 +14985,7 @@ int scst_write_file_transactional(const char *name, const char *name1,
|
||||
|
||||
pos = signature_len+1;
|
||||
|
||||
res = vfs_write(file, (void __force __user *)buf, size, &pos);
|
||||
res = vfs_write(file, (void const __force __user *)buf, size, &pos);
|
||||
if (res != size)
|
||||
goto write_error;
|
||||
|
||||
@@ -14992,7 +14996,7 @@ int scst_write_file_transactional(const char *name, const char *name1,
|
||||
}
|
||||
|
||||
pos = 0;
|
||||
res = vfs_write(file, (void __force __user *)signature, signature_len, &pos);
|
||||
res = vfs_write(file, (void const __force __user *)signature, signature_len, &pos);
|
||||
if (res != signature_len)
|
||||
goto write_error;
|
||||
|
||||
|
||||
@@ -2854,7 +2854,9 @@ static void __exit exit_scst(void)
|
||||
scsi_unregister_interface(&scst_interface);
|
||||
|
||||
#ifdef CONFIG_SCST_PROC
|
||||
mutex_lock(&scst_mutex);
|
||||
scst_del_free_acg(scst_default_acg, false);
|
||||
mutex_unlock(&scst_mutex);
|
||||
#endif
|
||||
|
||||
scst_sgv_pools_deinit();
|
||||
|
||||
+9
-18
@@ -944,23 +944,14 @@ static void scst_proc_del_acg_tree(struct proc_dir_entry *acg_proc_root,
|
||||
/* The activity supposed to be suspended and scst_mutex held */
|
||||
static int scst_proc_group_add(const char *p, unsigned int addr_method)
|
||||
{
|
||||
int res = 0, len = strlen(p) + 1;
|
||||
int res = 0;
|
||||
struct scst_acg *acg;
|
||||
char *name = NULL;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
name = kmalloc(len, GFP_KERNEL);
|
||||
if (name == NULL) {
|
||||
PRINT_ERROR("Allocation of new name (size %d) failed", len);
|
||||
goto out_nomem;
|
||||
}
|
||||
strlcpy(name, p, len);
|
||||
|
||||
res = scst_alloc_add_acg(NULL, name, false, &acg);
|
||||
res = scst_alloc_add_acg(NULL, p, false, &acg);
|
||||
if (res != 0) {
|
||||
PRINT_ERROR("scst_alloc_add_acg() (name %s) failed", name);
|
||||
goto out_free;
|
||||
PRINT_ERROR("scst_alloc_add_acg() (name %s) failed", p);
|
||||
goto out;
|
||||
}
|
||||
|
||||
acg->addr_method = addr_method;
|
||||
@@ -976,11 +967,6 @@ out:
|
||||
out_free_acg:
|
||||
scst_proc_del_free_acg(acg, 0);
|
||||
|
||||
out_free:
|
||||
kfree(name);
|
||||
goto out;
|
||||
|
||||
out_nomem:
|
||||
res = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
@@ -1232,7 +1218,11 @@ void scst_proc_cleanup_module(void)
|
||||
|
||||
/* We may not bother about locks here */
|
||||
scst_proc_cleanup_sgv();
|
||||
|
||||
mutex_lock(&scst_mutex);
|
||||
scst_proc_cleanup_groups();
|
||||
mutex_unlock(&scst_mutex);
|
||||
|
||||
scst_proc_cleanup_module_log();
|
||||
remove_proc_entry(SCST_PROC_THREADS_NAME, scst_proc_scsi_tgt);
|
||||
remove_proc_entry(SCST_PROC_HELP_NAME, scst_proc_scsi_tgt);
|
||||
@@ -2530,6 +2520,7 @@ static int scst_groups_addr_method_show(struct seq_file *seq, void *v)
|
||||
case SCST_LUN_ADDR_METHOD_LUN:
|
||||
seq_printf(seq, "%s\n", "LUN");
|
||||
break;
|
||||
case SCST_LUN_ADDR_METHOD_EXTENDED_LUN:
|
||||
default:
|
||||
seq_printf(seq, "%s\n", "UNKNOWN");
|
||||
break;
|
||||
|
||||
@@ -906,6 +906,7 @@ active:
|
||||
scst_schedule_tasklet(cmd);
|
||||
break;
|
||||
|
||||
case SCST_CONTEXT_SAME:
|
||||
default:
|
||||
PRINT_ERROR("Context %x is undefined, using the thread one",
|
||||
pref_context);
|
||||
@@ -1551,9 +1552,13 @@ static int scst_prepare_space(struct scst_cmd *cmd)
|
||||
goto alloc;
|
||||
else if (r == 0) {
|
||||
if (unlikely(cmd->bufflen == 0)) {
|
||||
/* See comment in scst_alloc_space() */
|
||||
if (cmd->sg == NULL)
|
||||
if (cmd->sg == NULL) {
|
||||
/*
|
||||
* Let's still have a buffer for uniformity,
|
||||
* scst_alloc_space() will handle bufflen 0
|
||||
*/
|
||||
goto alloc;
|
||||
}
|
||||
}
|
||||
|
||||
cmd->tgt_i_data_buf_alloced = 1;
|
||||
@@ -1904,6 +1909,7 @@ static void scst_process_redirect_cmd(struct scst_cmd *cmd,
|
||||
scst_schedule_tasklet(cmd);
|
||||
break;
|
||||
|
||||
case SCST_CONTEXT_SAME:
|
||||
default:
|
||||
PRINT_ERROR("Context %x is unknown, using the thread one",
|
||||
context);
|
||||
|
||||
+3
-1
@@ -1296,7 +1296,6 @@ int scst_dg_add(struct kobject *parent, const char *name)
|
||||
res = -EEXIST;
|
||||
if (__lookup_dg_by_name(name))
|
||||
goto out_unlock;
|
||||
res = -ENOMEM;
|
||||
INIT_LIST_HEAD(&dg->dev_list);
|
||||
INIT_LIST_HEAD(&dg->tg_list);
|
||||
res = scst_dg_sysfs_add(parent, dg);
|
||||
@@ -1758,6 +1757,9 @@ int scst_tg_set_group_info(struct scst_cmd *cmd)
|
||||
case SCST_TG_STATE_UNAVAILABLE:
|
||||
case SCST_TG_STATE_OFFLINE:
|
||||
break;
|
||||
case SCST_TG_STATE_LBA_DEPENDENT:
|
||||
case SCST_TG_STATE_TRANSITIONING:
|
||||
case SCST_TG_STATE_UNDEFINED:
|
||||
default:
|
||||
TRACE_MGMT_DBG("Incorrect new state %d", osi[j].new_state);
|
||||
res = -EINVAL;
|
||||
|
||||
+115
-56
@@ -1,6 +1,7 @@
|
||||
#
|
||||
# Makefile for ib_srpt.ko.
|
||||
#
|
||||
|
||||
ifndef PREFIX
|
||||
PREFIX=/usr/local
|
||||
endif
|
||||
@@ -86,55 +87,30 @@ endif
|
||||
OFED_MODULE_SYMVERS:=$(OFED_KERNEL_DIR)/$(MODULE_SYMVERS)
|
||||
endif
|
||||
|
||||
GOALS:=$(if $(MAKECMDGOALS),$(MAKECMDGOALS),all)
|
||||
OTHER_GOALS:=$(foreach goal,$(MAKECMDGOALS),$(subst all,,$(goal)))
|
||||
# echo:=$(shell echo 'GOALS = $(GOALS)' >&2)
|
||||
# echo:=$(shell echo 'OTHER_GOALS = $(OTHER_GOALS)' >&2)
|
||||
ifneq ("$(GOALS)","$(OTHER_GOALS)")
|
||||
run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if $(MAKE) -C $(KDIR) V=$(V) SUBDIRS="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" 1>&2 2>$${output}; then echo "$2"; else echo "$3"; fi)
|
||||
USE_PRE_440_WR_STRUCTURE := $(call run_conftest,use_pre_440_wr_structure,-DUSE_PRE_440_WR_STRUCTURE)
|
||||
CREATE_CQ_FLAG := $(call run_conftest,create_cq,-DIB_CREATE_CQ_HAS_INIT_ATTR)
|
||||
CREATE_SEND_MAD_AH_FLAG := $(call run_conftest,create_send_mad_ah,-DCREATE_SEND_MAD_HAS_AH_ARG)
|
||||
ifeq ($(CREATE_SEND_MAD_AH_FLAG),)
|
||||
CREATE_SEND_MAD_BASE_FLAG := $(call run_conftest,create_send_mad_base,-DCREATE_SEND_MAD_HAS_BASE_ARG)
|
||||
endif
|
||||
CLIENT_REMOVE := $(call run_conftest,ib_client_remove,-DIB_CLIENT_REMOVE_TAKES_TWO_ARGS)
|
||||
CM_LISTEN := $(call run_conftest,cm_listen,-DIB_CM_LISTEN_TAKES_FOURTH_ARG)
|
||||
MAD_HANDLER_TAKES_SEND_BUF := $(call run_conftest,mad_handler_takes_send_buf,-DMAD_HANDLER_TAKES_SEND_BUF)
|
||||
HAVE_IB_DMA_MAP_OPS := $(call run_conftest,ib_dma_map_ops,-DHAVE_IB_DMA_MAP_OPS)
|
||||
HAVE_IB_SET_CPI_RESP_TIME := $(call run_conftest,ib_set_cpi_resp_time,-DHAVE_IB_SET_CPI_RESP_TIME)
|
||||
GID_CHANGE_FLAG := $(call run_conftest,gid_change,-DHAVE_IB_EVENT_GID_CHANGE)
|
||||
PD_HAS_LOCAL_DMA_LKEY := $(call run_conftest,pd_has_local_dma_lkey,-DIB_PD_HAS_LOCAL_DMA_LKEY)
|
||||
RDMA_CREATE_ID := $(call run_conftest,rdma_create_id_net,-DRDMA_CREATE_ID_TAKES_NET_ARG=1,-DRDMA_CREATE_ID_TAKES_NET_ARG=0)
|
||||
REGISTER_MAD_AGENT_FLAG := $(call run_conftest,register_mad_agent,-DREGISTER_MAD_AGENT_HAS_FLAGS_ARG)
|
||||
QUERY_DEVICE := $(call run_conftest,query_device,-DHAVE_IB_QUERY_DEVICE)
|
||||
QUERY_DEVICE_HAS_ATTR_ARG := $(call run_conftest,query_device_attr_arg,-DIB_QUERY_DEVICE_HAS_ATTR_ARG)
|
||||
QUERY_GID_FLAG := $(call run_conftest,query_gid,-DIB_QUERY_GID_HAS_ATTR_ARG)
|
||||
PRE_CFLAGS=$(OFED_CFLAGS) \
|
||||
$(USE_PRE_440_WR_STRUCTURE) \
|
||||
$(CLIENT_REMOVE) \
|
||||
$(CREATE_CQ_FLAG) \
|
||||
$(CREATE_SEND_MAD_AH_FLAG) \
|
||||
$(CREATE_SEND_MAD_BASE_FLAG) \
|
||||
$(IB_CLIENT_REMOVE_TAKES_TWO_ARGS) \
|
||||
$(CM_LISTEN) \
|
||||
$(MAD_HANDLER_TAKES_SEND_BUF) \
|
||||
$(HAVE_IB_DMA_MAP_OPS) \
|
||||
$(HAVE_IB_SET_CPI_RESP_TIME) \
|
||||
$(GID_CHANGE_FLAG) \
|
||||
$(PD_HAS_LOCAL_DMA_LKEY) \
|
||||
$(RDMA_CREATE_ID) \
|
||||
$(REGISTER_MAD_AGENT_FLAG) \
|
||||
$(QUERY_GID_FLAG) \
|
||||
$(QUERY_DEVICE) \
|
||||
$(QUERY_DEVICE_HAS_ATTR_ARG) \
|
||||
-DOFED_FLAVOR=$(OFED_FLAVOR)
|
||||
endif
|
||||
run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if $(MAKE) -C $(KDIR) V=$(V) SUBDIRS="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" 1>&2 2>$${output}; then echo "$(strip $2)"; else echo "$(strip $3)"; fi)
|
||||
run_conftest_bool = $(call run_conftest,$1,-D$(strip $2)=1,-D$(strip $2)=0)
|
||||
|
||||
all: src/$(MODULE_SYMVERS)
|
||||
CONFTESTS = $(shell ls -d conftest/*)
|
||||
CONFTEST_OUTPUTS = $(shell \
|
||||
for t in $(CONFTESTS); do \
|
||||
echo $$t/result-$(KVER).txt; \
|
||||
done)
|
||||
|
||||
PRE_CFLAGS = $(OFED_CFLAGS) \
|
||||
-DOFED_FLAVOR=$(OFED_FLAVOR) \
|
||||
$(shell for t in $(CONFTESTS); do \
|
||||
cat $$t/result-$(KVER).txt 2>/dev/null; \
|
||||
done)
|
||||
|
||||
all: check src/$(MODULE_SYMVERS) $(CONFTEST_OUTPUTS)
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \
|
||||
PRE_CFLAGS="$(PRE_CFLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules
|
||||
|
||||
src/$(MODULE_SYMVERS): $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) \
|
||||
$(OFED_MODULE_SYMVERS)
|
||||
cat $^ | \
|
||||
awk '{sym[$$2]=$$0} END {for (s in sym){print sym[s]}}' >"$@"
|
||||
|
||||
install: all
|
||||
@[ -z "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && \
|
||||
find /lib/modules/$(KVER) -name ib_srpt.ko -exec rm {} \; ; \
|
||||
@@ -148,8 +124,7 @@ uninstall:
|
||||
rm -f $(INSTALL_DIR)/ib_srpt.ko
|
||||
-/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER)
|
||||
|
||||
src/$(MODULE_SYMVERS): $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) \
|
||||
$(OFED_MODULE_SYMVERS)
|
||||
check:
|
||||
@if [ -n "$(OFED_KERNEL_IB_RPM)" ]; then \
|
||||
if [ -z "$(OFED_KERNEL_IB_DEVEL_RPM)" ]; then \
|
||||
echo "Error: the OFED package $(OFED_KERNEL_IB_RPM)-devel has" \
|
||||
@@ -158,14 +133,6 @@ src/$(MODULE_SYMVERS): $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) \
|
||||
else \
|
||||
echo " Building against $(OFED_FLAVOR) $(OFED_KERNEL_IB_RPM)" \
|
||||
"InfiniBand kernel headers."; \
|
||||
( \
|
||||
cat $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) | \
|
||||
grep -v 'drivers/infiniband/' | \
|
||||
grep -v 'net/sunrpc/xprtrdma/' | \
|
||||
grep -v 'net/rds/' | \
|
||||
grep -v 'extra/ib_srpt'; \
|
||||
cat $(OFED_MODULE_SYMVERS) \
|
||||
) >$@; \
|
||||
fi \
|
||||
else \
|
||||
if [ -n "$(OFED_KERNEL_IB_DEVEL_RPM)" ]; then \
|
||||
@@ -174,7 +141,6 @@ src/$(MODULE_SYMVERS): $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) \
|
||||
false; \
|
||||
else \
|
||||
echo " Building against in-tree InfiniBand kernel headers."; \
|
||||
cp $< $@; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
@@ -182,12 +148,105 @@ clean:
|
||||
rm -rf conftest/pre_cflags conftest/kcflags
|
||||
for d in conftest/* src; do \
|
||||
[ -d "$$d" ] && $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/$$d clean; \
|
||||
rm -f $$d/result*.txt; \
|
||||
done
|
||||
rm -f src/$(MODULE_SYMVERS) src/Module.markers src/modules.order
|
||||
|
||||
extraclean: clean
|
||||
rm -f *.orig *.rej
|
||||
|
||||
conftest/cm_listen/result-$(KVER).txt: \
|
||||
conftest/cm_listen/cm_listen.c \
|
||||
conftest/cm_listen/Makefile
|
||||
echo "$(call run_conftest,cm_listen, \
|
||||
-DIB_CM_LISTEN_TAKES_FOURTH_ARG)" >"$@"
|
||||
|
||||
conftest/create_cq/result-$(KVER).txt: \
|
||||
conftest/create_cq/create_cq.c \
|
||||
conftest/create_cq/Makefile
|
||||
echo "$(call run_conftest,create_cq, \
|
||||
-DIB_CREATE_CQ_HAS_INIT_ATTR)" >"$@"
|
||||
|
||||
conftest/create_send_mad_ah/result-$(KVER).txt: \
|
||||
conftest/create_send_mad_ah/create_send_mad_ah.c \
|
||||
conftest/create_send_mad_ah/Makefile
|
||||
echo "$(call run_conftest,create_send_mad_ah, \
|
||||
-DCREATE_SEND_MAD_HAS_AH_ARG)" >"$@"
|
||||
|
||||
conftest/create_send_mad_base/result-$(KVER).txt: \
|
||||
conftest/create_send_mad_base/create_send_mad_base.c \
|
||||
conftest/create_send_mad_base/Makefile
|
||||
echo "$(call run_conftest,create_send_mad_base, \
|
||||
-DCREATE_SEND_MAD_HAS_BASE_ARG)" >"$@"
|
||||
|
||||
conftest/gid_change/result-$(KVER).txt: \
|
||||
conftest/gid_change/gid_change.c \
|
||||
conftest/gid_change/Makefile
|
||||
echo "$(call run_conftest,gid_change,-DHAVE_IB_EVENT_GID_CHANGE)" >"$@"
|
||||
|
||||
conftest/ib_client_remove/result-$(KVER).txt: \
|
||||
conftest/ib_client_remove/ib_client_remove.c \
|
||||
conftest/ib_client_remove/Makefile
|
||||
echo "$(call run_conftest,ib_client_remove, \
|
||||
-DIB_CLIENT_REMOVE_TAKES_TWO_ARGS)" >"$@"
|
||||
|
||||
conftest/ib_dma_map_ops/result-$(KVER).txt: \
|
||||
conftest/ib_dma_map_ops/ib_dma_map_ops.c \
|
||||
conftest/ib_dma_map_ops/Makefile
|
||||
echo "$(call run_conftest,ib_dma_map_ops,-DHAVE_IB_DMA_MAP_OPS)" >"$@"
|
||||
|
||||
conftest/ib_set_cpi_resp_time/result-$(KVER).txt: \
|
||||
conftest/ib_set_cpi_resp_time/ib_set_cpi_resp_time.c \
|
||||
conftest/ib_set_cpi_resp_time/Makefile
|
||||
echo "$(call run_conftest,ib_set_cpi_resp_time, \
|
||||
-DHAVE_IB_SET_CPI_RESP_TIME)" >"$@"
|
||||
|
||||
conftest/mad_handler_takes_send_buf/result-$(KVER).txt: \
|
||||
conftest/mad_handler_takes_send_buf/mad_handler_takes_send_buf.c\
|
||||
conftest/mad_handler_takes_send_buf/Makefile
|
||||
echo "$(call run_conftest,mad_handler_takes_send_buf, \
|
||||
-DMAD_HANDLER_TAKES_SEND_BUF)" >"$@"
|
||||
|
||||
conftest/pd_has_local_dma_lkey/result-$(KVER).txt: \
|
||||
conftest/pd_has_local_dma_lkey/pd_has_local_dma_lkey.c \
|
||||
conftest/pd_has_local_dma_lkey/Makefile
|
||||
echo "$(call run_conftest,pd_has_local_dma_lkey, \
|
||||
-DIB_PD_HAS_LOCAL_DMA_LKEY)" >"$@"
|
||||
|
||||
conftest/query_device/result-$(KVER).txt: \
|
||||
conftest/query_device/query_device.c \
|
||||
conftest/query_device/Makefile
|
||||
echo "$(call run_conftest,query_device,-DHAVE_IB_QUERY_DEVICE)" >"$@"
|
||||
|
||||
conftest/query_device_attr_arg/result-$(KVER).txt: \
|
||||
conftest/query_device_attr_arg/query_device_attr_arg.c \
|
||||
conftest/query_device_attr_arg/Makefile
|
||||
echo "$(call run_conftest,query_device_attr_arg, \
|
||||
-DIB_QUERY_DEVICE_HAS_ATTR_ARG)" >"$@"
|
||||
|
||||
conftest/query_gid/result-$(KVER).txt: \
|
||||
conftest/query_gid/query_gid.c \
|
||||
conftest/query_gid/Makefile
|
||||
echo "$(call run_conftest,query_gid,-DIB_QUERY_GID_HAS_ATTR_ARG)" >"$@"
|
||||
|
||||
conftest/rdma_create_id_net/result-$(KVER).txt: \
|
||||
conftest/rdma_create_id_net/rdma_create_id_net.c \
|
||||
conftest/rdma_create_id_net/Makefile
|
||||
echo "$(call run_conftest_bool,rdma_create_id_net, \
|
||||
RDMA_CREATE_ID_TAKES_NET_ARG)" >"$@"
|
||||
|
||||
conftest/register_mad_agent/result-$(KVER).txt: \
|
||||
conftest/register_mad_agent/register_mad_agent.c \
|
||||
conftest/register_mad_agent/Makefile
|
||||
echo "$(call run_conftest,register_mad_agent, \
|
||||
-DREGISTER_MAD_AGENT_HAS_FLAGS_ARG)" >"$@"
|
||||
|
||||
conftest/use_pre_440_wr_structure/result-$(KVER).txt: \
|
||||
conftest/use_pre_440_wr_structure/use_pre_440_wr_structure.c \
|
||||
conftest/use_pre_440_wr_structure/Makefile
|
||||
echo "$(call run_conftest,use_pre_440_wr_structure, \
|
||||
-DUSE_PRE_440_WR_STRUCTURE)" >"$@"
|
||||
|
||||
2debug:
|
||||
-$(MAKE) clean
|
||||
$(call set_var,build_mode,BUILDMODE,)
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
/* 8 byte ASCII Vendor */
|
||||
#define VENDOR "SCST_USR"
|
||||
/* 4 byte ASCII Product Revision Level - left aligned */
|
||||
#define FIO_REV " 330"
|
||||
#define FIO_REV "330 "
|
||||
|
||||
#define MAX_USN_LEN (20+1) /* For '\0' */
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ int wait_until_finished(pid_t pid, unsigned long deadline, int *status, int chil
|
||||
}
|
||||
break;
|
||||
}
|
||||
sleep(0.1);
|
||||
usleep(100*1000);
|
||||
time(&end);
|
||||
elapsed = difftime(end, start);
|
||||
} while (elapsed < deadline);
|
||||
|
||||
Reference in New Issue
Block a user