Skip to content

Commit

Permalink
Merge pull request #97 from jgunthorpe/sparse-bugs
Browse files Browse the repository at this point in the history
Sparse bugs
  • Loading branch information
dledford authored Mar 14, 2017
2 parents d8c3ec4 + 36372fd commit fae2979
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ RDMA_BuildType()
include_directories(${BUILD_INCLUDE})

RDMA_CheckSparse()
message(STATUS "SPARSE1 ${HAVE_SPARSE}")

# Require GNU99 mode
RDMA_EnableCStd()
Expand Down
19 changes: 10 additions & 9 deletions ibacm/prov/acmp/src/acmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ acmp_record_mc_av(struct acmp_port *port, struct ib_mc_member_rec *mc_rec,
dest->path.dgid = mc_rec->mgid;
dest->path.sgid = mc_rec->port_gid;
dest->path.dlid = mc_rec->mlid;
dest->path.slid = htobe16(port->lid) | port->sa_dest.av.src_path_bits;
dest->path.slid = htobe16(port->lid | port->sa_dest.av.src_path_bits);
dest->path.flowlabel_hoplimit = htobe32(sl_flow_hop & 0xFFFFFFF);
dest->path.tclass = mc_rec->tclass;
dest->path.reversible_numpath = IBV_PATH_RECORD_REVERSIBLE | 1;
Expand All @@ -675,7 +675,7 @@ acmp_init_path_av(struct acmp_port *port, struct acmp_dest *dest)

dest->av.dlid = be16toh(dest->path.dlid);
dest->av.sl = be16toh(dest->path.qosclass_sl) & 0xF;
dest->av.src_path_bits = dest->path.slid & 0x7F;
dest->av.src_path_bits = be16toh(dest->path.slid) & 0x7F;
dest->av.static_rate = dest->path.rate & 0x3F;
dest->av.port_num = port->port_num;

Expand Down Expand Up @@ -2419,8 +2419,8 @@ static struct acmp_port *acmp_get_port(struct acm_endpoint *endpoint)
struct acmp_device *dev;

acm_log(1, "dev 0x%" PRIx64 " port %d pkey 0x%x\n",
endpoint->port->dev->dev_guid, endpoint->port->port_num,
endpoint->pkey);
be64toh(endpoint->port->dev->dev_guid),
endpoint->port->port_num, endpoint->pkey);

list_for_each(&acmp_dev_list, dev, entry) {
if (dev->guid == endpoint->port->dev->dev_guid)
Expand All @@ -2436,7 +2436,8 @@ acmp_get_ep(struct acmp_port *port, struct acm_endpoint *endpoint)
struct acmp_ep *ep;

acm_log(1, "dev 0x%" PRIx64 " port %d pkey 0x%x\n",
endpoint->port->dev->dev_guid, endpoint->port->port_num, endpoint->pkey);
be64toh(endpoint->port->dev->dev_guid),
endpoint->port->port_num, endpoint->pkey);

