Skip to contentSkip to conversation

Use refcount_t for refcount

PATCH Superseded Chuhong Yuan 2 participants 4 messages Aug 2, 2019 – Aug 5, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Use refcount_t for refcount

Reference counters are preferred to use refcount_t instead of atomic_t.
This is because the implementation of refcount_t can prevent overflows and detect possible use-after-free.

First convert the refcount field to refcount_t in mlx5/driver.h. Then convert the uses to refcount_() APIs.

Chuhong Yuan (3):
mlx5: Use refcount_t for refcount
net/mlx5: Use refcount_() APIs
IB/mlx5: Use refcount_() APIs

 drivers/infiniband/hw/mlx5/srq_cmd.c         | 6 +++---
 drivers/net/ethernet/mellanox/mlx5/core/qp.c | 6 +++---
 include/linux/mlx5/driver.h                  | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw
Quoted 7 lines · Chuhong Yuan

Reference counters are preferred to use refcount_t instead of atomic_t.
This is because the implementation of refcount_t can prevent overflows and detect possible use-after-free.

First convert the refcount field to refcount_t in mlx5/driver.h. Then convert the uses to refcount_() APIs.

You can't do it, because you need to ensure that driver compiles and works between patches. By converting driver.h alone to refcount_t, you simply broke mlx5 driver.

NAK, to be clear.

And please don't sent series of patches as standalone patches.

Thanks,

#2 lore raw
Quoted 7 lines · Leon Romanovsky
Quoted 5 lines · Chuhong Yuan

Reference counters are preferred to use refcount_t instead of atomic_t.
This is because the implementation of refcount_t can prevent overflows and detect possible use-after-free.

Quoted 7 lines
Quoted 2 lines

First convert the refcount field to refcount_t in mlx5/driver.h. Then convert the uses to refcount_() APIs.

You can't do it, because you need to ensure that driver compiles and works between patches. By converting driver.h alone to refcount_t, you simply broke mlx5 driver.

It is my fault... I am not clear how to send patches which cross several subsystems, so I sent them in series.
Maybe I should merge these patches together?

Quoted 4 lines

NAK, to be clear.

And please don't sent series of patches as standalone patches.

Due to the reason mentioned above, I sent them seperately.

Quoted 1 line

Thanks,

#3 lore raw
Quoted 11 lines · Chuhong Yuan
Quoted 10 lines · Leon Romanovsky
Quoted 7 lines · Chuhong Yuan

Reference counters are preferred to use refcount_t instead of atomic_t.
This is because the implementation of refcount_t can prevent overflows and detect possible use-after-free.

First convert the refcount field to refcount_t in mlx5/driver.h. Then convert the uses to refcount_() APIs.

Quoted 8 lines
Quoted 4 lines

You can't do it, because you need to ensure that driver compiles and works between patches. By converting driver.h alone to refcount_t, you simply broke mlx5 driver.

It is my fault... I am not clear how to send patches which cross several subsystems, so I sent them in series.
Maybe I should merge these patches together?

In case of conversion patches, yes, you need to perform such change in one shot.

Quoted 8 lines
Quoted 6 lines

NAK, to be clear.

And please don't sent series of patches as standalone patches.

Due to the reason mentioned above, I sent them seperately.

Create patch, run ./scripts/get_maintainer.pl on it and send according to generated output. You are not doing kernel core changes and there is no need to worry about cross subsystem complexity as long as you will put relevant maintainers in TO: field.

Thanks

Quoted 2 lines
Quoted 2 lines

Thanks,