On 5/10/2017 7:22 PM, Dasaratharaman Chandramouli wrote: > From: Don Hiatt <don.hiatt@xxxxxxxxx> > > slid field in struct ib_wc is increased to 32 bits. > This enables core components to use larger LIDs if needed. > The user ABI is unchanged and return 16 bit values when queried. > > Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx> > Signed-off-by: Dasaratharaman Chandramouli > <dasaratharaman.chandramouli@xxxxxxxxx> > Signed-off-by: Don Hiatt <don.hiatt@xxxxxxxxx> > --- > drivers/infiniband/core/cm.c | 4 ++-- > drivers/infiniband/core/user_mad.c | 2 +- > drivers/infiniband/core/uverbs_cmd.c | 11 ++++++++--- > drivers/infiniband/hw/hfi1/mad.c | 2 +- > drivers/infiniband/hw/mlx4/mad.c | 6 +++--- > drivers/infiniband/hw/mlx5/mad.c | 2 +- > drivers/infiniband/hw/mthca/mthca_cmd.c | 4 ++-- > drivers/infiniband/hw/mthca/mthca_mad.c | 2 +- > drivers/infiniband/sw/rdmavt/cq.c | 2 +- > include/rdma/ib_verbs.h | 2 +- > 10 files changed, 21 insertions(+), 16 deletions(-) > > diff --git a/drivers/infiniband/core/cm.c > b/drivers/infiniband/core/cm.c index 1844770..6b3b0be 100644 > --- a/drivers/infiniband/core/cm.c > +++ b/drivers/infiniband/core/cm.c > @@ -1703,7 +1703,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 = cpu_to_be16(wc->slid); > + req_msg->primary_local_lid = cpu_to_be16((u16)wc->slid); > cm_req_set_primary_sl(req_msg, wc->sl); > } > > @@ -1713,7 +1713,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 = cpu_to_be16(wc->slid); > + req_msg->alt_local_lid = cpu_to_be16((u16)wc->slid); > cm_req_set_alt_sl(req_msg, wc->sl); > } > > diff --git a/drivers/infiniband/core/user_mad.c > b/drivers/infiniband/core/user_mad.c > index 200422d..8272d65 100644 > --- a/drivers/infiniband/core/user_mad.c > +++ b/drivers/infiniband/core/user_mad.c > @@ -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 = cpu_to_be16(mad_recv_wc->wc->slid); > + packet->mad.hdr.lid = cpu_to_be16((u16)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; diff --git > a/drivers/infiniband/core/uverbs_cmd.c > b/drivers/infiniband/core/uverbs_cmd.c > index 6964c05..b08045f 100644 > --- a/drivers/infiniband/core/uverbs_cmd.c > +++ b/drivers/infiniband/core/uverbs_cmd.c > @@ -1190,7 +1190,8 @@ ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file, > return ret ? ret : in_len; > } > > -static int copy_wc_to_user(void __user *dest, struct ib_wc *wc) > +static int copy_wc_to_user(struct ib_device *ib_dev, void __user *dest, > + struct ib_wc *wc) > { > struct ib_uverbs_wc tmp; > > @@ -1204,7 +1205,11 @@ static int copy_wc_to_user(void __user *dest, struct ib_wc *wc) > tmp.src_qp = wc->src_qp; > tmp.wc_flags = wc->wc_flags; > tmp.pkey_index = wc->pkey_index; > - tmp.slid = wc->slid; > + if (rdma_cap_opa_ah(ib_dev, wc->port_num)) > + tmp.slid = OPA_TO_IB_UCAST_LID(wc->slid); > + else > + tmp.slid = (u16)wc->slid; > + tmp.slid = (u16)wc->slid; >>Is one line too many added here ? >> >>-- Hal Yes there is. Thanks for catching this! don ��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f