Commit 4834ad80 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: core: Trace EMAD events

Currently, mlxsw triggers the 'devlink:devlink_hwmsg' tracepoint
whenever a request is sent to the device and whenever a response is
received from it. However, the tracepoint is not triggered when an event
(e.g., port up / down) is received from the device.

Also trace EMAD events in order to log a more complete picture of all
the exchanged hardware messages.
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 23fb5552
...@@ -160,6 +160,7 @@ struct mlxsw_rx_listener_item { ...@@ -160,6 +160,7 @@ struct mlxsw_rx_listener_item {
struct mlxsw_event_listener_item { struct mlxsw_event_listener_item {
struct list_head list; struct list_head list;
struct mlxsw_core *mlxsw_core;
struct mlxsw_event_listener el; struct mlxsw_event_listener el;
void *priv; void *priv;
}; };
...@@ -2171,11 +2172,16 @@ static void mlxsw_core_event_listener_func(struct sk_buff *skb, u8 local_port, ...@@ -2171,11 +2172,16 @@ static void mlxsw_core_event_listener_func(struct sk_buff *skb, u8 local_port,
void *priv) void *priv)
{ {
struct mlxsw_event_listener_item *event_listener_item = priv; struct mlxsw_event_listener_item *event_listener_item = priv;
struct mlxsw_core *mlxsw_core;
struct mlxsw_reg_info reg; struct mlxsw_reg_info reg;
char *payload; char *payload;
char *reg_tlv; char *reg_tlv;
char *op_tlv; char *op_tlv;
mlxsw_core = event_listener_item->mlxsw_core;
trace_devlink_hwmsg(priv_to_devlink(mlxsw_core), true, 0,
skb->data, skb->len);
mlxsw_emad_tlv_parse(skb); mlxsw_emad_tlv_parse(skb);
op_tlv = mlxsw_emad_op_tlv(skb); op_tlv = mlxsw_emad_op_tlv(skb);
reg_tlv = mlxsw_emad_reg_tlv(skb); reg_tlv = mlxsw_emad_reg_tlv(skb);
...@@ -2225,6 +2231,7 @@ int mlxsw_core_event_listener_register(struct mlxsw_core *mlxsw_core, ...@@ -2225,6 +2231,7 @@ int mlxsw_core_event_listener_register(struct mlxsw_core *mlxsw_core,
el_item = kmalloc(sizeof(*el_item), GFP_KERNEL); el_item = kmalloc(sizeof(*el_item), GFP_KERNEL);
if (!el_item) if (!el_item)
return -ENOMEM; return -ENOMEM;
el_item->mlxsw_core = mlxsw_core;
el_item->el = *el; el_item->el = *el;
el_item->priv = priv; el_item->priv = priv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment