lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150724120920.GC504@gospo.home.greyhouse.net>
Date:	Fri, 24 Jul 2015 08:09:21 -0400
From:	Andy Gospodarek <gospo@...ulusnetworks.com>
To:	Jiri Pirko <jiri@...nulli.us>
Cc:	netdev@...r.kernel.org, davem@...emloft.net, idosch@...lanox.com,
	eladr@...lanox.com, ogerlitz@...lanox.com, sfeldma@...il.com,
	roopa@...ulusnetworks.com, f.fainelli@...il.com, tgraf@...g.ch,
	ast@...mgrid.com, jhs@...atatu.com, daniel@...earbox.net,
	john.fastabend@...il.com, simon.horman@...ronome.com,
	linville@...driver.com, andy@...yhouse.net,
	shm@...ulusnetworks.com, nhorman@...driver.com,
	Jiri Pirko <jiri@...lanox.com>
Subject: Re: [patch net-next 3/4] mlxsw: Add interface to access registers
 and process events

On Fri, Jul 24, 2015 at 07:24:53AM +0200, Jiri Pirko wrote:
> Thu, Jul 23, 2015 at 11:12:20PM CEST, gospo@...ulusnetworks.com wrote:
> >On Thu, Jul 23, 2015 at 05:43:35PM +0200, Jiri Pirko wrote:
> >> From: Ido Schimmel <idosch@...lanox.com>
> >> 
> >> Add the ability to construct mailbox-style register access messages
> >> called EMADs with provisions to construct and parse the registers payload.
> >> Implement EMAD transaction layer which is responsible for the reliable
> >> transmission of EMADs.
> >> Also, add an infrastructure used by the switch driver to register for
> >> particular events generated by the device.
> >> 
> >> Signed-off-by: Ido Schimmel <idosch@...lanox.com>
> >> Signed-off-by: Jiri Pirko <jiri@...lanox.com>
> >> Signed-off-by: Elad Raz <eladr@...lanox.com>
> >> ---
> >>  drivers/net/ethernet/mellanox/mlxsw/core.c |  736 ++++++++++++++++
> >>  drivers/net/ethernet/mellanox/mlxsw/core.h |   21 +
> >>  drivers/net/ethernet/mellanox/mlxsw/emad.h |  127 +++
> >>  drivers/net/ethernet/mellanox/mlxsw/port.h |   19 +
> >>  drivers/net/ethernet/mellanox/mlxsw/reg.h  | 1289 ++++++++++++++++++++++++++++
> >>  5 files changed, 2192 insertions(+)
> >>  create mode 100644 drivers/net/ethernet/mellanox/mlxsw/emad.h
> >>  create mode 100644 drivers/net/ethernet/mellanox/mlxsw/reg.h
> >> 
> >> diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
> >> index 211ec9b..bd0f692 100644
> >> --- a/drivers/net/ethernet/mellanox/mlxsw/core.c
> >> +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
> >[...]
> >> +	struct list_head event_listener_list;
> >> +	struct {
> >> +		struct sk_buff *resp_skb;
> >> +		u64 tid;
> >> +		wait_queue_head_t wait;
> >> +		bool trans_active;
> >> +		struct mutex lock; /* One EMAD transaction at a time. */
> >> +		bool use_emad;
> >> +	} emad;
> >>  	struct mlxsw_core_pcpu_stats __percpu *pcpu_stats;
> >>  	struct dentry *dbg_dir;
> >>  	struct {
> >[...]
> >>  	}
> >>  
> >>  	INIT_LIST_HEAD(&mlxsw_core->rx_listener_list);
> >> +	INIT_LIST_HEAD(&mlxsw_core->event_listener_list);
> >>  	mlxsw_core->driver = mlxsw_driver;
> >>  	mlxsw_core->bus = mlxsw_bus;
> >>  	mlxsw_core->bus_priv = bus_priv;
> >[...]
> >> +	/* No reason to save item if we did not manage to register an RX
> >> +	 * listener for it.
> >> +	 */
> >> +	list_add_rcu(&el_item->list, &mlxsw_core->event_listener_list);
> >> +
> >
> >I see where 'event_listener_list' is defined and where entries are
> >added/removed, but where is the code that would receive these events and
> >presumably search this list so all handlers registered (currently just
> >PUDE) can handle events?
> 
> That is handled by calling mlxsw_core_rx_listener_register.
> that will add each event handler as a item to &mlxsw_core->rx_listener_list
> These rx_listeners are called from mlxsw_core_skb_receive.
> So event is here a special case of rx_listener. The event list is used
> just to contain struct mlxsw_event_listener_item instances.
> 

Thanks for the explanation!  I missed how that was called the first time
I went through this.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