Re: [PATCH] net: tipc: add net device refcount tracker for bearer

From: Simon Horman
Date: Sat Aug 05 2023 - 07:27:08 EST


On Fri, Aug 04, 2023 at 04:53:41PM +0800, yang.yang29@xxxxxxxxxx wrote:
> From: xu xin <xu.xin16@xxxxxxxxxx>
>
> Add net device refcount tracker to the struct tipc_bearer.
>
> Signed-off-by: xu xin <xu.xin16@xxxxxxxxxx>
> Reviewed-by: Yang Yang <yang.yang.29@xxxxxxxxxx>
> Cc: Kuang Mingfu <kuang.mingfu@xxxxxxxxxx>

...

> @@ -479,7 +479,7 @@ void tipc_disable_l2_media(struct tipc_bearer *b)
> dev_remove_pack(&b->pt);
> RCU_INIT_POINTER(dev->tipc_ptr, NULL);
> synchronize_net();
> - dev_put(dev);
> + netdev_put(dev, &b->devtracker);
> }
>
> /**
> diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
> index 41eac1ee0c09..1adeaf94aa62 100644
> --- a/net/tipc/bearer.h
> +++ b/net/tipc/bearer.h
> @@ -174,6 +174,7 @@ struct tipc_bearer {
> u16 encap_hlen;
> unsigned long up;
> refcount_t refcnt;
> + netdevice_tracker devtracker;

Hi Xu Xin and Yang Yang,

Please add netdevice_tracker to the kernel doc for struct tipc_bearer,
which appears just above the definition of the structure.

> };
>
> struct tipc_bearer_names {

With that fixed, feel free to add:

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>

--
pw-bot: changes-requested