提交 40391761 编写于 作者: L Li Nan 提交者: Zheng Zengkai

Revert "scsi: iscsi: fix kabi broken in struct iscsi_transport"

hulk inclusion
category: bugfix
bugzilla: 188176, https://gitee.com/openeuler/kernel/issues/I67294
CVE: NA

--------------------------------

This reverts commit 230035ef.

Drivers use tgt_dscvr will compile failed because API has changed.
Signed-off-by: NLi Nan <linan122@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 04b5c3f2
无相关合并请求
......@@ -979,22 +979,17 @@ static struct scsi_host_template iscsi_iser_sht = {
.track_queue_depth = 1,
};
static struct iscsi_transport_expand iscsi_iser_expand = {
.unbind_conn = iscsi_conn_unbind,
};
static struct iscsi_transport iscsi_iser_transport = {
.owner = THIS_MODULE,
.name = "iser",
.caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_TEXT_NEGO
| CAP_OPS_EXPAND,
.caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_TEXT_NEGO,
/* session management */
.create_session = iscsi_iser_session_create,
.destroy_session = iscsi_iser_session_destroy,
/* connection management */
.create_conn = iscsi_iser_conn_create,
.bind_conn = iscsi_iser_conn_bind,
.ops_expand = &iscsi_iser_expand,
.unbind_conn = iscsi_conn_unbind,
.destroy_conn = iscsi_conn_teardown,
.attr_is_visible = iser_attr_is_visible,
.set_param = iscsi_iser_set_param,
......
......@@ -5801,21 +5801,16 @@ static struct pci_error_handlers beiscsi_eeh_handlers = {
.resume = beiscsi_eeh_resume,
};
struct iscsi_transport_expand beiscsi_iscsi_expand = {
.unbind_conn = iscsi_conn_unbind,
};
struct iscsi_transport beiscsi_iscsi_transport = {
.owner = THIS_MODULE,
.name = DRV_NAME,
.caps = CAP_RECOVERY_L0 | CAP_HDRDGST | CAP_TEXT_NEGO |
CAP_MULTI_R2T | CAP_DATADGST | CAP_DATA_PATH_OFFLOAD |
CAP_OPS_EXPAND,
CAP_MULTI_R2T | CAP_DATADGST | CAP_DATA_PATH_OFFLOAD,
.create_session = beiscsi_session_create,
.destroy_session = beiscsi_session_destroy,
.create_conn = beiscsi_conn_create,
.bind_conn = beiscsi_conn_bind,
.ops_expand = &beiscsi_iscsi_expand,
.unbind_conn = iscsi_conn_unbind,
.destroy_conn = iscsi_conn_teardown,
.attr_is_visible = beiscsi_attr_is_visible,
.set_iface_param = beiscsi_iface_set_param,
......
......@@ -2274,23 +2274,18 @@ static struct scsi_host_template bnx2i_host_template = {
.track_queue_depth = 1,
};
static struct iscsi_transport_expand bnx2i_iscsi_expand = {
.unbind_conn = iscsi_conn_unbind,
};
struct iscsi_transport bnx2i_iscsi_transport = {
.owner = THIS_MODULE,
.name = "bnx2i",
.caps = CAP_RECOVERY_L0 | CAP_HDRDGST |
CAP_MULTI_R2T | CAP_DATADGST |
CAP_DATA_PATH_OFFLOAD |
CAP_TEXT_NEGO | CAP_OPS_EXPAND,
CAP_TEXT_NEGO,
.create_session = bnx2i_session_create,
.destroy_session = bnx2i_session_destroy,
.create_conn = bnx2i_conn_create,
.bind_conn = bnx2i_conn_bind,
.ops_expand = &bnx2i_iscsi_expand,
.unbind_conn = iscsi_conn_unbind,
.destroy_conn = bnx2i_conn_destroy,
.attr_is_visible = bnx2i_attr_is_visible,
.set_param = iscsi_set_param,
......
......@@ -100,18 +100,13 @@ static struct scsi_host_template cxgb3i_host_template = {
.track_queue_depth = 1,
};
static struct iscsi_transport_expand cxgb3i_iscsi_expand = {
.unbind_conn = iscsi_conn_unbind,
};
static struct iscsi_transport cxgb3i_iscsi_transport = {
.owner = THIS_MODULE,
.name = DRV_MODULE_NAME,
/* owner and name should be set already */
.caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST
| CAP_DATADGST | CAP_DIGEST_OFFLOAD |
CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO |
CAP_OPS_EXPAND,
CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO,
.attr_is_visible = cxgbi_attr_is_visible,
.get_host_param = cxgbi_get_host_param,
.set_host_param = cxgbi_set_host_param,
......@@ -122,7 +117,7 @@ static struct iscsi_transport cxgb3i_iscsi_transport = {
/* connection management */
.create_conn = cxgbi_create_conn,
.bind_conn = cxgbi_bind_conn,
.ops_expand = &cxgb3i_iscsi_expand,
.unbind_conn = iscsi_conn_unbind,
.destroy_conn = iscsi_tcp_conn_teardown,
.start_conn = iscsi_conn_start,
.stop_conn = iscsi_conn_stop,
......
......@@ -118,17 +118,12 @@ static struct scsi_host_template cxgb4i_host_template = {
.track_queue_depth = 1,
};
static struct iscsi_transport_expand cxgb4i_iscsi_expand = {
.unbind_conn = iscsi_conn_unbind,
};
static struct iscsi_transport cxgb4i_iscsi_transport = {
.owner = THIS_MODULE,
.name = DRV_MODULE_NAME,
.caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST |
CAP_DATADGST | CAP_DIGEST_OFFLOAD |
CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO |
CAP_OPS_EXPAND,
CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO,
.attr_is_visible = cxgbi_attr_is_visible,
.get_host_param = cxgbi_get_host_param,
.set_host_param = cxgbi_set_host_param,
......@@ -139,7 +134,7 @@ static struct iscsi_transport cxgb4i_iscsi_transport = {
/* connection management */
.create_conn = cxgbi_create_conn,
.bind_conn = cxgbi_bind_conn,
.ops_expand = &cxgb4i_iscsi_expand,
.unbind_conn = iscsi_conn_unbind,
.destroy_conn = iscsi_tcp_conn_teardown,
.start_conn = iscsi_conn_start,
.stop_conn = iscsi_conn_stop,
......
......@@ -1429,20 +1429,16 @@ static void qedi_cleanup_task(struct iscsi_task *task)
cmd->scsi_cmd = NULL;
}
static struct iscsi_transport_expand qedi_iscsi_expand = {
.unbind_conn = iscsi_conn_unbind,
};
struct iscsi_transport qedi_iscsi_transport = {
.owner = THIS_MODULE,
.name = QEDI_MODULE_NAME,
.caps = CAP_RECOVERY_L0 | CAP_HDRDGST | CAP_MULTI_R2T | CAP_DATADGST |
CAP_DATA_PATH_OFFLOAD | CAP_TEXT_NEGO | CAP_OPS_EXPAND,
CAP_DATA_PATH_OFFLOAD | CAP_TEXT_NEGO,
.create_session = qedi_session_create,
.destroy_session = qedi_session_destroy,
.create_conn = qedi_conn_create,
.bind_conn = qedi_conn_bind,
.ops_expand = &qedi_iscsi_expand,
.unbind_conn = iscsi_conn_unbind,
.start_conn = qedi_conn_start,
.stop_conn = iscsi_conn_stop,
.destroy_conn = qedi_conn_destroy,
......
......@@ -246,24 +246,20 @@ static struct scsi_host_template qla4xxx_driver_template = {
.vendor_id = SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_QLOGIC,
};
static struct iscsi_transport_expand qla4xxx_iscsi_expand = {
.unbind_conn = iscsi_conn_unbind,
};
static struct iscsi_transport qla4xxx_iscsi_transport = {
.owner = THIS_MODULE,
.name = DRIVER_NAME,
.caps = CAP_TEXT_NEGO |
CAP_DATA_PATH_OFFLOAD | CAP_HDRDGST |
CAP_DATADGST | CAP_LOGIN_OFFLOAD |
CAP_MULTI_R2T | CAP_OPS_EXPAND,
CAP_MULTI_R2T,
.attr_is_visible = qla4_attr_is_visible,
.create_session = qla4xxx_session_create,
.destroy_session = qla4xxx_session_destroy,
.start_conn = qla4xxx_conn_start,
.create_conn = qla4xxx_conn_create,
.bind_conn = qla4xxx_conn_bind,
.ops_expand = &qla4xxx_iscsi_expand,
.unbind_conn = iscsi_conn_unbind,
.stop_conn = iscsi_conn_stop,
.destroy_conn = qla4xxx_conn_destroy,
.set_param = iscsi_set_param,
......
......@@ -2257,11 +2257,7 @@ static void iscsi_ep_disconnect(struct iscsi_cls_conn *conn, bool is_active)
ep = conn->ep;
conn->ep = NULL;
if (session->transport->caps & CAP_OPS_EXPAND &&
session->transport->ops_expand &&
session->transport->ops_expand->unbind_conn)
session->transport->ops_expand->unbind_conn(conn, is_active);
session->transport->unbind_conn(conn, is_active);
session->transport->ep_disconnect(ep);
ISCSI_DBG_TRANS_CONN(conn, "disconnect ep done.\n");
}
......@@ -3228,19 +3224,10 @@ iscsi_tgt_dscvr(struct iscsi_transport *transport,
struct Scsi_Host *shost;
struct sockaddr *dst_addr;
int err;
int (*tgt_dscvr)(struct Scsi_Host *shost, enum iscsi_tgt_dscvr type,
uint32_t enable, struct sockaddr *dst_addr);
if (transport->caps & CAP_OPS_EXPAND) {
if (!transport->ops_expand || !transport->ops_expand->tgt_dscvr)
return -EINVAL;
tgt_dscvr = transport->ops_expand->tgt_dscvr;
} else {
if (!transport->ops_expand)
return -EINVAL;
tgt_dscvr = (int (*)(struct Scsi_Host *, enum iscsi_tgt_dscvr, uint32_t,
struct sockaddr *))(transport->ops_expand);
}
if (!transport->tgt_dscvr)
return -EINVAL;
shost = scsi_host_lookup(ev->u.tgt_dscvr.host_no);
if (!shost) {
printk(KERN_ERR "target discovery could not find host no %u\n",
......@@ -3250,8 +3237,8 @@ iscsi_tgt_dscvr(struct iscsi_transport *transport,
dst_addr = (struct sockaddr *)((char*)ev + sizeof(*ev));
err = tgt_dscvr(shost, ev->u.tgt_dscvr.type,
ev->u.tgt_dscvr.enable, dst_addr);
err = transport->tgt_dscvr(shost, ev->u.tgt_dscvr.type,
ev->u.tgt_dscvr.enable, dst_addr);
scsi_host_put(shost);
return err;
}
......@@ -4904,10 +4891,8 @@ iscsi_register_transport(struct iscsi_transport *tt)
int err;
BUG_ON(!tt);
if (tt->caps & CAP_OPS_EXPAND) {
BUG_ON(!tt->ops_expand);
WARN_ON(tt->ep_disconnect && !tt->ops_expand->unbind_conn);
}
WARN_ON(tt->ep_disconnect && !tt->unbind_conn);
priv = iscsi_if_transport_lookup(tt);
if (priv)
return NULL;
......
......@@ -761,7 +761,6 @@ enum iscsi_ping_status_code {
and verification */
#define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */
#define CAP_OPS_EXPAND 0x8000 /* oiscsi_transport->ops_expand flag */
/*
* These flags describes reason of stop_conn() call
*/
......
......@@ -29,15 +29,6 @@ struct bsg_job;
struct iscsi_bus_flash_session;
struct iscsi_bus_flash_conn;
/*
* The expansion of iscsi_transport to fix kabi while adding members.
*/
struct iscsi_transport_expand {
int (*tgt_dscvr)(struct Scsi_Host *shost, enum iscsi_tgt_dscvr type,
uint32_t enable, struct sockaddr *dst_addr);
void (*unbind_conn)(struct iscsi_cls_conn *conn, bool is_active);
};
/**
* struct iscsi_transport - iSCSI Transport template
*
......@@ -91,6 +82,7 @@ struct iscsi_transport {
void (*destroy_session) (struct iscsi_cls_session *session);
struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess,
uint32_t cid);
void (*unbind_conn) (struct iscsi_cls_conn *conn, bool is_active);
int (*bind_conn) (struct iscsi_cls_session *session,
struct iscsi_cls_conn *cls_conn,
uint64_t transport_eph, int is_leading);
......@@ -132,15 +124,8 @@ struct iscsi_transport {
int non_blocking);
int (*ep_poll) (struct iscsi_endpoint *ep, int timeout_ms);
void (*ep_disconnect) (struct iscsi_endpoint *ep);
#ifdef __GENKSYMS__
int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type,
uint32_t enable, struct sockaddr *dst_addr);
#else
/*
* onece ops_expand is used, caps must be set to CAP_OPS_EXPAND
*/
struct iscsi_transport_expand *ops_expand;
#endif
int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params);
int (*set_iface_param) (struct Scsi_Host *shost, void *data,
uint32_t len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部