list_for_each(&port->ep_list, ep, entry) {
if (ep->pkey == endpoint->pkey)
Expand All @@ -2458,7 +2459,7 @@ static uint16_t acmp_get_pkey_index(struct acm_endpoint *endpoint)

for (i = 0, ret = 0; !ret; i++) {
ret = ibv_query_pkey(port->dev->verbs, port->port_num, i, &pkey);
if (!ret && endpoint->pkey == pkey)
if (!ret && endpoint->pkey == be16toh(pkey))
return i;
}
return 0;
Expand Down Expand Up @@ -2736,13 +2737,13 @@ static int acmp_open_dev(const struct acm_device *device, void **dev_context)
int i, ret;
struct ibv_context *verbs;

acm_log(1, "dev_guid 0x%" PRIx64 " %s\n", device->dev_guid,
acm_log(1, "dev_guid 0x%" PRIx64 " %s\n", be64toh(device->dev_guid),
device->verbs->device->name);

list_for_each(&acmp_dev_list, dev, entry) {
if (dev->guid == device->dev_guid) {
acm_log(2, "dev_guid 0x%" PRIx64 " already exits\n",
device->dev_guid);
be64toh(device->dev_guid));
*dev_context = dev;
dev->device = device;
return 0;
Expand Down Expand Up @@ -2823,7 +2824,7 @@ static void acmp_close_dev(void *dev_context)
{
struct acmp_device *dev = dev_context;

acm_log(1, "dev_guid 0x%" PRIx64 "\n", dev->device->dev_guid);
acm_log(1, "dev_guid 0x%" PRIx64 "\n", be64toh(dev->device->dev_guid));
dev->device = NULL;
}

Expand Down
8 changes: 4 additions & 4 deletions ibacm/src/acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2136,8 +2136,8 @@ static void acm_port_get_gid_tbl(struct acmc_port *port)
if (ret || !port->gid_tbl[j].global.interface_id)
break;
acm_log(2, "guid %d: 0x%" PRIx64 " %" PRIx64 "\n", j,
port->gid_tbl[j].global.subnet_prefix,
port->gid_tbl[j].global.interface_id);
be64toh(port->gid_tbl[j].global.subnet_prefix),
be64toh(port->gid_tbl[j].global.interface_id));
}
port->gid_cnt = j;
}
Expand Down Expand Up @@ -2770,8 +2770,8 @@ static void acmc_recv_mad(struct acmc_port *port)
found = 0;
pthread_mutex_lock(&port->lock);
list_for_each(&port->sa_pending, req, entry) {
/* The lower 32-bit of the tid is used for agentid in umad */
if (req->mad.sa_mad.mad_hdr.tid == (hdr->tid & 0xFFFFFFFF00000000ULL)) {
/* The upper 32-bit of the tid is used for agentid in umad */
if (req->mad.sa_mad.mad_hdr.tid == (hdr->tid & htobe64(0xFFFFFFFF))) {
found = 1;
list_del(&req->entry);
port->sa_credits++;
Expand Down
2 changes: 1 addition & 1 deletion libibcm/examples/cmpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ static int get_dst_addr(char *dst, struct sockaddr_in *addr_in)
}

*addr_in = *(struct sockaddr_in *) res->ai_addr;
addr_in->sin_port = 7471;
addr_in->sin_port = htobe16(7471);
out:
freeaddrinfo(res);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion libibverbs/examples/xsrq_pingpong.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct pingpong_context {
int gidx;
};

struct pingpong_context ctx;
static struct pingpong_context ctx;


static int open_device(char *ib_devname)
Expand Down
2 changes: 1 addition & 1 deletion librdmacm/rsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -4103,7 +4103,7 @@ static void udp_svc_create_ah(struct rsocket *rs, struct ds_dest *dest, uint32_t
}
attr.dlid = be16toh(id->route.path_rec->dlid);
attr.sl = id->route.path_rec->sl;
attr.src_path_bits = id->route.path_rec->slid & udp_svc_path_bits(dest);
attr.src_path_bits = be16toh(id->route.path_rec->slid) & udp_svc_path_bits(dest);
attr.static_rate = id->route.path_rec->rate;
attr.port_num = id->port_num;

Expand Down
4 changes: 2 additions & 2 deletions providers/qedr/qelr_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ static void qelr_print_ah_attr(struct qelr_devctx *cxt, struct ibv_ah_attr *attr
{
DP_VERBOSE(cxt->dbg_fp, QELR_MSG_QP,
"grh.dgid=[%#" PRIx64 ":%#" PRIx64 "], grh.flow_label=%d, grh.sgid_index=%d, grh.hop_limit=%d, grh.traffic_class=%d, dlid=%d, sl=%d, src_path_bits=%d, static_rate = %d, port_num=%d\n",
attr->grh.dgid.global.interface_id,
attr->grh.dgid.global.subnet_prefix,
be64toh(attr->grh.dgid.global.interface_id),
be64toh(attr->grh.dgid.global.subnet_prefix),
attr->grh.flow_label, attr->grh.hop_limit,
attr->grh.sgid_index, attr->grh.traffic_class, attr->dlid,
attr->sl, attr->src_path_bits,
Expand Down

0 comments on commit fae2979

Please sign in to comment.