Re: [PATCH v2] net: mscc: ocelot: add missing lock protection in ocelot_port_xmit()
From: Ziyi Guo
Date: Sun Feb 08 2026 - 17:16:28 EST
On Sun, Feb 8, 2026 at 7:35 AM Vladimir Oltean
<vladimir.oltean@xxxxxxx> wrote:
>
> The idea is not bad, but I would move one step further.
>
> Refactor the rew_op handling into an ocelot_xmit_timestamp() function as
> a first preparatory patch. The logic will need to be called from two
> places and it's good not to duplicate it.
>
> Then create two separate ocelot_port_xmit_fdma() and ocelot_port_xmit_inj(),
> as a second preparatory patch.
>
> static netdev_tx_t ocelot_port_xmit(struct sk_buff *skb, struct net_device *dev)
> {
> if (static_branch_unlikely(&ocelot_fdma_enabled))
> return ocelot_port_xmit_fdma(skb, dev);
>
> return ocelot_port_xmit_inj(skb, dev);
> }
>
> Now, as the third patch, add the required locking in ocelot_port_xmit_inj().
>
> It's best for the FDMA vs register injection code paths to be as
> separate as possible.
Thanks Vladimir and folks for your time. I'll split it into three
patches as series, and send a v3 version.
Best,
Ziyi