Subject: Re: [patch net-next v2] net: devlink: convert port_list into xarray

From: Leon Romanovsky <[email-masked]>
Date: Wed, 30 Nov 2022 11:03:33 +0200

On Tue, Nov 29, 2022 at 09:27:36PM -0800, Jakub Kicinski wrote:
> On Mon, 28 Nov 2022 12:08:03 +0100 Jiri Pirko wrote:
> > @@ -9903,9 +9896,9 @@ void devlink_free(struct devlink *devlink)
> >  	WARN_ON(!list_empty(&devlink->sb_list));
> >  	WARN_ON(!list_empty(&devlink->rate_list));
> >  	WARN_ON(!list_empty(&devlink->linecard_list));
> > -	WARN_ON(!list_empty(&devlink->port_list));
> >  
> >  	xa_destroy(&devlink->snapshot_ids);
> > +	xa_destroy(&devlink->ports);
> 
> Will it warn if not empty?

No, it won't warn. It will simply reinitialize the XArray.