hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/infiniband/sw/siw/siw_verbs.c
....@@ -672,13 +672,45 @@
672672 static int siw_sq_flush_wr(struct siw_qp *qp, const struct ib_send_wr *wr,
673673 const struct ib_send_wr **bad_wr)
674674 {
675
- struct siw_sqe sqe = {};
676675 int rv = 0;
677676
678677 while (wr) {
679
- sqe.id = wr->wr_id;
680
- sqe.opcode = wr->opcode;
681
- rv = siw_sqe_complete(qp, &sqe, 0, SIW_WC_WR_FLUSH_ERR);
678
+ struct siw_sqe sqe = {};
679
+
680
+ switch (wr->opcode) {
681
+ case IB_WR_RDMA_WRITE:
682
+ sqe.opcode = SIW_OP_WRITE;
683
+ break;
684
+ case IB_WR_RDMA_READ:
685
+ sqe.opcode = SIW_OP_READ;
686
+ break;
687
+ case IB_WR_RDMA_READ_WITH_INV:
688
+ sqe.opcode = SIW_OP_READ_LOCAL_INV;
689
+ break;
690
+ case IB_WR_SEND:
691
+ sqe.opcode = SIW_OP_SEND;
692
+ break;
693
+ case IB_WR_SEND_WITH_IMM:
694
+ sqe.opcode = SIW_OP_SEND_WITH_IMM;
695
+ break;
696
+ case IB_WR_SEND_WITH_INV:
697
+ sqe.opcode = SIW_OP_SEND_REMOTE_INV;
698
+ break;
699
+ case IB_WR_LOCAL_INV:
700
+ sqe.opcode = SIW_OP_INVAL_STAG;
701
+ break;
702
+ case IB_WR_REG_MR:
703
+ sqe.opcode = SIW_OP_REG_MR;
704
+ break;
705
+ default:
706
+ rv = -EINVAL;
707
+ break;
708
+ }
709
+ if (!rv) {
710
+ sqe.id = wr->wr_id;
711
+ rv = siw_sqe_complete(qp, &sqe, 0,
712
+ SIW_WC_WR_FLUSH_ERR);
713
+ }
682714 if (rv) {
683715 if (bad_wr)
684716 *bad_wr = wr;
....@@ -1455,7 +1487,7 @@
14551487
14561488 if (pbl->max_buf < num_sle) {
14571489 siw_dbg_mem(mem, "too many SGE's: %d > %d\n",
1458
- mem->pbl->max_buf, num_sle);
1490
+ num_sle, pbl->max_buf);
14591491 return -ENOMEM;
14601492 }
14611493 for_each_sg(sl, slp, num_sle, i) {