From: Jason Gunthorpe <jgg@ziepe.ca>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
Bart Van Assche <bvanassche@acm.org>,
"David S. Miller" <davem@davemloft.net>,
Dennis Dalessandro <dennis.dalessandro@intel.com>,
Jakub Kicinski <kuba@kernel.org>,
Karsten Graul <kgraul@linux.ibm.com>,
linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org,
netdev@vger.kernel.org,
Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
rds-devel@oss.oracle.com,
Santosh Shilimkar <santosh.shilimkar@oracle.com>,
target-devel@vger.kernel.org, Ursula Braun <ubraun@linux.ibm.com>
Subject: Re: [PATCH rdma-next] RDMA: Allow ib_client's to fail when add() is called
Date: Wed, 6 May 2020 13:05:52 -0300 [thread overview]
Message-ID: <20200506160552.GA9993@ziepe.ca> (raw)
In-Reply-To: <20200421172440.387069-1-leon@kernel.org>
On Tue, Apr 21, 2020 at 08:24:40PM +0300, Leon Romanovsky wrote:
> From: Jason Gunthorpe <jgg@mellanox.com>
>
> When a client is added it isn't allowed to fail, but all the client's have
> various failure paths within their add routines.
>
> This creates the very fringe condition where the client was added, failed
> during add and didn't set the client_data. The core code will then still
> call other client_data centric ops like remove(), rename(), get_nl_info(),
> and get_net_dev_by_params() with NULL client_data - which is confusing and
> unexpected.
>
> If the add() callback fails, then do not call any more client ops for the
> device, even remove.
>
> Remove all the now redundant checks for NULL client_data in ops callbacks.
>
> Update all the add() callbacks to return error codes
> appropriately. EOPNOTSUPP is used for cases where the ULP does not support
> the ib_device - eg because it only works with IB.
>
> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> Acked-by: Ursula Braun <ubraun@linux.ibm.com>
> ---
> drivers/infiniband/core/cm.c | 24 ++++++++++--------
> drivers/infiniband/core/cma.c | 23 +++++++++--------
> drivers/infiniband/core/device.c | 16 ++++++++++--
> drivers/infiniband/core/mad.c | 17 ++++++++++---
> drivers/infiniband/core/multicast.c | 12 ++++-----
> drivers/infiniband/core/sa_query.c | 22 ++++++++--------
> drivers/infiniband/core/user_mad.c | 22 ++++++++--------
> drivers/infiniband/core/uverbs_main.c | 24 +++++++++---------
> drivers/infiniband/ulp/ipoib/ipoib_main.c | 15 ++++-------
> .../infiniband/ulp/opa_vnic/opa_vnic_vema.c | 12 ++++-----
> drivers/infiniband/ulp/srp/ib_srp.c | 21 ++++++++--------
> drivers/infiniband/ulp/srpt/ib_srpt.c | 25 ++++++++-----------
> include/rdma/ib_verbs.h | 2 +-
> net/rds/ib.c | 21 ++++++++++------
> net/smc/smc_ib.c | 10 +++-----
> 15 files changed, 142 insertions(+), 124 deletions(-)
Applied to for-next
Jason
prev parent reply other threads:[~2020-05-06 16:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 17:24 [PATCH rdma-next] RDMA: Allow ib_client's to fail when add() is called Leon Romanovsky
2020-04-23 9:39 ` Ursula Braun
2020-05-06 16:05 ` Jason Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200506160552.GA9993@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=bvanassche@acm.org \
--cc=davem@davemloft.net \
--cc=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=niranjana.vishwanathapura@intel.com \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.com \
--cc=target-devel@vger.kernel.org \
--cc=ubraun@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).