From 3bfe3af65a418dc4b295358edfe37dc6a347e9a5 Mon Sep 17 00:00:00 2001 From: Majd Dibbiny Date: Sun, 24 Aug 2014 13:48:53 +0300 Subject: [PATCH] ib_core: Make sure that PSN does not overflow. The rq/sq->psn is 24 bits as defined in the IB spec, therefore we mask out the 8 most significant bits to avoid overflow in the modify qp. Signed-off-by: Majd Dibbiny (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker --- drivers/infiniband/core/uverbs_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 299473533796..edd3c5680ab4 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -2058,8 +2058,8 @@ ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file, attr->path_mtu = cmd.path_mtu; attr->path_mig_state = cmd.path_mig_state; attr->qkey = cmd.qkey; - attr->rq_psn = cmd.rq_psn; - attr->sq_psn = cmd.sq_psn; + attr->rq_psn = cmd.rq_psn & 0xffffff; + attr->sq_psn = cmd.sq_psn & 0xffffff; attr->dest_qp_num = cmd.dest_qp_num; attr->qp_access_flags = cmd.qp_access_flags; attr->pkey_index = cmd.pkey_index; -- 2.50.1