Skip to contentSkip to conversation

RDMA/mlx4: Fix return value when QP type isn't supported

PATCH In review Kamal Heib 2 participants 3 messages Sep 22, 2020 – Sep 27, 2020

Subsystems (2)
lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

PATCH 1/1 RDMA/mlx4: Fix return value when QP type isn't supported

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")
---
 drivers/infiniband/hw/mlx4/qp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx4/qp.c +3 -1
index 2975f350b9fd..3c6ed7a7d407 100644
@@ -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;
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 8 lines · 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")
---
 drivers/infiniband/hw/mlx4/qp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Is it? Why? EOPNOTSUPP should be used by the uverbs layer to indicate that the operation is not implemented in the driver

Calling modify_qp against a RAW_QP when it is not supported by spec is EINVAL?

Jason

author
#2 lore raw
Quoted 10 lines · Jason Gunthorpe
Quoted 8 lines · 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")
---
 drivers/infiniband/hw/mlx4/qp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 7 lines

Is it? Why? EOPNOTSUPP should be used by the uverbs layer to indicate that the operation is not implemented in the driver

Calling modify_qp against a RAW_QP when it is not supported by spec is EINVAL?

Jason

Please drop this patch...

The idea behind it was to avoid the pyverbs test_qp.py failure when trying to create a RAW QP over an mlx4 IB port, this was fixed using the following change in the test_qp.py:

https://github.com/linux-rdma/rdma-core/pull/833

Thanks,
Kamal