Commit 497677ab authored by Hal Rosenstock's avatar Hal Rosenstock Committed by Linus Torvalds

[PATCH] IB: A couple of IB core bug fixes

Replace be32_to_cpup with be32_to_cpu and fix bug referencing pointer rather
than value in ib_create_ah_from_wc().
Signed-off-by: default avatarTom Duffy <tduffy@sun.com>
Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
Signed-off-by: default avatarHal Rosenstock <halr@voltaire.com>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 513789ed
...@@ -156,10 +156,10 @@ static int agent_mad_send(struct ib_mad_agent *mad_agent, ...@@ -156,10 +156,10 @@ static int agent_mad_send(struct ib_mad_agent *mad_agent,
/* Should sgid be looked up ? */ /* Should sgid be looked up ? */
ah_attr.grh.sgid_index = 0; ah_attr.grh.sgid_index = 0;
ah_attr.grh.hop_limit = grh->hop_limit; ah_attr.grh.hop_limit = grh->hop_limit;
ah_attr.grh.flow_label = be32_to_cpup( ah_attr.grh.flow_label = be32_to_cpu(
&grh->version_tclass_flow) & 0xfffff; grh->version_tclass_flow) & 0xfffff;
ah_attr.grh.traffic_class = (be32_to_cpup( ah_attr.grh.traffic_class = (be32_to_cpu(
&grh->version_tclass_flow) >> 20) & 0xff; grh->version_tclass_flow) >> 20) & 0xff;
memcpy(ah_attr.grh.dgid.raw, memcpy(ah_attr.grh.dgid.raw,
grh->sgid.raw, grh->sgid.raw,
sizeof(ah_attr.grh.dgid)); sizeof(ah_attr.grh.dgid));
......
...@@ -113,7 +113,7 @@ struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, struct ib_wc *wc, ...@@ -113,7 +113,7 @@ struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, struct ib_wc *wc,
return ERR_PTR(ret); return ERR_PTR(ret);
ah_attr.grh.sgid_index = (u8) gid_index; ah_attr.grh.sgid_index = (u8) gid_index;
flow_class = be32_to_cpu(&grh->version_tclass_flow); flow_class = be32_to_cpu(grh->version_tclass_flow);
ah_attr.grh.flow_label = flow_class & 0xFFFFF; ah_attr.grh.flow_label = flow_class & 0xFFFFF;
ah_attr.grh.traffic_class = (flow_class >> 20) & 0xFF; ah_attr.grh.traffic_class = (flow_class >> 20) & 0xFF;
ah_attr.grh.hop_limit = grh->hop_limit; ah_attr.grh.hop_limit = grh->hop_limit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment