mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-23 13:41:27 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -142,9 +142,9 @@ int isert_post_send(struct isert_connection *isert_conn,
|
||||
return err;
|
||||
}
|
||||
|
||||
static void isert_post_drain_sq(struct isert_connection* isert_conn)
|
||||
static void isert_post_drain_sq(struct isert_connection *isert_conn)
|
||||
{
|
||||
struct ib_send_wr* bad_wr;
|
||||
struct ib_send_wr *bad_wr;
|
||||
struct isert_wr *drain_wr_sq = &isert_conn->drain_wr_sq;
|
||||
int err;
|
||||
|
||||
@@ -163,12 +163,13 @@ static void isert_post_drain_sq(struct isert_connection* isert_conn)
|
||||
#endif
|
||||
if (unlikely(err)) {
|
||||
PRINT_ERROR("Failed to post drain wr to send queue, err:%d", err);
|
||||
/* We need to decrement iser_conn->kref in order to be able to cleanup
|
||||
* the connection */
|
||||
/*
|
||||
* We need to decrement iser_conn->kref in order to be able to
|
||||
* clean up the connection.
|
||||
*/
|
||||
set_bit(ISERT_DRAINED_SQ, &isert_conn->flags);
|
||||
if (test_bit(ISERT_DRAINED_RQ, &isert_conn->flags)) {
|
||||
if (test_bit(ISERT_DRAINED_RQ, &isert_conn->flags))
|
||||
isert_sched_conn_free(isert_conn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,11 +185,11 @@ static void isert_post_drain_rq(struct isert_connection *isert_conn)
|
||||
err = ib_post_recv(isert_conn->qp,
|
||||
&drain_wr_rq->recv_wr, &bad_wr);
|
||||
if (unlikely(err)) {
|
||||
PRINT_ERROR("Failed to post drain wr to receive queue, err:%d", err);
|
||||
PRINT_ERROR("Failed to post drain wr to receive queue, err:%d",
|
||||
err);
|
||||
set_bit(ISERT_DRAINED_RQ, &isert_conn->flags);
|
||||
if (test_bit(ISERT_DRAINED_SQ, &isert_conn->flags)) {
|
||||
if (test_bit(ISERT_DRAINED_SQ, &isert_conn->flags))
|
||||
isert_sched_conn_free(isert_conn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,8 +357,8 @@ static void isert_recv_completion_handler(struct isert_wr *wr)
|
||||
ISER_HDRS_SZ,
|
||||
DMA_FROM_DEVICE);
|
||||
isert_rx_pdu_parse_headers(pdu);
|
||||
isert_dma_sync_data_for_cpu(ib_dev, sge,
|
||||
pdu->iscsi.pdu.datasize + pdu->iscsi.pdu.ahssize);
|
||||
isert_dma_sync_data_for_cpu(ib_dev, sge, pdu->iscsi.pdu.datasize +
|
||||
pdu->iscsi.pdu.ahssize);
|
||||
|
||||
switch (pdu->isert_opcode) {
|
||||
case ISER_ISCSI_CTRL:
|
||||
@@ -710,12 +711,11 @@ static void isert_handle_wc_error(struct ib_wc *wc)
|
||||
#endif
|
||||
if (unlikely(num_sge == 0)) { /* Drain WR */
|
||||
set_bit(ISERT_DRAINED_SQ, &isert_conn->flags);
|
||||
if (test_bit(ISERT_DRAINED_RQ, &isert_conn->flags)) {
|
||||
if (test_bit(ISERT_DRAINED_RQ, &isert_conn->flags))
|
||||
isert_sched_conn_drained(isert_conn);
|
||||
}
|
||||
}
|
||||
else if (!isert_pdu->is_fake_rx)
|
||||
} else if (!isert_pdu->is_fake_rx) {
|
||||
isert_pdu_err(&isert_pdu->iscsi);
|
||||
}
|
||||
break;
|
||||
case ISER_WR_RDMA_READ:
|
||||
if (isert_buf->sg_cnt != 0) {
|
||||
@@ -731,15 +731,14 @@ static void isert_handle_wc_error(struct ib_wc *wc)
|
||||
num_sge = wr->recv_wr.num_sge;
|
||||
if (unlikely(num_sge == 0)) { /* Drain WR */
|
||||
set_bit(ISERT_DRAINED_RQ, &isert_conn->flags);
|
||||
if (test_bit(ISERT_DRAINED_SQ, &isert_conn->flags)) {
|
||||
if (test_bit(ISERT_DRAINED_SQ, &isert_conn->flags))
|
||||
isert_sched_conn_drained(isert_conn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ISER_WR_RDMA_WRITE:
|
||||
if (isert_buf->sg_cnt != 0) {
|
||||
ib_dma_unmap_sg(ib_dev, isert_buf->sg, isert_buf->sg_cnt,
|
||||
isert_buf->dma_dir);
|
||||
ib_dma_unmap_sg(ib_dev, isert_buf->sg,
|
||||
isert_buf->sg_cnt, isert_buf->dma_dir);
|
||||
isert_buf->sg_cnt = 0;
|
||||
}
|
||||
/*
|
||||
@@ -988,7 +987,8 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
goto free_isert_dev;
|
||||
}
|
||||
|
||||
isert_dev->cq_desc = vmalloc(sizeof(*isert_dev->cq_desc) * isert_dev->num_cqs);
|
||||
isert_dev->cq_desc = vmalloc(sizeof(*isert_dev->cq_desc) *
|
||||
isert_dev->num_cqs);
|
||||
if (unlikely(isert_dev->cq_desc == NULL)) {
|
||||
PRINT_ERROR("Failed to allocate %ld bytes for iser cq_desc",
|
||||
sizeof(*isert_dev->cq_desc) * isert_dev->num_cqs);
|
||||
@@ -1074,14 +1074,17 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
if (unlikely(IS_ERR(cq))) {
|
||||
cq_desc->cq = NULL;
|
||||
err = PTR_ERR(cq);
|
||||
PRINT_ERROR("Failed to create iser dev cq, err:%d", err);
|
||||
PRINT_ERROR("Failed to create iser dev cq, err:%d",
|
||||
err);
|
||||
goto fail_cq;
|
||||
}
|
||||
|
||||
cq_desc->cq = cq;
|
||||
err = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS);
|
||||
err = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP |
|
||||
IB_CQ_REPORT_MISSED_EVENTS);
|
||||
if (unlikely(err)) {
|
||||
PRINT_ERROR("Failed to request notify cq, err: %d", err);
|
||||
PRINT_ERROR("Failed to request notify cq, err: %d",
|
||||
err);
|
||||
goto fail_cq;
|
||||
}
|
||||
}
|
||||
@@ -1303,7 +1306,8 @@ static struct isert_connection *isert_conn_create(struct rdma_cm_id *cm_id,
|
||||
|
||||
err = isert_post_recv(isert_conn, &isert_conn->login_req_pdu->wr[0], 1);
|
||||
if (unlikely(err)) {
|
||||
PRINT_ERROR("Failed to post recv login req rx buf, err:%d", err);
|
||||
PRINT_ERROR("Failed to post recv login req rx buf, err:%d",
|
||||
err);
|
||||
goto fail_post_recv;
|
||||
}
|
||||
|
||||
@@ -1340,9 +1344,8 @@ static void isert_deref_device(struct isert_device *isert_dev)
|
||||
static void isert_kref_free(struct kref *kref)
|
||||
{
|
||||
struct isert_conn_dev *dev;
|
||||
struct isert_connection *isert_conn = container_of(kref,
|
||||
struct isert_connection,
|
||||
kref);
|
||||
struct isert_connection *isert_conn =
|
||||
container_of(kref, struct isert_connection, kref);
|
||||
struct isert_device *isert_dev = isert_conn->isert_dev;
|
||||
struct isert_cq *cq = isert_conn->qp->recv_cq->cq_context;
|
||||
|
||||
@@ -1390,15 +1393,16 @@ void isert_conn_free(struct isert_connection *isert_conn)
|
||||
}
|
||||
|
||||
static int isert_cm_disconnected_handler(struct rdma_cm_id *cm_id,
|
||||
struct rdma_cm_event *event)
|
||||
struct rdma_cm_event *event)
|
||||
{
|
||||
struct isert_connection *isert_conn = cm_id->qp->qp_context;
|
||||
|
||||
if (!test_and_set_bit(ISERT_CONNECTION_CLOSE, &isert_conn->flags))
|
||||
isert_sched_conn_closed(isert_conn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void isert_immediate_conn_close(struct isert_connection* isert_conn)
|
||||
static void isert_immediate_conn_close(struct isert_connection *isert_conn)
|
||||
{
|
||||
set_bit(ISERT_CONNECTION_ABORTED, &isert_conn->flags);
|
||||
set_bit(ISERT_CONNECTION_CLOSE, &isert_conn->flags);
|
||||
@@ -1472,9 +1476,11 @@ static int isert_cm_conn_req_handler(struct rdma_cm_id *cm_id,
|
||||
tgt_conn_param.rnr_retry_count =
|
||||
ini_conn_param->rnr_retry_count;
|
||||
|
||||
tgt_conn_param.initiator_depth = isert_dev->device_attr.max_qp_init_rd_atom;
|
||||
tgt_conn_param.initiator_depth =
|
||||
isert_dev->device_attr.max_qp_init_rd_atom;
|
||||
if (tgt_conn_param.initiator_depth > ini_conn_param->initiator_depth)
|
||||
tgt_conn_param.initiator_depth = ini_conn_param->initiator_depth;
|
||||
tgt_conn_param.initiator_depth =
|
||||
ini_conn_param->initiator_depth;
|
||||
|
||||
tgt_conn_param.private_data_len = sizeof(cm_hdr);
|
||||
tgt_conn_param.private_data = &cm_hdr;
|
||||
@@ -1485,7 +1491,8 @@ static int isert_cm_conn_req_handler(struct rdma_cm_id *cm_id,
|
||||
|
||||
err = rdma_accept(cm_id, &tgt_conn_param);
|
||||
if (unlikely(err)) {
|
||||
PRINT_ERROR("Failed to accept conn request, err:%d conn:%p", err, isert_conn);
|
||||
PRINT_ERROR("Failed to accept conn request, err:%d conn:%p",
|
||||
err, isert_conn);
|
||||
goto fail_accept;
|
||||
}
|
||||
|
||||
@@ -1570,9 +1577,8 @@ static int isert_cm_connect_handler(struct rdma_cm_id *cm_id,
|
||||
ret = isert_conn_established(&isert_conn->iscsi,
|
||||
(struct sockaddr *)&isert_conn->peer_addr,
|
||||
isert_conn->peer_addrsz);
|
||||
if (unlikely(ret)) {
|
||||
if (unlikely(ret))
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (push_saved_pdu) {
|
||||
PRINT_INFO("iser push saved rx pdu");
|
||||
@@ -1727,12 +1733,12 @@ static int isert_cm_evt_handler(struct rdma_cm_id *cm_id,
|
||||
/* We can receive this instead of RDMA_CM_EVENT_ESTABLISHED */
|
||||
case RDMA_CM_EVENT_UNREACHABLE:
|
||||
{
|
||||
struct isert_connection *isert_conn = cm_id->qp->qp_context;
|
||||
struct isert_connection *isert_conn =
|
||||
cm_id->qp->qp_context;
|
||||
|
||||
mutex_lock(&isert_conn->state_mutex);
|
||||
if (isert_conn->state != ISER_CONN_CLOSING) {
|
||||
if (isert_conn->state != ISER_CONN_CLOSING)
|
||||
isert_immediate_conn_close(isert_conn);
|
||||
}
|
||||
mutex_unlock(&isert_conn->state_mutex);
|
||||
err = 0;
|
||||
}
|
||||
@@ -1837,8 +1843,8 @@ int isert_portal_listen(struct isert_portal *portal,
|
||||
NIPQUAD(((struct sockaddr_in *)sa)->sin_addr.s_addr),
|
||||
(int)ntohs(((struct sockaddr_in *)sa)->sin_port));
|
||||
#else
|
||||
PRINT_INFO("iser portal cm_id:%p listens on: "
|
||||
"%pI4:%d", portal->cm_id,
|
||||
PRINT_INFO("iser portal cm_id:%p listens on: %pI4:%d",
|
||||
portal->cm_id,
|
||||
&((struct sockaddr_in *)sa)->sin_addr.s_addr,
|
||||
(int)ntohs(((struct sockaddr_in *)sa)->sin_port));
|
||||
#endif
|
||||
@@ -1851,8 +1857,8 @@ int isert_portal_listen(struct isert_portal *portal,
|
||||
NIP6(((struct sockaddr_in6 *)sa)->sin6_addr),
|
||||
(int)ntohs(((struct sockaddr_in6 *)sa)->sin6_port));
|
||||
#else
|
||||
PRINT_INFO("iser portal cm_id:%p listens on: "
|
||||
"%pI6 %d", portal->cm_id,
|
||||
PRINT_INFO("iser portal cm_id:%p listens on: %pI6 %d",
|
||||
portal->cm_id,
|
||||
&((struct sockaddr_in6 *)sa)->sin6_addr,
|
||||
(int)ntohs(((struct sockaddr_in6 *)sa)->sin6_port));
|
||||
#endif
|
||||
@@ -1902,9 +1908,8 @@ void isert_portal_release(struct isert_portal *portal)
|
||||
isert_portal_free(portal);
|
||||
mutex_unlock(&dev_list_mutex);
|
||||
|
||||
while (portal->refcnt > 0) {
|
||||
while (portal->refcnt > 0)
|
||||
msleep(100);
|
||||
}
|
||||
|
||||
PRINT_INFO("done releasing portal %p", portal);
|
||||
}
|
||||
|
||||
@@ -205,8 +205,8 @@ static void isert_cmnd_free(struct iscsi_cmnd *cmnd)
|
||||
if (unlikely(cmnd->on_write_list || cmnd->on_write_timeout_list)) {
|
||||
struct iscsi_scsi_cmd_hdr *req = cmnd_hdr(cmnd);
|
||||
|
||||
PRINT_CRIT_ERROR("cmnd %p still on some list?, %x, %x, %x, "
|
||||
"%x, %x, %x, %x", cmnd, req->opcode, req->scb[0],
|
||||
PRINT_CRIT_ERROR("cmnd %p still on some list?, %x, %x, %x, %x, %x, %x, %x",
|
||||
cmnd, req->opcode, req->scb[0],
|
||||
req->flags, req->itt, be32_to_cpu(req->data_length),
|
||||
req->cmd_sn,
|
||||
be32_to_cpu((__force __be32)(cmnd->pdu.datasize)));
|
||||
@@ -394,17 +394,17 @@ int isert_pdu_sent(struct iscsi_cmnd *pdu)
|
||||
|
||||
if (unlikely(pdu->should_close_conn)) {
|
||||
if (pdu->should_close_all_conn) {
|
||||
struct iscsi_target *target = pdu->conn->session->target;
|
||||
struct iscsi_target *target =
|
||||
pdu->conn->session->target;
|
||||
|
||||
PRINT_INFO("Closing all connections for target %x at "
|
||||
"initiator's %s request", target->tid,
|
||||
conn->session->initiator_name);
|
||||
PRINT_INFO("Closing all connections for target %x at initiator's %s request",
|
||||
target->tid, conn->session->initiator_name);
|
||||
mutex_lock(&target->target_mutex);
|
||||
target_del_all_sess(target, 0);
|
||||
mutex_unlock(&target->target_mutex);
|
||||
} else {
|
||||
PRINT_INFO("Closing connection %p at initiator's %s "
|
||||
"request", conn, conn->session->initiator_name);
|
||||
PRINT_INFO("Closing connection %p at initiator's %s request",
|
||||
conn, conn->session->initiator_name);
|
||||
mark_conn_closed(conn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,8 @@ static struct isert_conn_dev *get_available_dev(struct isert_listener_dev *dev,
|
||||
res->occupied = 1;
|
||||
res->conn = conn;
|
||||
isert_set_priv(conn, res);
|
||||
list_add_tail(&res->conn_list_entry, &dev->new_conn_list);
|
||||
list_add_tail(&res->conn_list_entry,
|
||||
&dev->new_conn_list);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -446,9 +447,9 @@ int isert_conn_established(struct iscsi_conn *iscsi_conn,
|
||||
return add_new_connection(&isert_listen_dev, iscsi_conn);
|
||||
}
|
||||
|
||||
static void isert_dev_disconnect(struct iscsi_conn* iscsi_conn)
|
||||
static void isert_dev_disconnect(struct iscsi_conn *iscsi_conn)
|
||||
{
|
||||
struct isert_conn_dev* dev = isert_get_priv(iscsi_conn);
|
||||
struct isert_conn_dev *dev = isert_get_priv(iscsi_conn);
|
||||
|
||||
if (dev) {
|
||||
isert_del_timer(dev);
|
||||
@@ -486,14 +487,16 @@ void isert_connection_closed(struct iscsi_conn *iscsi_conn)
|
||||
|
||||
void isert_connection_abort(struct iscsi_conn *iscsi_conn)
|
||||
{
|
||||
struct isert_connection *isert_conn = (struct isert_connection *)iscsi_conn;
|
||||
struct isert_connection *isert_conn =
|
||||
container_of(iscsi_conn, struct isert_connection, iscsi);
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&conn_mgmt_mutex);
|
||||
|
||||
if (!iscsi_conn->rd_state) {
|
||||
if (!test_and_set_bit(ISERT_DISCON_CALLED, &isert_conn->flags)) {
|
||||
if (!test_and_set_bit(ISERT_DISCON_CALLED,
|
||||
&isert_conn->flags)) {
|
||||
isert_dev_disconnect(iscsi_conn);
|
||||
isert_free_connection(iscsi_conn);
|
||||
}
|
||||
@@ -721,7 +724,7 @@ static ssize_t isert_write(struct file *filp, const char __user *buf,
|
||||
static bool is_last_login_rsp(struct iscsi_login_rsp_hdr *rsp)
|
||||
{
|
||||
return (rsp->flags & ISCSI_FLG_TRANSIT) &&
|
||||
((rsp->flags & ISCSI_FLG_NSG_MASK) == ISCSI_FLG_NSG_FULL_FEATURE);
|
||||
(rsp->flags & ISCSI_FLG_NSG_MASK) == ISCSI_FLG_NSG_FULL_FEATURE;
|
||||
}
|
||||
|
||||
static long isert_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
@@ -771,7 +774,8 @@ static long isert_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
}
|
||||
|
||||
dev->state = CS_RSP_FINISHED;
|
||||
rsp = (struct iscsi_login_rsp_hdr *)(&dev->login_rsp->pdu.bhs);
|
||||
rsp = (struct iscsi_login_rsp_hdr *)
|
||||
&dev->login_rsp->pdu.bhs;
|
||||
last = is_last_login_rsp(rsp);
|
||||
|
||||
dev->login_rsp->bufflen -= dev->write_len;
|
||||
@@ -795,8 +799,8 @@ static long isert_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
struct isert_addr_info addr;
|
||||
|
||||
res = isert_get_target_addr(dev->conn,
|
||||
(struct sockaddr *)&addr.addr,
|
||||
&addr.addr_len);
|
||||
(struct sockaddr *)&addr.addr,
|
||||
&addr.addr_len);
|
||||
if (unlikely(res))
|
||||
goto out;
|
||||
|
||||
|
||||
@@ -3,29 +3,32 @@
|
||||
ABT_DETAILS="x86_64"
|
||||
ABT_JOBS=5
|
||||
ABT_KERNELS=" \
|
||||
4.4.1 \
|
||||
4.3.5-nc \
|
||||
4.7.1 \
|
||||
4.6.7-nc \
|
||||
4.5.7-nc \
|
||||
4.4.18-nc \
|
||||
4.3.6-nc \
|
||||
4.2.8-nc \
|
||||
4.1.17-nc \
|
||||
4.1.30-nc \
|
||||
4.0.9-nc \
|
||||
3.19.8-nc \
|
||||
3.18.26-nc \
|
||||
3.18.39-nc \
|
||||
3.17.8-nc \
|
||||
3.16.7-nc \
|
||||
3.16.36-nc \
|
||||
3.15.10-nc \
|
||||
3.14.60-nc \
|
||||
3.14.76-nc \
|
||||
3.13.11-nc \
|
||||
3.12.53-nc \
|
||||
3.12.62-nc \
|
||||
3.11.10-nc \
|
||||
3.10.96-nc \
|
||||
3.10.102-nc \
|
||||
3.9.11-nc \
|
||||
3.8.13-nc \
|
||||
3.7.10-nc \
|
||||
3.6.11-nc \
|
||||
3.5.7-nc \
|
||||
3.4.110-nc \
|
||||
3.4.112-nc \
|
||||
3.3.8-nc \
|
||||
3.2.76-nc \
|
||||
3.2.81-nc \
|
||||
3.1.10-nc \
|
||||
3.0.101-nc \
|
||||
2.6.39.4-nc \
|
||||
|
||||
@@ -3823,7 +3823,7 @@ static int vdisk_unmap_range(struct scst_cmd *cmd,
|
||||
err = blkdev_issue_discard(inode->i_bdev, start_sector, nr_sects, gfp);
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) \
|
||||
&& !(LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 34) \
|
||||
&& defined(CONFIG_SUSE_KERNEL))
|
||||
&& defined(CONFIG_SUSE_KERNEL))
|
||||
err = blkdev_issue_discard(inode->i_bdev, start_sector, nr_sects,
|
||||
gfp, DISCARD_FL_WAIT);
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
|
||||
|
||||
@@ -4095,7 +4095,7 @@ static ssize_t show_port_id(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
strcmp(sport->port_id, DEFAULT_SRPT_ID_STRING) ?
|
||||
SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
mutex_unlock(&sport->mutex);
|
||||
|
||||
|
||||
res = strlen(buf);
|
||||
|
||||
out:
|
||||
@@ -4113,7 +4113,7 @@ static ssize_t store_port_id(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
|
||||
if (!sport)
|
||||
goto out;
|
||||
|
||||
|
||||
end = buf + count;
|
||||
while (end > buf && isspace(((unsigned char *)end)[-1]))
|
||||
--end;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <scst.h>
|
||||
#endif
|
||||
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 5
|
||||
#define vlan_dev_vlan_id(dev) (panic("RHEL 5 misses vlan_dev_vlan_id()"),0)
|
||||
#define vlan_dev_vlan_id(dev) (panic("RHEL 5 misses vlan_dev_vlan_id()"), 0)
|
||||
#endif
|
||||
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 6
|
||||
#define __ethtool_get_settings(dev, cmd) (panic("RHEL misses __ethtool_get_settings()"), 0)
|
||||
|
||||
Reference in New Issue
Block a user