]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/core: Fix return code when modify_port isn't supported
authorKamal Heib <kamalheib1@gmail.com>
Mon, 28 Oct 2019 15:59:28 +0000 (17:59 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 6 Nov 2019 17:29:15 +0000 (13:29 -0400)
commite4adefd6fa7aaac156219fa903d13a280c6c3033
treeae555a6d46e6c6bafc88c53f6ebd60bf9439c7e0
parent3ab69746e59356cee7010983e2f1bf41c487ced9
RDMA/core: Fix return code when modify_port isn't supported

Improve return code from ib_modify_port() by doing the following:
 - Use "-EOPNOTSUPP" instead "-ENOSYS" which is the proper return code

 - Allow only fake IB_PORT_CM_SUP manipulation for RoCE providers that
   didn't implement the modify_port callback, otherwise return
   "-EOPNOTSUPP"

Fixes: cb3960ac3658 ("IB: Avoid ib_modify_port() failure for RoCE devices")
Link: https://lore.kernel.org/r/20191028155931.1114-2-kamalheib1@gmail.com
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/device.c