Re: [PATCH v2] net: mscc: ocelot: add missing lock protection in ocelot_port_xmit()

From
Ziyi Guo <hidden>
Date
2026-02-08 22:16:12
Also in
lkml
Reply to
Vladimir Oltean, 2026-02-08
On Sun, Feb 8, 2026 at 7:35 AM Vladimir Oltean
[off-list ref] 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
Thread (5 messages) 5 messages, 3 authors, last reply 2026-02-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help