IB/core: Use rdma_ah_attr accessor functions
Modify core and driver components to use accessor functions introduced to access individual fields of rdma_ah_attr Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Don Hiatt <don.hiatt@intel.com> Reviewed-by: Sean Hefty <sean.hefty@intel.com> Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:

committed by
Doug Ledford

父節點
2224c47ace
當前提交
d8966fcd4c
@@ -244,7 +244,7 @@ static inline int qedr_gsi_build_header(struct qedr_dev *dev,
|
||||
{
|
||||
bool has_vlan = false, has_grh_ipv6 = true;
|
||||
struct rdma_ah_attr *ah_attr = &get_qedr_ah(ud_wr(swr)->ah)->attr;
|
||||
struct ib_global_route *grh = &ah_attr->grh;
|
||||
const struct ib_global_route *grh = rdma_ah_read_grh(ah_attr);
|
||||
union ib_gid sgid;
|
||||
int send_size = 0;
|
||||
u16 vlan_id = 0;
|
||||
@@ -260,12 +260,13 @@ static inline int qedr_gsi_build_header(struct qedr_dev *dev,
|
||||
for (i = 0; i < swr->num_sge; ++i)
|
||||
send_size += swr->sg_list[i].length;
|
||||
|
||||
rc = ib_get_cached_gid(qp->ibqp.device, ah_attr->port_num,
|
||||
rc = ib_get_cached_gid(qp->ibqp.device, rdma_ah_get_port_num(ah_attr),
|
||||
grh->sgid_index, &sgid, &sgid_attr);
|
||||
if (rc) {
|
||||
DP_ERR(dev,
|
||||
"gsi post send: failed to get cached GID (port=%d, ix=%d)\n",
|
||||
ah_attr->port_num, grh->sgid_index);
|
||||
rdma_ah_get_port_num(ah_attr),
|
||||
grh->sgid_index);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -277,7 +278,7 @@ static inline int qedr_gsi_build_header(struct qedr_dev *dev,
|
||||
|
||||
if (!memcmp(&sgid, &zgid, sizeof(sgid))) {
|
||||
DP_ERR(dev, "gsi post send: GID not found GID index %d\n",
|
||||
ah_attr->grh.sgid_index);
|
||||
grh->sgid_index);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@@ -341,13 +342,13 @@ static inline int qedr_gsi_build_header(struct qedr_dev *dev,
|
||||
u32 ipv4_addr;
|
||||
|
||||
udh->ip4.protocol = IPPROTO_UDP;
|
||||
udh->ip4.tos = htonl(ah_attr->grh.flow_label);
|
||||
udh->ip4.tos = htonl(grh->flow_label);
|
||||
udh->ip4.frag_off = htons(IP_DF);
|
||||
udh->ip4.ttl = ah_attr->grh.hop_limit;
|
||||
udh->ip4.ttl = grh->hop_limit;
|
||||
|
||||
ipv4_addr = qedr_get_ipv4_from_gid(sgid.raw);
|
||||
udh->ip4.saddr = ipv4_addr;
|
||||
ipv4_addr = qedr_get_ipv4_from_gid(ah_attr->grh.dgid.raw);
|
||||
ipv4_addr = qedr_get_ipv4_from_gid(grh->dgid.raw);
|
||||
udh->ip4.daddr = ipv4_addr;
|
||||
/* note: checksum is calculated by the device */
|
||||
}
|
||||
|
Reference in New Issue
Block a user