Re: [PATCH net 2/7] net: mscc: ocelot: add locking for the port TX timestamp ID

2020-09-17 Thread David Miller
From: Vladimir Oltean Date: Fri, 18 Sep 2020 02:43:40 +0300 > On Wed, Sep 16, 2020 at 05:19:26PM -0700, David Miller wrote: >> From: Vladimir Oltean >> Date: Tue, 15 Sep 2020 21:22:24 +0300 >> >> > This is a problem because, at least theoretically, another timestampable >> > skb might use the sa

Re: [PATCH net 2/7] net: mscc: ocelot: add locking for the port TX timestamp ID

2020-09-17 Thread Vladimir Oltean
On Wed, Sep 16, 2020 at 05:19:26PM -0700, David Miller wrote: > From: Vladimir Oltean > Date: Tue, 15 Sep 2020 21:22:24 +0300 > > > This is a problem because, at least theoretically, another timestampable > > skb might use the same ocelot_port->ts_id before that is incremented. So > > the logic of

Re: [PATCH net 2/7] net: mscc: ocelot: add locking for the port TX timestamp ID

2020-09-16 Thread David Miller
From: Vladimir Oltean Date: Tue, 15 Sep 2020 21:22:24 +0300 > This is a problem because, at least theoretically, another timestampable > skb might use the same ocelot_port->ts_id before that is incremented. So > the logic of using and incrementing the timestamp id should be atomic > per port. Ha

Re: [PATCH net 2/7] net: mscc: ocelot: add locking for the port TX timestamp ID

2020-09-16 Thread Alexandre Belloni
On 15/09/2020 21:22:24+0300, Vladimir Oltean wrote: > From: Vladimir Oltean > > The ocelot_port->ts_id is used to: > - populate skb->cb[0] for matching the TX timestamp in the PTP IRQ with > an skb. > - populate the REW_OP from the injection header of the ongoing skb. > Only then is ocelot_port

Re: [PATCH net 2/7] net: mscc: ocelot: add locking for the port TX timestamp ID

2020-09-16 Thread Vladimir Oltean
On Wed, Sep 16, 2020 at 01:12:04PM +0200, Alexandre Belloni wrote: > > + for (port = 0; port < ocelot->num_phys_ports; port++) { > > + struct ocelot_port *ocelot_port = ocelot->ports[port]; > > + > > At this point, ocelot_port is NULL because ocelot_init is called before > the port str

[PATCH net 2/7] net: mscc: ocelot: add locking for the port TX timestamp ID

2020-09-15 Thread Vladimir Oltean
From: Vladimir Oltean The ocelot_port->ts_id is used to: - populate skb->cb[0] for matching the TX timestamp in the PTP IRQ with an skb. - populate the REW_OP from the injection header of the ongoing skb. Only then is ocelot_port->ts_id incremented. This is a problem because, at least theoreti