Re: [PATCH rdma-next v3 05/19] RDMA/restrack: Convert internal DB from hash to XArray

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 30, 2019 at 12:48:57PM +0200, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> 
> The additions of .doit callbacks posses new access pattern to the
> resource entries by some user visible index. Back then, the legacy
> DB was implemented as hash because per-index access wasn't needed
> and XArray wasn't accepted yet.
> 
> Acceptance of XArray together with per-index access requires the refresh
> of DB implementation.
> 
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
>  drivers/infiniband/core/nldev.c    |   3 +-
>  drivers/infiniband/core/restrack.c | 101 +++++++++++++++++++++--------
>  include/rdma/restrack.h            |  22 +++++--
>  3 files changed, 90 insertions(+), 36 deletions(-)
> 
> diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
> index 8ad1116c72de..ff222c12d06d 100644
> +++ b/drivers/infiniband/core/nldev.c
> @@ -973,6 +973,7 @@ static int res_get_common_dumpit(struct sk_buff *skb,
>  	int start = cb->args[0];
>  	bool has_cap_net_admin;
>  	struct nlmsghdr *nlh;
> +	unsigned long id = 0;

The new xa_for_each no longer needs the = 0's, they should be removed
for clarity

> @@ -234,12 +276,15 @@ void rdma_restrack_del(struct rdma_restrack_entry *res)
>  	if (!dev)
>  		return;
>  
> +	if (!xa_load(&dev->res.xa[res->type], res->id))
> +		goto out;
> +

This xa_load seems out of place, at least it doesn't belong to this
patch.

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux