netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH wireless-next 0/3] netlink carrier race workaround
Date: Sat, 2 Dec 2023 10:46:55 -0800	[thread overview]
Message-ID: <20231202104655.68138ab4@kernel.org> (raw)
In-Reply-To: <339c73a6318bf94803a821d5e8ea7d4c736dc78e.camel@sipsolutions.net>

On Sat, 02 Dec 2023 11:06:36 +0100 Johannes Berg wrote:
> > Would it work if we exposed "linkwatch is pending" / "link is
> > transitioning" bit to user space?  
> 
> Not sure, not by much or more than what this did? It's basically the
> same, I think: I exposed the carrier_up_count at the kernel time, so if
> userspace hasn't seen an event with a value >= that it knows the link is
> transitioning.

The benefit being that it'd work for everyone, without having to add
the carrier count in random events?

> > Even crazier, would it help if we had rtnl_getlink() run
> > linkwatch for the target link if linkwatch is pending?  
> 
> Sure, if we were to just synchronize that at the right time (doesn't
> even need to be rtnl_getlink, could be a new operation) that'd solve the
> issue too, perhaps more easily.

I was wondering about the new op, too, but "synchronize things please"
op feels a little hacky. rtnl_getlink returns link state, so it feels
somewhat natural for it to do the sync, to make sure that what it
returns is in fact correct information. No strong feelings, tho.
rtnl_getlink does return a lot, so maybe a new rtnl_getcarrier op?
Or we can make reading sysfs "carrier" do the sync?

  reply	other threads:[~2023-12-02 18:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19  7:52 netif_carrier_on() race Johannes Berg
2023-09-19 12:36 ` Andrew Lunn
2023-09-19 12:40   ` Johannes Berg
2023-09-26  8:07 ` Johannes Berg
2023-12-01 10:41 ` [PATCH wireless-next 0/3] netlink carrier race workaround Johannes Berg
2023-12-01 10:41   ` [PATCH wireless-next 1/3] wifi: nl80211: refactor nl80211_send_mlme_event() arguments Johannes Berg
2023-12-01 10:41   ` [PATCH wireless-next 2/3] wifi: cfg80211: make RX assoc data const Johannes Berg
2023-12-01 10:41   ` [PATCH wireless-next 3/3] wifi: nl80211: report carrier up count to userspace Johannes Berg
2023-12-02  0:28   ` [PATCH wireless-next 0/3] netlink carrier race workaround Jakub Kicinski
2023-12-02 10:06     ` Johannes Berg
2023-12-02 18:46       ` Jakub Kicinski [this message]
2023-12-03 18:51         ` Johannes Berg
2023-12-04 16:23           ` Jakub Kicinski
2023-12-04 19:14             ` Johannes Berg
2023-12-04 19:47               ` Jakub Kicinski
2023-12-01 10:49 ` [PATCH wpa_supplicant 0/2] wpa_supplicant: wait for carrier race Johannes Berg
2023-12-01 10:49   ` [PATCH wpa_suppplicant 1/2] netlink: add netlink_process_one_event() Johannes Berg
2023-12-01 10:49   ` [PATCH wpa_suppplicant 2/2] driver_nl82011: wait for rtnetlink event with carrier_up_count Johannes Berg

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=20231202104655.68138ab4@kernel.org \
    --to=kuba@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).