]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/irdma: Update ibqp state to error if QP is already in error state
authorTatyana Nikolova <tatyana.e.nikolova@intel.com>
Mon, 16 Mar 2026 18:39:41 +0000 (13:39 -0500)
committerLeon Romanovsky <leonro@nvidia.com>
Wed, 18 Mar 2026 10:20:53 +0000 (06:20 -0400)
In irdma_modify_qp() update ibqp state to error if the irdma QP is already
in error state, otherwise the ibqp state which is visible to the consumer
app remains stale.

Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/irdma/verbs.c

index ce1050bdd1919f4a3be352e45e964ce26b89ffd5..a13ed000fa197a1a2efffd438bcb7481dba30998 100644 (file)
@@ -1540,6 +1540,7 @@ int irdma_modify_qp_roce(struct ib_qp *ibqp, struct ib_qp_attr *attr,
                case IB_QPS_ERR:
                case IB_QPS_RESET:
                        if (iwqp->iwarp_state == IRDMA_QP_STATE_ERROR) {
+                               iwqp->ibqp_state = attr->qp_state;
                                spin_unlock_irqrestore(&iwqp->lock, flags);
                                if (udata && udata->inlen) {
                                        if (ib_copy_from_udata(&ureq, udata,
@@ -1745,6 +1746,7 @@ int irdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
                case IB_QPS_ERR:
                case IB_QPS_RESET:
                        if (iwqp->iwarp_state == IRDMA_QP_STATE_ERROR) {
+                               iwqp->ibqp_state = attr->qp_state;
                                spin_unlock_irqrestore(&iwqp->lock, flags);
                                if (udata && udata->inlen) {
                                        if (ib_copy_from_udata(&ureq, udata,