RDMA/cma: Make sure that PSN is not over max allowed
[ Upstream commit 23a9cd2ad90543e9da3786878d2b2729c095439d ] This patch limits the initial value for PSN to 24 bits as spec requires. Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com> Signed-off-by: Daniel Jurgens <danielj@mellanox.com> Reviewed-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2970ecd184
commit
a09498d0eb
1 changed files with 1 additions and 0 deletions
|
@ -626,6 +626,7 @@ struct rdma_cm_id *rdma_create_id(struct net *net,
|
||||||
INIT_LIST_HEAD(&id_priv->mc_list);
|
INIT_LIST_HEAD(&id_priv->mc_list);
|
||||||
get_random_bytes(&id_priv->seq_num, sizeof id_priv->seq_num);
|
get_random_bytes(&id_priv->seq_num, sizeof id_priv->seq_num);
|
||||||
id_priv->id.route.addr.dev_addr.net = get_net(net);
|
id_priv->id.route.addr.dev_addr.net = get_net(net);
|
||||||
|
id_priv->seq_num &= 0x00ffffff;
|
||||||
|
|
||||||
return &id_priv->id;
|
return &id_priv->id;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue