From: Jakub Kicinski <kuba@kernel.org>
To: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Cc: linux-pm@vger.kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Ricardo Neri <ricardo.neri-calderon@linux.intel.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] netlink: Add notifier when changing netlink socket membership
Date: Wed, 31 Jan 2024 17:40:56 -0800 [thread overview]
Message-ID: <20240131174056.23b43f12@kernel.org> (raw)
In-Reply-To: <20240131120535.933424-2-stanislaw.gruszka@linux.intel.com>
On Wed, 31 Jan 2024 13:05:33 +0100 Stanislaw Gruszka wrote:
> Add notification when adding/removing multicast group to/from
> client socket via setsockopt() syscall.
>
> It can be used with conjunction with netlink_has_listeners() to check
> if consumers of netlink multicast messages emerge or disappear.
>
> A client can call netlink_register_notifier() to register a callback.
> In the callback check for state NETLINK_CHANGE and NETLINK_URELEASE to
> get notification for change in the netlink socket membership.
>
> Thus, a client can now send events only when there are active consumers,
> preventing unnecessary work when none exist.
Can we plumb thru the existing netlink_bind / netlink_unbind callbacks?
Add similar callbacks to the genl family struct to plumb it thru to
thermal. Then thermal can do what it wants with it (also add driver
callbacks or notifiers).
Having a driver listen to a core AF_NETLINK notifier to learn about
changes to a genl family it registers with skips too many layers to
easily reason about. At least for my taste.
When you repost please CC Florian W, Johannes B and Jiri P, off the top
of my head. Folks who most often work on netlink internals..
next prev parent reply other threads:[~2024-02-01 1:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 12:05 [PATCH 0/3] thermal/netlink/intel_hfi: Enable HFI feature only when required Stanislaw Gruszka
2024-01-31 12:05 ` [PATCH 1/3] netlink: Add notifier when changing netlink socket membership Stanislaw Gruszka
2024-02-01 1:40 ` Jakub Kicinski [this message]
2024-02-01 13:10 ` Stanislaw Gruszka
2024-01-31 12:05 ` [PATCH 2/3] thermal: netlink: Export thermal_group_has_listeners() Stanislaw Gruszka
2024-01-31 12:05 ` [PATCH 3/3] thermal: intel: hfi: Enable interface only when required Stanislaw Gruszka
2024-02-01 1:48 ` Ricardo Neri
2024-02-01 13:20 ` Stanislaw Gruszka
2024-02-01 16:21 ` Ricardo Neri
2024-02-02 12:36 ` Jiri Pirko
2024-02-02 13:00 ` Stanislaw Gruszka
2024-02-03 13:15 ` Jiri Pirko
2024-02-05 12:00 ` Stanislaw Gruszka
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=20240131174056.23b43f12@kernel.org \
--to=kuba@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-pm@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafael@kernel.org \
--cc=ricardo.neri-calderon@linux.intel.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=stanislaw.gruszka@linux.intel.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;
as well as URLs for NNTP newsgroup(s).