netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] mlxsw: core: Trace EMAD errors
@ 2019-02-04 18:47 Ido Schimmel
  2019-02-04 18:47 ` [PATCH net-next 1/2] devlink: add hardware errors tracing facility Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ido Schimmel @ 2019-02-04 18:47 UTC (permalink / raw)
  To: netdev; +Cc: davem, Jiri Pirko, Nir Dotan, mlxsw, Ido Schimmel

Nir says:

This patchset adds a trace for EMAD errors to the existing EMAD payload
traces. This tracepoint is useful to track user or firmware errors during
tests execution.

Patch #1 defines the devlink tracepoint.
Patch #2 uses it for reporting mlxsw EMAD errors.

Nir Dotan (2):
  devlink: add hardware errors tracing facility
  mlxsw: core: Trace EMAD errors

 drivers/net/ethernet/mellanox/mlxsw/core.c |  6 +++-
 include/trace/events/devlink.h             | 33 ++++++++++++++++++++++
 net/core/devlink.c                         |  1 +
 3 files changed, 39 insertions(+), 1 deletion(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] devlink: add hardware errors tracing facility
  2019-02-04 18:47 [PATCH net-next 0/2] mlxsw: core: Trace EMAD errors Ido Schimmel
@ 2019-02-04 18:47 ` Ido Schimmel
  2019-02-04 18:47 ` [PATCH net-next 2/2] mlxsw: core: Trace EMAD errors Ido Schimmel
  2019-02-06 19:26 ` [PATCH net-next 0/2] " David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2019-02-04 18:47 UTC (permalink / raw)
  To: netdev; +Cc: davem, Jiri Pirko, Nir Dotan, mlxsw, Ido Schimmel

From: Nir Dotan <nird@mellanox.com>

Define a tracepoint and allow user to trace messages in case of an hardware
error code for hardware associated with devlink instance.

Signed-off-by: Nir Dotan <nird@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 include/trace/events/devlink.h | 33 +++++++++++++++++++++++++++++++++
 net/core/devlink.c             |  1 +
 2 files changed, 34 insertions(+)

diff --git a/include/trace/events/devlink.h b/include/trace/events/devlink.h
index 44acfbca1266..40705364a50f 100644
--- a/include/trace/events/devlink.h
+++ b/include/trace/events/devlink.h
@@ -46,6 +46,35 @@ TRACE_EVENT(devlink_hwmsg,
 		  (int) __entry->len, __get_dynamic_array(buf), __entry->len)
 );
 
+/*
+ * Tracepoint for devlink hardware error:
+ */
+TRACE_EVENT(devlink_hwerr,
+	TP_PROTO(const struct devlink *devlink, int err, const char *msg),
+
+	TP_ARGS(devlink, err, msg),
+
+	TP_STRUCT__entry(
+		__string(bus_name, devlink->dev->bus->name)
+		__string(dev_name, dev_name(devlink->dev))
+		__string(driver_name, devlink->dev->driver->name)
+		__field(int, err)
+		__string(msg, msg)
+		),
+
+	TP_fast_assign(
+		__assign_str(bus_name, devlink->dev->bus->name);
+		__assign_str(dev_name, dev_name(devlink->dev));
+		__assign_str(driver_name, devlink->dev->driver->name);
+		__entry->err = err;
+		__assign_str(msg, msg);
+		),
+
+	TP_printk("bus_name=%s dev_name=%s driver_name=%s err=%d %s",
+			__get_str(bus_name), __get_str(dev_name),
+			__get_str(driver_name), __entry->err, __get_str(msg))
+);
+
 #endif /* _TRACE_DEVLINK_H */
 
 /* This part must be outside protection */
