From: Andrew Lunn <andrew@lunn.ch>
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Haiyang Zhang <haiyangz@linux.microsoft.com>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Paul Rosswurm <paulros@microsoft.com>,
Dexuan Cui <decui@microsoft.com>,
KY Srinivasan <kys@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
"edumazet@google.com" <edumazet@google.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
Long Li <longli@microsoft.com>,
"ssengar@linux.microsoft.com" <ssengar@linux.microsoft.com>,
"ernis@linux.microsoft.com" <ernis@linux.microsoft.com>,
"dipayanroy@linux.microsoft.com" <dipayanroy@linux.microsoft.com>,
Konstantin Taranov <kotaranov@microsoft.com>,
"horms@kernel.org" <horms@kernel.org>,
"shradhagupta@linux.microsoft.com"
<shradhagupta@linux.microsoft.com>,
"leon@kernel.org" <leon@kernel.org>,
"mlevitsk@redhat.com" <mlevitsk@redhat.com>,
"yury.norov@gmail.com" <yury.norov@gmail.com>,
Shiraz Saleem <shirazsaleem@microsoft.com>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [EXTERNAL] Re: [PATCH net-next] net: mana: Support HW link state events
Date: Tue, 14 Oct 2025 01:21:45 +0200 [thread overview]
Message-ID: <4ea9acfd-be02-4299-b8c4-95bb69ad04cd@lunn.ch> (raw)
In-Reply-To: <CY5PR21MB3447B6D69542EA4532547A5FCAEAA@CY5PR21MB3447.namprd21.prod.outlook.com>
> > > + 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.
> cancel_work_sync()'s doc says "This function can be used
> even if the work re-queues itself".
> cancel_delayed_work_sync() calls the same underlying function but
> with WORK_CANCEL_DELAYED flag. So it should be OK.
O.K, thanks
Andrew
next prev parent reply other threads:[~2025-10-13 23:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 19:33 Haiyang Zhang
2025-10-13 21:13 ` Andrew Lunn
2025-10-13 21:47 ` [EXTERNAL] " Haiyang Zhang
2025-10-13 23:21 ` Andrew Lunn [this message]
2025-10-14 14:11 ` Haiyang Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ea9acfd-be02-4299-b8c4-95bb69ad04cd@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=dipayanroy@linux.microsoft.com \
--cc=edumazet@google.com \
--cc=ernis@linux.microsoft.com \
--cc=haiyangz@linux.microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=horms@kernel.org \
--cc=kotaranov@microsoft.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=mlevitsk@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paulros@microsoft.com \
--cc=shirazsaleem@microsoft.com \
--cc=shradhagupta@linux.microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=wei.liu@kernel.org \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®