linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Li, Zhijian" <lizhijian@cn.fujitsu.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RDMA/mlx5: return the EFAULT per ibv_advise_mr(3)
Date: Sat, 28 Aug 2021 16:42:52 +0800	[thread overview]
Message-ID: <238e5d3c-30e8-86fc-0263-42864fd0d848@cn.fujitsu.com> (raw)
In-Reply-To: <fb1c7505-62d3-a64e-4c57-170f9f5f86a4@fujitsu.com>

Just noticed that there is another code path i was missing will return EINVAL
when get_prefetchable_mr returns NULL

ENOENT:
mlx5_ib_advise_mr_prefetch()
   -> mlx5_ib_prefetch_sg_list()
       -> get_prefetchable_mr()
    return -ENOENT;


EINVAL:
mlx5_ib_advise_mr_prefetch
   ->init_prefetch_work()
      -> get_prefetchable_mr()
     return -EINVAL;

where get_prefetchable_mr will check pd and write access & key
So which value we should return ?

Thanks
  

on 2021/8/26 9:18, Li, Zhijian wrote:
>
> On 26/08/2021 01:28, Jason Gunthorpe wrote:
>> On Sat, Aug 21, 2021 at 05:44:43PM +0800, Li, Zhijian wrote:
>>> convert to text and send again
>>>
>>>
>>> Hi Jason & Leon
>>>
>>> It reminds me that ibv_advise_mr doesn't mention ENOENT any more which value the API actually returns now.
>>> the ENOENT cases/situations returned by kernel mlx5 implementation is most likely same with EINVALL as its manpage[1].
>>>
>>> So shall we return EINVAL instead of ENOENT in kernel side when get_prefetchable_mr returns NULL?
>> No, the man page should be fixed
> thanks a lot, i have submitted a RP to rdma-core https://github.com/linux-rdma/rdma-core/pull/1048
>
> Thanks
> Zhijian
>
>> Jason
>>
>>



      reply	other threads:[~2021-08-28  8:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01  9:20 [PATCH] RDMA/mlx5: return the EFAULT per ibv_advise_mr(3) Li Zhijian
2021-08-01 11:27 ` Leon Romanovsky
2021-08-03 16:25 ` Jason Gunthorpe
2021-08-03 17:56   ` Leon Romanovsky
2021-08-03 18:13     ` Jason Gunthorpe
2021-08-04  5:35       ` Leon Romanovsky
2021-08-04 18:50         ` Jason Gunthorpe
2021-08-05  6:43           ` Leon Romanovsky
2021-08-16  2:59             ` lizhijian
2021-08-21  9:44               ` Li, Zhijian
2021-08-25 17:28                 ` Jason Gunthorpe
2021-08-26  1:18                   ` lizhijian
2021-08-28  8:42                     ` Li, Zhijian [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=238e5d3c-30e8-86fc-0263-42864fd0d848@cn.fujitsu.com \
    --to=lizhijian@cn.fujitsu.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).