Commit 8f974860 authored by Parav Pandit's avatar Parav Pandit Committed by Jason Gunthorpe

IB/cm: Reduce dependency on gid attribute ndev check

GID type to path record type conversion can be done directly based on port
type and gid attribute type.  There is no need to find out using indirect
way by its GID attribute's ndev field.
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 3bf3e2b8
...@@ -1985,11 +1985,12 @@ static int cm_req_handler(struct cm_work *work) ...@@ -1985,11 +1985,12 @@ static int cm_req_handler(struct cm_work *work)
grh = rdma_ah_read_grh(&cm_id_priv->av.ah_attr); grh = rdma_ah_read_grh(&cm_id_priv->av.ah_attr);
gid_attr = grh->sgid_attr; gid_attr = grh->sgid_attr;
if (gid_attr && gid_attr->ndev) { if (gid_attr &&
rdma_protocol_roce(work->port->cm_dev->ib_device,
work->port->port_num)) {
work->path[0].rec_type = work->path[0].rec_type =
sa_conv_gid_to_pathrec_type(gid_attr->gid_type); sa_conv_gid_to_pathrec_type(gid_attr->gid_type);
} else { } else {
/* If no GID attribute or ndev is null, it is not RoCE. */
cm_path_set_rec_type(work->port->cm_dev->ib_device, cm_path_set_rec_type(work->port->cm_dev->ib_device,
work->port->port_num, work->port->port_num,
&work->path[0], &work->path[0],
......
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