Skip to content

Commit 5c266b2

Browse files
matanb10dledford
authored andcommitted
IB/cm: Remove the usage of smac and vid of qp_attr and cm_av
The cm and cma don't need to explicitly handle vlan and smac, as they are resolved from the GID index now. Removing this portion of code. Signed-off-by: Matan Barak <[email protected]> Reviewed-By: Devesh Sharma <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent dbf727d commit 5c266b2

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

drivers/infiniband/core/cm.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ struct cm_av {
179179
struct ib_ah_attr ah_attr;
180180
u16 pkey_index;
181181
u8 timeout;
182-
u8 valid;
183-
u8 smac[ETH_ALEN];
184182
};
185183

186184
struct cm_work {
@@ -389,7 +387,6 @@ static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av)
389387
&av->ah_attr);
390388
av->timeout = path->packet_life_time + 1;
391389

392-
av->valid = 1;
393390
return 0;
394391
}
395392

@@ -1642,7 +1639,6 @@ static int cm_req_handler(struct cm_work *work)
16421639
cm_format_paths_from_req(req_msg, &work->path[0], &work->path[1]);
16431640

16441641
memcpy(work->path[0].dmac, cm_id_priv->av.ah_attr.dmac, ETH_ALEN);
1645-
work->path[0].vlan_id = cm_id_priv->av.ah_attr.vlan_id;
16461642
ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av);
16471643
if (ret) {
16481644
ib_get_cached_gid(work->port->cm_dev->ib_device,
@@ -3622,32 +3618,6 @@ static int cm_init_qp_rtr_attr(struct cm_id_private *cm_id_priv,
36223618
*qp_attr_mask = IB_QP_STATE | IB_QP_AV | IB_QP_PATH_MTU |
36233619
IB_QP_DEST_QPN | IB_QP_RQ_PSN;
36243620
qp_attr->ah_attr = cm_id_priv->av.ah_attr;
3625-
if (!cm_id_priv->av.valid) {
3626-
spin_unlock_irqrestore(&cm_id_priv->lock, flags);
3627-
return -EINVAL;
3628-
}
3629-
if (cm_id_priv->av.ah_attr.vlan_id != 0xffff) {
3630-
qp_attr->vlan_id = cm_id_priv->av.ah_attr.vlan_id;
3631-
*qp_attr_mask |= IB_QP_VID;
3632-
}
3633-
if (!is_zero_ether_addr(cm_id_priv->av.smac)) {
3634-
memcpy(qp_attr->smac, cm_id_priv->av.smac,
3635-
sizeof(qp_attr->smac));
3636-
*qp_attr_mask |= IB_QP_SMAC;
3637-
}
3638-
if (cm_id_priv->alt_av.valid) {
3639-
if (cm_id_priv->alt_av.ah_attr.vlan_id != 0xffff) {
3640-
qp_attr->alt_vlan_id =
3641-
cm_id_priv->alt_av.ah_attr.vlan_id;
3642-
*qp_attr_mask |= IB_QP_ALT_VID;
3643-
}
3644-
if (!is_zero_ether_addr(cm_id_priv->alt_av.smac)) {
3645-
memcpy(qp_attr->alt_smac,
3646-
cm_id_priv->alt_av.smac,
3647-
sizeof(qp_attr->alt_smac));
3648-
*qp_attr_mask |= IB_QP_ALT_SMAC;
3649-
}
3650-
}
36513621
qp_attr->path_mtu = cm_id_priv->path_mtu;
36523622
qp_attr->dest_qp_num = be32_to_cpu(cm_id_priv->remote_qpn);
36533623
qp_attr->rq_psn = be32_to_cpu(cm_id_priv->rq_psn);

drivers/infiniband/core/cma.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,6 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv,
733733

734734
BUG_ON(id_priv->cma_dev->device != id_priv->id.device);
735735

736-
if (rdma_protocol_roce(id_priv->id.device, id_priv->id.port_num)) {
737-
ret = rdma_addr_find_smac_by_sgid(&sgid, qp_attr.smac, NULL);
738-
739-
if (ret)
740-
goto out;
741-
}
742736
if (conn_param)
743737
qp_attr.max_dest_rd_atomic = conn_param->responder_resources;
744738
ret = ib_modify_qp(id_priv->id.qp, &qp_attr, qp_attr_mask);

0 commit comments

Comments
 (0)