* [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
* Re: [PATCH for-rc] RDMA/mlx4: Fix return value when QP type isn't supported
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
0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2020-09-22 23:30 UTC (permalink / raw)
To: Kamal Heib; +Cc: linux-rdma, Doug Ledford, Yishai Hadas
On Tue, Sep 22, 2020 at 04:44:29PM +0300, Kamal Heib wrote:
> 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(-)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for-rc] RDMA/mlx4: Fix return value when QP type isn't supported
2020-09-22 23:30 ` Jason Gunthorpe
@ 2020-09-27 13:04 ` Kamal Heib
0 siblings, 0 replies; 3+ messages in thread
From: Kamal Heib @ 2020-09-27 13:04 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma, Doug Ledford, Yishai Hadas
On Tue, Sep 22, 2020 at 08:30:03PM -0300, Jason Gunthorpe wrote:
> On Tue, Sep 22, 2020 at 04:44:29PM +0300, Kamal Heib wrote:
> > 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(-)
>
> 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
^ permalink raw reply [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.