> - wc->pkey_index = ntohl(cqe->immed_rss_invalid) >> 16; > + wc->pkey_index = (uint16_t)(ntohl(cqe->immed_rss_invalid) & 0x7f); This is pretty silly. We don't allow userspace to create QP1 anyway, so is there any point setting the pkey_index field here at all? - R.