Re: [PATCH] net/mlx4_core: Use refcount_t for refcount

2019-08-06 Thread Jason Gunthorpe
On Sat, Aug 03, 2019 at 10:42:31AM +0800, Chuhong Yuan wrote: > Saeed Mahameed 于2019年8月3日周六 上午2:38写道: > > > > On Sat, 2019-08-03 at 00:10 +0800, Chuhong Yuan wrote: > > > Chuhong Yuan 于2019年8月2日周五 下午8:10写道: > > > > refcount_t is better for reference counters since its > > > > implementation can p

Re: [PATCH] net/mlx4_core: Use refcount_t for refcount

2019-08-02 Thread Chuhong Yuan
Saeed Mahameed 于2019年8月3日周六 上午2:38写道: > > On Sat, 2019-08-03 at 00:10 +0800, Chuhong Yuan wrote: > > Chuhong Yuan 于2019年8月2日周五 下午8:10写道: > > > refcount_t is better for reference counters since its > > > implementation can prevent overflows. > > > So convert atomic_t ref counters to refcount_t. >

Re: [PATCH] net/mlx4_core: Use refcount_t for refcount

2019-08-02 Thread Saeed Mahameed
On Sat, 2019-08-03 at 00:10 +0800, Chuhong Yuan wrote: > Chuhong Yuan 于2019年8月2日周五 下午8:10写道: > > refcount_t is better for reference counters since its > > implementation can prevent overflows. > > So convert atomic_t ref counters to refcount_t. > > > > Also convert refcount from 0-based to 1-base

Re: [PATCH] net/mlx4_core: Use refcount_t for refcount

2019-08-02 Thread Chuhong Yuan
Chuhong Yuan 于2019年8月2日周五 下午8:10写道: > > refcount_t is better for reference counters since its > implementation can prevent overflows. > So convert atomic_t ref counters to refcount_t. > > Also convert refcount from 0-based to 1-based. > It seems that directly converting refcount from 0-based to 1

[PATCH] net/mlx4_core: Use refcount_t for refcount

2019-08-02 Thread Chuhong Yuan
refcount_t is better for reference counters since its implementation can prevent overflows. So convert atomic_t ref counters to refcount_t. Also convert refcount from 0-based to 1-based. Signed-off-by: Chuhong Yuan --- .../ethernet/mellanox/mlx4/resource_tracker.c | 90 +-- 1 fi