Merge branches 'misc', 'qedr', 'reject-helpers', 'rxe' and 'srp' into merge-test
这个提交包含在:

@@ -57,6 +57,54 @@ MODULE_AUTHOR("Sean Hefty");
|
||||
MODULE_DESCRIPTION("InfiniBand CM");
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
|
||||
static const char * const ibcm_rej_reason_strs[] = {
|
||||
[IB_CM_REJ_NO_QP] = "no QP",
|
||||
[IB_CM_REJ_NO_EEC] = "no EEC",
|
||||
[IB_CM_REJ_NO_RESOURCES] = "no resources",
|
||||
[IB_CM_REJ_TIMEOUT] = "timeout",
|
||||
[IB_CM_REJ_UNSUPPORTED] = "unsupported",
|
||||
[IB_CM_REJ_INVALID_COMM_ID] = "invalid comm ID",
|
||||
[IB_CM_REJ_INVALID_COMM_INSTANCE] = "invalid comm instance",
|
||||
[IB_CM_REJ_INVALID_SERVICE_ID] = "invalid service ID",
|
||||
[IB_CM_REJ_INVALID_TRANSPORT_TYPE] = "invalid transport type",
|
||||
[IB_CM_REJ_STALE_CONN] = "stale conn",
|
||||
[IB_CM_REJ_RDC_NOT_EXIST] = "RDC not exist",
|
||||
[IB_CM_REJ_INVALID_GID] = "invalid GID",
|
||||
[IB_CM_REJ_INVALID_LID] = "invalid LID",
|
||||
[IB_CM_REJ_INVALID_SL] = "invalid SL",
|
||||
[IB_CM_REJ_INVALID_TRAFFIC_CLASS] = "invalid traffic class",
|
||||
[IB_CM_REJ_INVALID_HOP_LIMIT] = "invalid hop limit",
|
||||
[IB_CM_REJ_INVALID_PACKET_RATE] = "invalid packet rate",
|
||||
[IB_CM_REJ_INVALID_ALT_GID] = "invalid alt GID",
|
||||
[IB_CM_REJ_INVALID_ALT_LID] = "invalid alt LID",
|
||||
[IB_CM_REJ_INVALID_ALT_SL] = "invalid alt SL",
|
||||
[IB_CM_REJ_INVALID_ALT_TRAFFIC_CLASS] = "invalid alt traffic class",
|
||||
[IB_CM_REJ_INVALID_ALT_HOP_LIMIT] = "invalid alt hop limit",
|
||||
[IB_CM_REJ_INVALID_ALT_PACKET_RATE] = "invalid alt packet rate",
|
||||
[IB_CM_REJ_PORT_CM_REDIRECT] = "port CM redirect",
|
||||
[IB_CM_REJ_PORT_REDIRECT] = "port redirect",
|
||||
[IB_CM_REJ_INVALID_MTU] = "invalid MTU",
|
||||
[IB_CM_REJ_INSUFFICIENT_RESP_RESOURCES] = "insufficient resp resources",
|
||||
[IB_CM_REJ_CONSUMER_DEFINED] = "consumer defined",
|
||||
[IB_CM_REJ_INVALID_RNR_RETRY] = "invalid RNR retry",
|
||||
[IB_CM_REJ_DUPLICATE_LOCAL_COMM_ID] = "duplicate local comm ID",
|
||||
[IB_CM_REJ_INVALID_CLASS_VERSION] = "invalid class version",
|
||||
[IB_CM_REJ_INVALID_FLOW_LABEL] = "invalid flow label",
|
||||
[IB_CM_REJ_INVALID_ALT_FLOW_LABEL] = "invalid alt flow label",
|
||||
};
|
||||
|
||||
const char *__attribute_const__ ibcm_reject_msg(int reason)
|
||||
{
|
||||
size_t index = reason;
|
||||
|
||||
if (index < ARRAY_SIZE(ibcm_rej_reason_strs) &&
|
||||
ibcm_rej_reason_strs[index])
|
||||
return ibcm_rej_reason_strs[index];
|
||||
else
|
||||
return "unrecognized reason";
|
||||
}
|
||||
EXPORT_SYMBOL(ibcm_reject_msg);
|
||||
|
||||
static void cm_add_one(struct ib_device *device);
|
||||
static void cm_remove_one(struct ib_device *device, void *client_data);
|
||||
|
||||
@@ -1519,6 +1567,7 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
|
||||
struct cm_id_private *listen_cm_id_priv, *cur_cm_id_priv;
|
||||
struct cm_timewait_info *timewait_info;
|
||||
struct cm_req_msg *req_msg;
|
||||
struct ib_cm_id *cm_id;
|
||||
|
||||
req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad;
|
||||
|
||||
@@ -1540,10 +1589,18 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
|
||||
timewait_info = cm_insert_remote_qpn(cm_id_priv->timewait_info);
|
||||
if (timewait_info) {
|
||||
cm_cleanup_timewait(cm_id_priv->timewait_info);
|
||||
cur_cm_id_priv = cm_get_id(timewait_info->work.local_id,
|
||||
timewait_info->work.remote_id);
|
||||
|
||||
spin_unlock_irq(&cm.lock);
|
||||
cm_issue_rej(work->port, work->mad_recv_wc,
|
||||
IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ,
|
||||
NULL, 0);
|
||||
if (cur_cm_id_priv) {
|
||||
cm_id = &cur_cm_id_priv->id;
|
||||
ib_send_cm_dreq(cm_id, NULL, 0);
|
||||
cm_deref_id(cur_cm_id_priv);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1919,6 +1976,9 @@ static int cm_rep_handler(struct cm_work *work)
|
||||
struct cm_id_private *cm_id_priv;
|
||||
struct cm_rep_msg *rep_msg;
|
||||
int ret;
|
||||
struct cm_id_private *cur_cm_id_priv;
|
||||
struct ib_cm_id *cm_id;
|
||||
struct cm_timewait_info *timewait_info;
|
||||
|
||||
rep_msg = (struct cm_rep_msg *)work->mad_recv_wc->recv_buf.mad;
|
||||
cm_id_priv = cm_acquire_id(rep_msg->remote_comm_id, 0);
|
||||
@@ -1953,16 +2013,26 @@ static int cm_rep_handler(struct cm_work *work)
|
||||
goto error;
|
||||
}
|
||||
/* Check for a stale connection. */
|
||||
if (cm_insert_remote_qpn(cm_id_priv->timewait_info)) {
|
||||
timewait_info = cm_insert_remote_qpn(cm_id_priv->timewait_info);
|
||||
if (timewait_info) {
|
||||
rb_erase(&cm_id_priv->timewait_info->remote_id_node,
|
||||
&cm.remote_id_table);
|
||||
cm_id_priv->timewait_info->inserted_remote_id = 0;
|
||||
cur_cm_id_priv = cm_get_id(timewait_info->work.local_id,
|
||||
timewait_info->work.remote_id);
|
||||
|
||||
spin_unlock(&cm.lock);
|
||||
spin_unlock_irq(&cm_id_priv->lock);
|
||||
cm_issue_rej(work->port, work->mad_recv_wc,
|
||||
IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REP,
|
||||
NULL, 0);
|
||||
ret = -EINVAL;
|
||||
if (cur_cm_id_priv) {
|
||||
cm_id = &cur_cm_id_priv->id;
|
||||
ib_send_cm_dreq(cm_id, NULL, 0);
|
||||
cm_deref_id(cur_cm_id_priv);
|
||||
}
|
||||
|
||||
goto error;
|
||||
}
|
||||
spin_unlock(&cm.lock);
|
||||
|
@@ -101,6 +101,49 @@ const char *__attribute_const__ rdma_event_msg(enum rdma_cm_event_type event)
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_event_msg);
|
||||
|
||||
const char *__attribute_const__ rdma_reject_msg(struct rdma_cm_id *id,
|
||||
int reason)
|
||||
{
|
||||
if (rdma_ib_or_roce(id->device, id->port_num))
|
||||
return ibcm_reject_msg(reason);
|
||||
|
||||
if (rdma_protocol_iwarp(id->device, id->port_num))
|
||||
return iwcm_reject_msg(reason);
|
||||
|
||||
WARN_ON_ONCE(1);
|
||||
return "unrecognized transport";
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_reject_msg);
|
||||
|
||||
bool rdma_is_consumer_reject(struct rdma_cm_id *id, int reason)
|
||||
{
|
||||
if (rdma_ib_or_roce(id->device, id->port_num))
|
||||
return reason == IB_CM_REJ_CONSUMER_DEFINED;
|
||||
|
||||
if (rdma_protocol_iwarp(id->device, id->port_num))
|
||||
return reason == -ECONNREFUSED;
|
||||
|
||||
WARN_ON_ONCE(1);
|
||||
return false;
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_is_consumer_reject);
|
||||
|
||||
const void *rdma_consumer_reject_data(struct rdma_cm_id *id,
|
||||
struct rdma_cm_event *ev, u8 *data_len)
|
||||
{
|
||||
const void *p;
|
||||
|
||||
if (rdma_is_consumer_reject(id, ev->status)) {
|
||||
*data_len = ev->param.conn.private_data_len;
|
||||
p = ev->param.conn.private_data;
|
||||
} else {
|
||||
*data_len = 0;
|
||||
p = NULL;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_consumer_reject_data);
|
||||
|
||||
static void cma_add_one(struct ib_device *device);
|
||||
static void cma_remove_one(struct ib_device *device, void *client_data);
|
||||
|
||||
|
@@ -59,6 +59,27 @@ MODULE_AUTHOR("Tom Tucker");
|
||||
MODULE_DESCRIPTION("iWARP CM");
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
|
||||
static const char * const iwcm_rej_reason_strs[] = {
|
||||
[ECONNRESET] = "reset by remote host",
|
||||
[ECONNREFUSED] = "refused by remote application",
|
||||
[ETIMEDOUT] = "setup timeout",
|
||||
};
|
||||
|
||||
const char *__attribute_const__ iwcm_reject_msg(int reason)
|
||||
{
|
||||
size_t index;
|
||||
|
||||
/* iWARP uses negative errnos */
|
||||
index = -reason;
|
||||
|
||||
if (index < ARRAY_SIZE(iwcm_rej_reason_strs) &&
|
||||
iwcm_rej_reason_strs[index])
|
||||
return iwcm_rej_reason_strs[index];
|
||||
else
|
||||
return "unrecognized reason";
|
||||
}
|
||||
EXPORT_SYMBOL(iwcm_reject_msg);
|
||||
|
||||
static struct ibnl_client_cbs iwcm_nl_cb_table[] = {
|
||||
[RDMA_NL_IWPM_REG_PID] = {.dump = iwpm_register_pid_cb},
|
||||
[RDMA_NL_IWPM_ADD_MAPPING] = {.dump = iwpm_add_mapping_cb},
|
||||
|
@@ -769,7 +769,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
|
||||
* If we are at the start of the LID routed part, don't update the
|
||||
* hop_ptr or hop_cnt. See section 14.2.2, Vol 1 IB spec.
|
||||
*/
|
||||
if (opa && smp->class_version == OPA_SMP_CLASS_VERSION) {
|
||||
if (opa && smp->class_version == OPA_SM_CLASS_VERSION) {
|
||||
u32 opa_drslid;
|
||||
|
||||
if ((opa_get_smp_direction(opa_smp)
|
||||
@@ -1728,7 +1728,7 @@ find_mad_agent(struct ib_mad_port_private *port_priv,
|
||||
if (!class)
|
||||
goto out;
|
||||
if (convert_mgmt_class(mad_hdr->mgmt_class) >=
|
||||
IB_MGMT_MAX_METHODS)
|
||||
ARRAY_SIZE(class->method_table))
|
||||
goto out;
|
||||
method = class->method_table[convert_mgmt_class(
|
||||
mad_hdr->mgmt_class)];
|
||||
@@ -2149,7 +2149,7 @@ handle_smi(struct ib_mad_port_private *port_priv,
|
||||
struct ib_mad_hdr *mad_hdr = (struct ib_mad_hdr *)recv->mad;
|
||||
|
||||
if (opa && mad_hdr->base_version == OPA_MGMT_BASE_VERSION &&
|
||||
mad_hdr->class_version == OPA_SMI_CLASS_VERSION)
|
||||
mad_hdr->class_version == OPA_SM_CLASS_VERSION)
|
||||
return handle_opa_smi(port_priv, qp_info, wc, port_num, recv,
|
||||
response);
|
||||
|
||||
|
@@ -518,8 +518,11 @@ static void join_handler(int status, struct ib_sa_mcmember_rec *rec,
|
||||
process_join_error(group, status);
|
||||
else {
|
||||
int mgids_changed, is_mgid0;
|
||||
ib_find_pkey(group->port->dev->device, group->port->port_num,
|
||||
be16_to_cpu(rec->pkey), &pkey_index);
|
||||
|
||||
if (ib_find_pkey(group->port->dev->device,
|
||||
group->port->port_num, be16_to_cpu(rec->pkey),
|
||||
&pkey_index))
|
||||
pkey_index = MCAST_INVALID_PKEY_INDEX;
|
||||
|
||||
spin_lock_irq(&group->port->lock);
|
||||
if (group->state == MCAST_BUSY &&
|
||||
|
@@ -51,7 +51,7 @@ static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int d
|
||||
|
||||
if (umem->nmap > 0)
|
||||
ib_dma_unmap_sg(dev, umem->sg_head.sgl,
|
||||
umem->nmap,
|
||||
umem->npages,
|
||||
DMA_BIDIRECTIONAL);
|
||||
|
||||
for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) {
|
||||
|
在新工单中引用
屏蔽一个用户