IB/core: Change port_attr.sm_lid from 16 to 32 bits
authorDasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Thu, 8 Jun 2017 17:37:48 +0000 (13:37 -0400)
committerDoug Ledford <dledford@redhat.com>
Tue, 8 Aug 2017 18:50:25 +0000 (14:50 -0400)
sm_lid field in struct ib_port_attr 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.

Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Don Hiatt <don.hiatt@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c
include/rdma/ib_verbs.h

index eef2623406ccb941c660ec31d53c69ad2dd9953a..01e2ff0239802b72e81ea2b5b13ea0318abfcf97 100644 (file)
@@ -275,11 +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;
-       resp.sm_lid          = attr.sm_lid;
-       if (rdma_cap_opa_ah(ib_dev, cmd.port_num))
+       if (rdma_cap_opa_ah(ib_dev, cmd.port_num)) {
                resp.lid  = OPA_TO_IB_UCAST_LID(attr.lid);
-       else
+               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.lmc             = attr.lmc;
        resp.max_vl_num      = attr.max_vl_num;
        resp.sm_sl           = attr.sm_sl;
index 4fa94e69b1fcf1226c9df892b0a6a832db484855..6205359081185d16a73ccc9d6f64ea47517425e5 100644 (file)
@@ -549,7 +549,7 @@ struct ib_port_attr {
        u32                     bad_pkey_cntr;
        u32                     qkey_viol_cntr;
        u16                     pkey_tbl_len;
-       u16                     sm_lid;
+       u32                     sm_lid;
        u32                     lid;
        u8                      lmc;
        u8                      max_vl_num;