Add OPA extended LID support
This patch series primarily increases sizes of variables that hold lid values from 16 to 32 bits. Additionally, it adds a check in the IB mad stack to verify a properly formatted MAD when OPA extended LIDs are used. Signed-off-by: Don Hiatt <don.hiatt@intel.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
@@ -1770,7 +1770,7 @@ static void cm_process_routed_req(struct cm_req_msg *req_msg, struct ib_wc *wc)
|
||||
{
|
||||
if (!cm_req_get_primary_subnet_local(req_msg)) {
|
||||
if (req_msg->primary_local_lid == IB_LID_PERMISSIVE) {
|
||||
req_msg->primary_local_lid = ib_slid_be16(wc->slid);
|
||||
req_msg->primary_local_lid = ib_lid_be16(wc->slid);
|
||||
cm_req_set_primary_sl(req_msg, wc->sl);
|
||||
}
|
||||
|
||||
@@ -1780,7 +1780,7 @@ static void cm_process_routed_req(struct cm_req_msg *req_msg, struct ib_wc *wc)
|
||||
|
||||
if (!cm_req_get_alt_subnet_local(req_msg)) {
|
||||
if (req_msg->alt_local_lid == IB_LID_PERMISSIVE) {
|
||||
req_msg->alt_local_lid = ib_slid_be16(wc->slid);
|
||||
req_msg->alt_local_lid = ib_lid_be16(wc->slid);
|
||||
cm_req_set_alt_sl(req_msg, wc->sl);
|
||||
}
|
||||
|
||||
|
@@ -229,7 +229,7 @@ static void recv_handler(struct ib_mad_agent *agent,
|
||||
packet->mad.hdr.status = 0;
|
||||
packet->mad.hdr.length = hdr_size(file) + mad_recv_wc->mad_len;
|
||||
packet->mad.hdr.qpn = cpu_to_be32(mad_recv_wc->wc->src_qp);
|
||||
packet->mad.hdr.lid = ib_slid_be16(mad_recv_wc->wc->slid);
|
||||
packet->mad.hdr.lid = ib_lid_be16(mad_recv_wc->wc->slid);
|
||||
packet->mad.hdr.sl = mad_recv_wc->wc->sl;
|
||||
packet->mad.hdr.path_bits = mad_recv_wc->wc->dlid_path_bits;
|
||||
packet->mad.hdr.pkey_index = mad_recv_wc->wc->pkey_index;
|
||||
|
@@ -275,12 +275,13 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
|
||||
resp.bad_pkey_cntr = attr.bad_pkey_cntr;
|
||||
resp.qkey_viol_cntr = attr.qkey_viol_cntr;
|
||||
resp.pkey_tbl_len = attr.pkey_tbl_len;
|
||||
|
||||
if (rdma_cap_opa_ah(ib_dev, cmd.port_num)) {
|
||||
resp.lid = OPA_TO_IB_UCAST_LID(attr.lid);
|
||||
resp.lid = OPA_TO_IB_UCAST_LID(attr.lid);
|
||||
resp.sm_lid = OPA_TO_IB_UCAST_LID(attr.sm_lid);
|
||||
} else {
|
||||
resp.lid = (u16)attr.lid;
|
||||
resp.sm_lid = (u16)attr.sm_lid;
|
||||
resp.lid = ib_lid_cpu16(attr.lid);
|
||||
resp.sm_lid = ib_lid_cpu16(attr.sm_lid);
|
||||
}
|
||||
resp.lmc = attr.lmc;
|
||||
resp.max_vl_num = attr.max_vl_num;
|
||||
@@ -1206,9 +1207,9 @@ static int copy_wc_to_user(struct ib_device *ib_dev, void __user *dest,
|
||||
tmp.wc_flags = wc->wc_flags;
|
||||
tmp.pkey_index = wc->pkey_index;
|
||||
if (rdma_cap_opa_ah(ib_dev, wc->port_num))
|
||||
tmp.slid = OPA_TO_IB_UCAST_LID(wc->slid);
|
||||
tmp.slid = OPA_TO_IB_UCAST_LID(wc->slid);
|
||||
else
|
||||
tmp.slid = ib_slid_cpu16(wc->slid);
|
||||
tmp.slid = ib_lid_cpu16(wc->slid);
|
||||
tmp.sl = wc->sl;
|
||||
tmp.dlid_path_bits = wc->dlid_path_bits;
|
||||
tmp.port_num = wc->port_num;
|
||||
|
Reference in New Issue
Block a user