All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-rc] RDMA/mlx4: Fix return value when QP type isn't supported
@ 2020-09-22 13:44 Kamal Heib
  2020-09-22 23:30 ` Jason Gunthorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Kamal Heib @ 2020-09-22 13:44 UTC (permalink / raw)
  To: linux-rdma; +Cc: Jason Gunthorpe, Doug Ledford, Yishai Hadas, Kamal Heib

The proper return code is "-EOPNOTSUPP" when trying to modify a raw
packet QP over an IB port.

Fixes: 3987a2d3193c ("IB/mlx4: Add raw packet QP support")
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 drivers/infiniband/hw/mlx4/qp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 2975f350b9fd..3c6ed7a7d407 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -2785,8 +2785,10 @@ static int _mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 
 	if ((attr_mask & IB_QP_PORT) && (ibqp->qp_type == IB_QPT_RAW_PACKET) &&
 	    (rdma_port_get_link_layer(&dev->ib_dev, attr->port_num) !=
-	     IB_LINK_LAYER_ETHERNET))
+	     IB_LINK_LAYER_ETHERNET)) {
+		err = -EOPNOTSUPP;
 		goto out;
+	}
 
 	if (attr_mask & IB_QP_PKEY_INDEX) {
 		int p = attr_mask & IB_QP_PORT ? attr->port_num : qp->port;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-27 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-22 13:44 [PATCH for-rc] RDMA/mlx4: Fix return value when QP type isn't supported Kamal Heib
2020-09-22 23:30 ` Jason Gunthorpe
2020-09-27 13:04   ` Kamal Heib

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.