# Re: \[PATCH net-next v9 07/13\] ptp: Move from simple ida to xarray

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2024-03-05 15:03:51 
- List: netdev
- Page: https://ratatoskr.run/netdev/2024/03/2521864
- Thread: https://ratatoskr.run/netdev/2024/02/2511310/t.md

```text
On Tue, 5 Mar 2024 10:02:59 +0100 Köry Maincent wrote:
> On Mon, 4 Mar 2024 18:47:37 -0800
> Jakub Kicinski [ref] wrote:
> 
> > On Mon, 26 Feb 2024 14:39:58 +0100 Kory Maincent wrote:  
> > > +static DEFINE_XARRAY_FLAGS(ptp_clocks_map, XA_FLAGS_LOCK_IRQ |
> > > XA_FLAGS_ALLOC);    
> > 
> > Why _IRQ? anything on the fastpath hopefully has a pointer to the clock
> > already, I'd hope. And we often reserve ID 0 as invalid.  
> 
> To keep the same flag as IDA_INIT_FLAGS, I am not expert in xarray so I just
> keep it without questioning it. Do you think I should remove it?

Yes, I believe those defaults are just "to be safe".

> ID 0 was valid for phc. IMHO makes it invalid is not a good idea, it
> will change the phc id value for current board on the field.

Ah, right, let's keep it then. We'll have to use -1 as invalid.

> > BTW could be a standalone patch, Xarray conversion from IDA is an
> > improvement in itself.  
> 
> Indeed. Do you prefer this patch to be standalone?

May be a personal preference but I do feel like sending general
improvements separately from large new features makes the process 
more smooth.
```
