> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: Monday, October 13, 2025 7:22 PM
> To: Haiyang Zhang <[email protected]>
> Cc: Haiyang Zhang <[email protected]>; linux-
> [email protected]; [email protected]; Paul Rosswurm
> <[email protected]>; Dexuan Cui <[email protected]>; KY Srinivasan
> <[email protected]>; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected]; Long Li
> <[email protected]>; [email protected];
> [email protected]; [email protected]; Konstantin
> Taranov <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; Shiraz Saleem <[email protected]>;
> [email protected]; [email protected]; linux-
> [email protected]
> Subject: Re: [EXTERNAL] Re: [PATCH net-next] net: mana: Support HW link
> state events
>
> > > > + if (link_up) {
> > > > + netif_carrier_on(ndev);
> > > > +
> > > > + if (apc->port_is_up)
> > > > + netif_tx_wake_all_queues(ndev);
> > > > +
> > > > + __netdev_notify_peers(ndev);
> > > > + } else {
> > > > + if (netif_carrier_ok(ndev)) {
> > > > + netif_tx_disable(ndev);
> > > > + netif_carrier_off(ndev);
> > > > + }
> > > > + }
> > >
> > > It is odd this is asymmetric. Up and down should really be opposites.
> > For the up event, we need to delay the wake up queues if the
> > mana_close() is called, or mana_open() isn't called yet.
> >
> > Also, we notify peers only when link up.
>
> But why is this not symmetric?
>
> On down, if port_is_up is not true, there is no need to disable tx and
> set the carrier off. There are also counters associated with
> netif_carrier_off() and netif_carrier_on(), and if you don't call them
> in symmetric pairs, the counters are going to look odd.
I see. Will update the patch.
Thanks,
- Haiyang