lkml.org 
[lkml]   [2021]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH rdma-next 05/10] RDMA/rxe: Allow registering persistent flag for pmem MR only
From
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;
}
...

\
 
 \ /
  Last update: 2021-12-31 15:41    [W:0.165 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site