]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
IB/CMA: Make sure that PSN is not over max allowed
authorMoni Shoua <monis@mellanox.com>
Mon, 18 Aug 2014 11:30:20 +0000 (14:30 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:22 +0000 (14:45 -0700)
This patch limits the initial value for PSN to 24 bits as
spec requires.

Related to commit 76eada4 IB/mlx5: Check that PSN does not overflow
Signed-off-by: Moni Shoua <monis@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/infiniband/core/cma.c

index ef46b3d00834e5e47f1d6a4d9286b0f5a6e1dd48..f2df86d70549056c7ff53efbc7585d5b48ba393b 100644 (file)
@@ -549,6 +549,7 @@ struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler,
        INIT_LIST_HEAD(&id_priv->listen_list);
        INIT_LIST_HEAD(&id_priv->mc_list);
        get_random_bytes(&id_priv->seq_num, sizeof id_priv->seq_num);
+       id_priv->seq_num &= 0x00ffffff;
 
        return &id_priv->id;
 }