aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoni Shoua <[email protected]>2017-11-26 20:23:54 +0200
committerJason Gunthorpe <[email protected]>2017-12-01 12:21:26 -0700
commit23a9cd2ad90543e9da3786878d2b2729c095439d (patch)
tree0e2abd89f9d2fa65d7c14d0b186a17b5fa562fee
parenta7c6dfe215a7f85c6195f09c1b9474a2ba7fea9c (diff)
RDMA/cma: Make sure that PSN is not over max allowed
This patch limits the initial value for PSN to 24 bits as spec requires. Signed-off-by: Moni Shoua <[email protected]> Signed-off-by: Mukesh Kacker <[email protected]> Signed-off-by: Daniel Jurgens <[email protected]> Reviewed-by: Parav Pandit <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
-rw-r--r--drivers/infiniband/core/cma.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 1fdb473b5df7..f6983357145d 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -801,6 +801,7 @@ struct rdma_cm_id *rdma_create_id(struct net *net,
INIT_LIST_HEAD(&id_priv->mc_list);
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->seq_num &= 0x00ffffff;
return &id_priv->id;
}