RDMA/efa: Propagate destroy AH error
Subsystems (2)
PATCH 1/1 RDMA/efa: Propagate destroy AH error
AH destruction currently always returns success, ignoring any error from the device. Propagate the actual device error so the caller can handle failures appropriately.
--- drivers/infiniband/hw/efa/efa_verbs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/hw/efa/efa_verbs.c +1 -2
@@ -2134,8 +2134,7 @@ int efa_destroy_ah(struct ib_ah *ibah, u32 flags)return -EOPNOTSUPP ; } -efa_ah_destroy (dev, ah); -return 0 ; +return efa_ah_destroy (dev, ah); } struct rdma_hw_stats *efa_alloc_hw_port_stats(struct ib_device *ibdev,
Signature · 1 line
2.47.3
Jason Gunthorpe
maintainerQuoted 3 lines · Tom Sela
AH destruction currently always returns success, ignoring any error from the device. Propagate the actual device error so the caller can handle failures appropriately.
Callers don't handle failures. Drivers are not permitted to fail destroy, if they do it probably will trigger a WARN_ON.
You can make some of an argument to allow failing destroy for user objects only, but not like this in general for kernel objects.
If your FW fails destroying a kernel object then the device is busted, you should reset it and succeed to destroy the kernel object anyhow.
Jason
Quoted 8 lines · Jason Gunthorpe
Quoted 3 lines · Tom Sela
AH destruction currently always returns success, ignoring any error from the device. Propagate the actual device error so the caller can handle failures appropriately.
Callers don't handle failures. Drivers are not permitted to fail destroy, if they do it probably will trigger a
WARN_ON.
Quoted 7 lines
You can make some of an argument to allow failing destroy for user objects only, but not like this in general for kernel objects.
If your FW fails destroying a kernel object then the device is busted, you should reset it and succeed to destroy the kernel object anyhow.
Jason
This code is for user objects only. When destroy is called for a user object, the core code handles the failure gracefully and can retry cleanup at a later stage.
Currently we don't have a code path where destroy_ah actually fails in device, but we'd like the error propagation in place for completeness so that if a future FW change can return a transient error, we handle it correctly rather than silently ignoring it.
Would you prefer we explicitly guard this with a check for ibah->uobject (i.e., only propagate the error when it's a user object).
Tom
Jason Gunthorpe
maintainerQuoted 22 lines · tom sela
Quoted 8 lines · Jason Gunthorpe
Quoted 3 lines · Tom Sela
AH destruction currently always returns success, ignoring any error from the device. Propagate the actual device error so the caller can handle failures appropriately.
Callers don't handle failures. Drivers are not permitted to fail destroy, if they do it probably will trigger a
WARN_ON.Quoted 7 lines
You can make some of an argument to allow failing destroy for user objects only, but not like this in general for kernel objects.
If your FW fails destroying a kernel object then the device is busted, you should reset it and succeed to destroy the kernel object anyhow.
Jason
This code is for user objects only. When destroy is called for a user object, the core code handles the failure gracefully and can retry cleanup at a later stage.
Quoted 8 lines
Currently we don't have a code path where
destroy_ahactually fails in device, but we'd like the error propagation in place for completeness so that if a future FW change can return a transient error, we handle it correctly rather than silently ignoring it.Would you prefer we explicitly guard this with a check for
ibah->uobject(i.e., only propagate the error when it's a user object).
Do you ever plan to support kverbs on efa?
It is still not Ok to propogae all failures even on uobjects, you will still trigger a WARN_ON eventually.. It has to succeed under the retry logic.
Jason
Michael Margolin
maintainerQuoted 28 lines · Jason Gunthorpe
Quoted 27 lines · tom sela
Quoted 8 lines · Jason Gunthorpe
Quoted 3 lines · Tom Sela
AH destruction currently always returns success, ignoring any error from the device. Propagate the actual device error so the caller can handle failures appropriately.
Callers don't handle failures. Drivers are not permitted to fail destroy, if they do it probably will trigger a
WARN_ON.Quoted 7 lines
You can make some of an argument to allow failing destroy for user objects only, but not like this in general for kernel objects.
If your FW fails destroying a kernel object then the device is busted, you should reset it and succeed to destroy the kernel object anyhow.
Jason
This code is for user objects only. When destroy is called for a user object, the core code handles the failure gracefully and can retry cleanup at a later stage.
Currently we don't have a code path where
destroy_ahactually fails in device, but we'd like the error propagation in place for completeness so that if a future FW change can return a transient error, we handle it correctly rather than silently ignoring it.
Quoted 5 lines
Quoted 3 lines
Would you prefer we explicitly guard this with a check for
ibah->uobject(i.e., only propagate the error when it's a user object).Do you ever plan to support kverbs on efa?
I believe we eventually will.
Quoted 4 lines
It is still not Ok to propogae all failures even on uobjects, you will still trigger a
WARN_ONeventually.. It has to succeed under the retry logic.
So propagating EBUSY/EAGAIN for userspace objects does make sense?
Michael
Quoted 2 lines
Jason