From: Jason Gunthorpe <jgg@ziepe.ca>
To: Kamal Heib <kamalheib1@gmail.com>
Cc: linux-rdma@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH for-next] RDMA/srpt: Avoid print error when modify_port is not supported
Date: Wed, 4 Mar 2020 13:09:52 -0400 [thread overview]
Message-ID: <20200304170952.GA26927@ziepe.ca> (raw)
In-Reply-To: <20200218101740.27762-1-kamalheib1@gmail.com>
On Tue, Feb 18, 2020 at 12:17:40PM +0200, Kamal Heib wrote:
> Avoid printing the following error when modify_port isn't supported.
>
> [47541.541145] ib_srpt disabling MAD processing failed.
>
> Fixes: a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> drivers/infiniband/ulp/srpt/ib_srpt.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index 98552749d71c..eba2b156616d 100644
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -628,12 +628,14 @@ static void srpt_unregister_mad_agent(struct srpt_device *sdev)
> .clr_port_cap_mask = IB_PORT_DEVICE_MGMT_SUP,
> };
> struct srpt_port *sport;
> + int ret;
> int i;
>
> for (i = 1; i <= sdev->device->phys_port_cnt; i++) {
> sport = &sdev->port[i - 1];
> WARN_ON(sport->port != i);
> - if (ib_modify_port(sdev->device, i, 0, &port_modify) < 0)
> + ret = ib_modify_port(sdev->device, i, 0, &port_modify);
> + if (ret < 0 && ret != -EOPNOTSUPP)
> pr_err("disabling MAD processing failed.\n");
> if (sport->mad_agent) {
> ib_unregister_mad_agent(sport->mad_agent);
This logic is goofy if the original ib_modify_port fails then
sport->mad_agent should be NULL so it should just skip it anyhow.
If it is fixed up then we won't get the EOPNOTSUPP anymore.
I'm also unclear what this IB_PORT_DEVICE_MGMT_SUP is all about, it is
weird that a ULP is touching a device global flag like this
Jason
prev parent reply other threads:[~2020-03-04 17:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 10:17 [PATCH for-next] RDMA/srpt: Avoid print error when modify_port is not supported Kamal Heib
2020-02-18 16:45 ` Leon Romanovsky
2020-03-04 17:09 ` 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=20200304170952.GA26927@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=bvanassche@acm.org \
--cc=dledford@redhat.com \
--cc=kamalheib1@gmail.com \
--cc=linux-rdma@vger.kernel.org \
/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