@@ -64,6 +93,10 @@ static inline void trace_devlink_hwmsg(const struct devlink *devlink,
 {
 }
 
+static inline void trace_devlink_hwerr(const struct devlink *devlink,
+				       int err, const char *msg)
+{
+}
 #endif /* _TRACE_DEVLINK_H */
 
 #endif
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 52bf27491fb8..cd0d393bc62d 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -81,6 +81,7 @@ struct devlink_dpipe_header devlink_dpipe_header_ipv6 = {
 EXPORT_SYMBOL(devlink_dpipe_header_ipv6);
 
 EXPORT_TRACEPOINT_SYMBOL_GPL(devlink_hwmsg);
+EXPORT_TRACEPOINT_SYMBOL_GPL(devlink_hwerr);
 
 static LIST_HEAD(devlink_list);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] mlxsw: core: Trace EMAD errors
  2019-02-04 18:47 [PATCH net-next 0/2] mlxsw: core: Trace EMAD errors Ido Schimmel
  2019-02-04 18:47 ` [PATCH net-next 1/2] devlink: add hardware errors tracing facility Ido Schimmel
@ 2019-02-04 18:47 ` Ido Schimmel
  2019-02-06 19:26 ` [PATCH net-next 0/2] " David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2019-02-04 18:47 UTC (permalink / raw)
  To: netdev; +Cc: davem, Jiri Pirko, Nir Dotan, mlxsw, Ido Schimmel

From: Nir Dotan <nird@mellanox.com>

Trace EMAD errors returned from HW.

Signed-off-by: Nir Dotan <nird@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index ddedf8ab5b64..4f6fa515394e 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -1460,13 +1460,17 @@ static int mlxsw_reg_trans_wait(struct mlxsw_reg_trans *trans)
 	if (trans->retries)
 		dev_warn(mlxsw_core->bus_info->dev, "EMAD retries (%d/%d) (tid=%llx)\n",
 			 trans->retries, MLXSW_EMAD_MAX_RETRY, trans->tid);
-	if (err)
+	if (err) {
 		dev_err(mlxsw_core->bus_info->dev, "EMAD reg access failed (tid=%llx,reg_id=%x(%s),type=%s,status=%x(%s))\n",
 			trans->tid, trans->reg->id,
 			mlxsw_reg_id_str(trans->reg->id),
 			mlxsw_core_reg_access_type_str(trans->type),
 			trans->emad_status,
 			mlxsw_emad_op_tlv_status_str(trans->emad_status));
+		trace_devlink_hwerr(priv_to_devlink(mlxsw_core),
+				    trans->emad_status,
+				    mlxsw_emad_op_tlv_status_str(trans->emad_status));
+	}
 
 	list_del(&trans->bulk_list);
 	kfree_rcu(trans, rcu);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] mlxsw: core: Trace EMAD errors
  2019-02-04 18:47 [PATCH net-next 0/2] mlxsw: core: Trace EMAD errors Ido Schimmel
  2019-02-04 18:47 ` [PATCH net-next 1/2] devlink: add hardware errors tracing facility Ido Schimmel
  2019-02-04 18:47 ` [PATCH net-next 2/2] mlxsw: core: Trace EMAD errors Ido Schimmel
@ 2019-02-06 19:26 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-02-06 19:26 UTC (permalink / raw)
  To: idosch; +Cc: netdev, jiri, nird, mlxsw

From: Ido Schimmel <idosch@mellanox.com>
Date: Mon, 4 Feb 2019 18:47:44 +0000

> Nir says:
> 
> This patchset adds a trace for EMAD errors to the existing EMAD payload
> traces. This tracepoint is useful to track user or firmware errors during
> tests execution.
> 
> Patch #1 defines the devlink tracepoint.
> Patch #2 uses it for reporting mlxsw EMAD errors.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-06 19:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-04 18:47 [PATCH net-next 0/2] mlxsw: core: Trace EMAD errors Ido Schimmel
2019-02-04 18:47 ` [PATCH net-next 1/2] devlink: add hardware errors tracing facility Ido Schimmel
2019-02-04 18:47 ` [PATCH net-next 2/2] mlxsw: core: Trace EMAD errors Ido Schimmel
2019-02-06 19:26 ` [PATCH net-next 0/2] " David Miller

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).