Commit 409baed5 authored by Bob Pearson's avatar Bob Pearson Committed by Jason Gunthorpe

RDMA/rxe: Remove support for SMI QPs from rdma_rxe

Currently the rdma_rxe driver supports SMI type QPs in a few places which
is incorrect. RoCE devices never should support SMI QPs.  This commit
removes SMI QP support from the driver.

Link: https://lore.kernel.org/r/20220407185416.16372-1-rpearsonhpe@gmail.comSigned-off-by: default avatarBob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 5c477ee7
...@@ -29,7 +29,6 @@ struct rxe_wr_opcode_info rxe_wr_opcode_info[] = { ...@@ -29,7 +29,6 @@ struct rxe_wr_opcode_info rxe_wr_opcode_info[] = {
[IB_WR_SEND] = { [IB_WR_SEND] = {
.name = "IB_WR_SEND", .name = "IB_WR_SEND",
.mask = { .mask = {
[IB_QPT_SMI] = WR_INLINE_MASK | WR_SEND_MASK,
[IB_QPT_GSI] = WR_INLINE_MASK | WR_SEND_MASK, [IB_QPT_GSI] = WR_INLINE_MASK | WR_SEND_MASK,
[IB_QPT_RC] = WR_INLINE_MASK | WR_SEND_MASK, [IB_QPT_RC] = WR_INLINE_MASK | WR_SEND_MASK,
[IB_QPT_UC] = WR_INLINE_MASK | WR_SEND_MASK, [IB_QPT_UC] = WR_INLINE_MASK | WR_SEND_MASK,
...@@ -39,7 +38,6 @@ struct rxe_wr_opcode_info rxe_wr_opcode_info[] = { ...@@ -39,7 +38,6 @@ struct rxe_wr_opcode_info rxe_wr_opcode_info[] = {
[IB_WR_SEND_WITH_IMM] = { [IB_WR_SEND_WITH_IMM] = {
.name = "IB_WR_SEND_WITH_IMM", .name = "IB_WR_SEND_WITH_IMM",
.mask = { .mask = {
[IB_QPT_SMI] = WR_INLINE_MASK | WR_SEND_MASK,
[IB_QPT_GSI] = WR_INLINE_MASK | WR_SEND_MASK, [IB_QPT_GSI] = WR_INLINE_MASK | WR_SEND_MASK,
[IB_QPT_RC] = WR_INLINE_MASK | WR_SEND_MASK, [IB_QPT_RC] = WR_INLINE_MASK | WR_SEND_MASK,
[IB_QPT_UC] = WR_INLINE_MASK | WR_SEND_MASK, [IB_QPT_UC] = WR_INLINE_MASK | WR_SEND_MASK,
......
...@@ -63,7 +63,6 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init) ...@@ -63,7 +63,6 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init)
int port_num = init->port_num; int port_num = init->port_num;
switch (init->qp_type) { switch (init->qp_type) {
case IB_QPT_SMI:
case IB_QPT_GSI: case IB_QPT_GSI:
case IB_QPT_RC: case IB_QPT_RC:
case IB_QPT_UC: case IB_QPT_UC:
...@@ -81,7 +80,7 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init) ...@@ -81,7 +80,7 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init)
if (rxe_qp_chk_cap(rxe, cap, !!init->srq)) if (rxe_qp_chk_cap(rxe, cap, !!init->srq))
goto err1; goto err1;
if (init->qp_type == IB_QPT_SMI || init->qp_type == IB_QPT_GSI) { if (init->qp_type == IB_QPT_GSI) {
if (!rdma_is_port_valid(&rxe->ib_dev, port_num)) { if (!rdma_is_port_valid(&rxe->ib_dev, port_num)) {
pr_warn("invalid port = %d\n", port_num); pr_warn("invalid port = %d\n", port_num);
goto err1; goto err1;
...@@ -89,11 +88,6 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init) ...@@ -89,11 +88,6 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init)
port = &rxe->port; port = &rxe->port;
if (init->qp_type == IB_QPT_SMI && port->qp_smi_index) {
pr_warn("SMI QP exists for port %d\n", port_num);
goto err1;
}
if (init->qp_type == IB_QPT_GSI && port->qp_gsi_index) { if (init->qp_type == IB_QPT_GSI && port->qp_gsi_index) {
pr_warn("GSI QP exists for port %d\n", port_num); pr_warn("GSI QP exists for port %d\n", port_num);
goto err1; goto err1;
...@@ -167,12 +161,6 @@ static void rxe_qp_init_misc(struct rxe_dev *rxe, struct rxe_qp *qp, ...@@ -167,12 +161,6 @@ static void rxe_qp_init_misc(struct rxe_dev *rxe, struct rxe_qp *qp,
port = &rxe->port; port = &rxe->port;
switch (init->qp_type) { switch (init->qp_type) {
case IB_QPT_SMI:
qp->ibqp.qp_num = 0;
port->qp_smi_index = qpn;
qp->attr.port_num = init->port_num;
break;
case IB_QPT_GSI: case IB_QPT_GSI:
qp->ibqp.qp_num = 1; qp->ibqp.qp_num = 1;
port->qp_gsi_index = qpn; port->qp_gsi_index = qpn;
......
...@@ -34,7 +34,6 @@ static int check_type_state(struct rxe_dev *rxe, struct rxe_pkt_info *pkt, ...@@ -34,7 +34,6 @@ static int check_type_state(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
} }
break; break;
case IB_QPT_UD: case IB_QPT_UD:
case IB_QPT_SMI:
case IB_QPT_GSI: case IB_QPT_GSI:
if (unlikely(pkt_type != IB_OPCODE_UD)) { if (unlikely(pkt_type != IB_OPCODE_UD)) {
pr_warn_ratelimited("bad qp type\n"); pr_warn_ratelimited("bad qp type\n");
......
...@@ -308,7 +308,6 @@ static int next_opcode(struct rxe_qp *qp, struct rxe_send_wqe *wqe, ...@@ -308,7 +308,6 @@ static int next_opcode(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
case IB_QPT_UC: case IB_QPT_UC:
return next_opcode_uc(qp, opcode, fits); return next_opcode_uc(qp, opcode, fits);
case IB_QPT_SMI:
case IB_QPT_UD: case IB_QPT_UD:
case IB_QPT_GSI: case IB_QPT_GSI:
switch (opcode) { switch (opcode) {
......
...@@ -277,7 +277,6 @@ static enum resp_states check_op_valid(struct rxe_qp *qp, ...@@ -277,7 +277,6 @@ static enum resp_states check_op_valid(struct rxe_qp *qp,
break; break;
case IB_QPT_UD: case IB_QPT_UD:
case IB_QPT_SMI:
case IB_QPT_GSI: case IB_QPT_GSI:
break; break;
...@@ -819,7 +818,6 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt) ...@@ -819,7 +818,6 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt)
if (pkt->mask & RXE_SEND_MASK) { if (pkt->mask & RXE_SEND_MASK) {
if (qp_type(qp) == IB_QPT_UD || if (qp_type(qp) == IB_QPT_UD ||
qp_type(qp) == IB_QPT_SMI ||
qp_type(qp) == IB_QPT_GSI) { qp_type(qp) == IB_QPT_GSI) {
if (skb->protocol == htons(ETH_P_IP)) { if (skb->protocol == htons(ETH_P_IP)) {
memset(&hdr.reserved, 0, memset(&hdr.reserved, 0,
......
...@@ -536,7 +536,6 @@ static void init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr, ...@@ -536,7 +536,6 @@ static void init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr,
wr->send_flags = ibwr->send_flags; wr->send_flags = ibwr->send_flags;
if (qp_type(qp) == IB_QPT_UD || if (qp_type(qp) == IB_QPT_UD ||
qp_type(qp) == IB_QPT_SMI ||
qp_type(qp) == IB_QPT_GSI) { qp_type(qp) == IB_QPT_GSI) {
struct ib_ah *ibah = ud_wr(ibwr)->ah; struct ib_ah *ibah = ud_wr(ibwr)->ah;
......
...@@ -373,7 +373,6 @@ struct rxe_port { ...@@ -373,7 +373,6 @@ struct rxe_port {
spinlock_t port_lock; /* guard port */ spinlock_t port_lock; /* guard port */
unsigned int mtu_cap; unsigned int mtu_cap;
/* special QPs */ /* special QPs */
u32 qp_smi_index;
u32 qp_gsi_index; u32 qp_gsi_index;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment