lkml.org 
[lkml]   [2022]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH rdma-next 05/10] RDMA/rxe: Allow registering persistent flag for pmem MR only
Date


On 31/12/2021 22:40, Tom Talpey wrote:
> On 12/30/2021 10:34 PM, lizhijian@fujitsu.com wrote:
>
>>>>    +static bool ib_check_flush_access_flags(struct ib_mr *mr, u32 flags)
>>>> +{
>>>> +    return mr->is_pmem || !(flags & IB_ACCESS_FLUSH_PERSISTENT);
>>>> +}
>
>>> Its name is confusing and needs to be clarified.
>>
>> Err,  let me see.... a more suitable name is very welcome.
>
> Since the subroutine is rather simple, and with only a single
> reference in a single file, it would be best to just pull
> the test inline and delete it. This would also remove some
> inefficient code.
>
>      if (flags & IB_ACCESS_FLUSH_PERSISTENT) {
>         if (!iova_in_pmem(mr, iova, length) {
>             pr_err("Cannot set IB_ACCESS_FLUSH_PERSISTENT for non-pmem memory\n");
>             mr->state = RXE_MR_STATE_INVALID;
>             mr->umem = NULL;
>             err = -EINVAL;
>             goto err_release_umem;
>         }
>         mr-> ibmr.is_pmem = true;
>     }
> ...

Make sense.

Thanks
Zhijian

\
 
 \ /
  Last update: 2022-01-04 02:33    [W:1.831 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site