[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191118012924.GC4084@lunn.ch>
Date: Mon, 18 Nov 2019 02:29:24 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Shay Drory <shayd@...lanox.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Maor Gottlieb <maorg@...lanox.com>,
Eran Ben Elisha <eranbe@...lanox.com>,
"lennart@...ttering.net" <lennart@...ttering.net>,
Saeed Mahameed <saeedm@...lanox.com>
Subject: Re: Send SFP event from kernel driver to user space (UDEV)
On Sun, Nov 17, 2019 at 11:46:15AM +0000, Shay Drory wrote:
Hi Shay
It would be good to Cc: the generic SFP code maintainers.
> Today, SFP inserted / removal event impacts only the kernel space drivers.
> There are users who wishes to get SFP insert / removal in a udev-event
> format for their application / daemons / monitors.
> The naive way to implement this feature would be to create a sysfs file
> that represents device SFP, to expose it under the netdev sysfs, and
> to raise a udev event over it.
> However, it is not reasonable to create a sysfs for each net-device.
> In this letter, I would like to offer a new mechanism that will add a
> support to send SFP events from the kernel driver to user space.
> This suggestion is built upon a new netlink infrastructure for ethtool
> currently being written by Michal Kubeckwhich called “ethtool-netlink”[1].
So you are in no rush to make use of this? ethtool-nl seems to be
making very slow progress.
> My suggestion is to do it by adding a function
> (ethtool_sfp_insterted/removed(...)) to ethtool API, This function will
> raise a netlink event to be caught in user space.
What about the case of the SFP is inserted before the SFP is
associated to a netdev? Similarly, the SFP is ejected when the SFP is
not connected to a MAC. You don't have a netdev, so you cannot send an
event. And SFF, which are never inserted or removed? SFPs have a
different life cycle to a netdev. Do you care about this?
> The design:
>
> - SFP event from NIC caught by the driver
> - Driver call ethtool_sfp_inserted/removed()
> - Ethtool generated netlink event with relevant data
> - This event-message will be handled in the user-space library of UDEV
> (for this purpose we would like to add a netlink infrastructure to UDEV
> user-space library).
Would you add just SFP insert/eject to UDEV. Or all the events which
get sent via netlink? Link up/down, route add/remove, etc?
What sort of daemon is this anyway? Most networking daemons already
have the code to listen to netlink events. So why complicate things by
using UDEV?
Is UDEV name space aware? Do you run a udev daemon in each network
name space? I assume when you open a netlink socket, it is for just
the current network namespace?
Andrew
Powered by blists - more mailing lists