public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Kamal Heib <kamalheib1@gmail.com>
Cc: linux-rdma@vger.kernel.org, Jason Gunthorpe <jgg@ziepe.ca>,
	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: Tue, 18 Feb 2020 18:45:23 +0200	[thread overview]
Message-ID: <20200218164523.GB14557@unreal> (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
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ 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");

This print doesn't make any sense, we are unregistering MAD agent anyway.

>  		if (sport->mad_agent) {
>  			ib_unregister_mad_agent(sport->mad_agent);
> --
> 2.21.1
>

  reply	other threads:[~2020-02-18 16:45 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 [this message]
2020-03-04 17:09 ` Jason Gunthorpe

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=20200218164523.GB14557@unreal \
    --to=leon@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --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