* [PATCH] opensm/osm_vl15intf.c: Fix transaction ID printing in vl15_send_mad
@ 2009-12-16 11:57 Hal Rosenstock
[not found] ` <20091216115732.GA21723-Wuw85uim5zDR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Hal Rosenstock @ 2009-12-16 11:57 UTC (permalink / raw)
To: sashak-smomgflXvOZWk0Htik3J/w
Cc: kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb, Line.Holen-xsfywfwIY+M,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
opensm/osm_vl15intf.c: Fix transaction ID printing in vl15_send_mad
Rather than reverting commit 546399c3b983cdfe7adf4bd0b179358744603478,
another alternative is to save off the transaction ID prior to
sending the MAD.
This resolves OpenSM crash when accessing fields of mad that has already
been returned to the pool.
Signed-off-by: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
diff --git a/opensm/opensm/osm_vl15intf.c b/opensm/opensm/osm_vl15intf.c
index cc3ff33..ec7dadf 100644
--- a/opensm/opensm/osm_vl15intf.c
+++ b/opensm/opensm/osm_vl15intf.c
@@ -3,6 +3,7 @@
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
* Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2009 HNR Consulting. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
@@ -57,6 +58,7 @@
static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw)
{
ib_api_status_t status;
+ ib_net64_t trans_id;
/*
Non-response-expected mads are not throttled on the wire
@@ -76,6 +78,7 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw)
cl_atomic_inc(&p_vl->p_stats->qp0_unicasts_sent);
cl_atomic_inc(&p_vl->p_stats->qp0_mads_sent);
+ trans_id = p_madw->p_mad->trans_id;
status = osm_vendor_send(osm_madw_get_bind_handle(p_madw),
p_madw, p_madw->resp_expected);
@@ -93,7 +96,7 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw)
OSM_LOG(p_vl->p_log, OSM_LOG_ERROR, "ERR 3E03: "
"MAD send failed (%s), TID 0x%" PRIx64 "\n",
- ib_get_err_str(status), cl_ntoh64(p_madw->p_mad->trans_id));
+ ib_get_err_str(status), cl_ntoh64(trans_id));
/*
The MAD was never successfully sent, so
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <20091216115732.GA21723-Wuw85uim5zDR7s880joybQ@public.gmane.org>]
* Re: [PATCH] opensm/osm_vl15intf.c: Fix transaction ID printing in vl15_send_mad [not found] ` <20091216115732.GA21723-Wuw85uim5zDR7s880joybQ@public.gmane.org> @ 2009-12-16 12:05 ` Yevgeny Kliteynik 2009-12-16 13:39 ` Sasha Khapyorsky 1 sibling, 0 replies; 3+ messages in thread From: Yevgeny Kliteynik @ 2009-12-16 12:05 UTC (permalink / raw) To: Hal Rosenstock Cc: sashak-smomgflXvOZWk0Htik3J/w, Line.Holen-xsfywfwIY+M, linux-rdma-u79uwXL29TY76Z2rM5mHXA On 16/Dec/09 13:57, Hal Rosenstock wrote: > > opensm/osm_vl15intf.c: Fix transaction ID printing in vl15_send_mad > > Rather than reverting commit 546399c3b983cdfe7adf4bd0b179358744603478, > another alternative is to save off the transaction ID prior to > sending the MAD. Right, this one is much better :) -- Yevgeny > This resolves OpenSM crash when accessing fields of mad that has already > been returned to the pool. > > Signed-off-by: Hal Rosenstock<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > diff --git a/opensm/opensm/osm_vl15intf.c b/opensm/opensm/osm_vl15intf.c > index cc3ff33..ec7dadf 100644 > --- a/opensm/opensm/osm_vl15intf.c > +++ b/opensm/opensm/osm_vl15intf.c > @@ -3,6 +3,7 @@ > * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. > * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved. > * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. > + * Copyright (c) 2009 HNR Consulting. All rights reserved. > * > * This software is available to you under a choice of one of two > * licenses. You may choose to be licensed under the terms of the GNU > @@ -57,6 +58,7 @@ > static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw) > { > ib_api_status_t status; > + ib_net64_t trans_id; > > /* > Non-response-expected mads are not throttled on the wire > @@ -76,6 +78,7 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw) > cl_atomic_inc(&p_vl->p_stats->qp0_unicasts_sent); > > cl_atomic_inc(&p_vl->p_stats->qp0_mads_sent); > + trans_id = p_madw->p_mad->trans_id; > > status = osm_vendor_send(osm_madw_get_bind_handle(p_madw), > p_madw, p_madw->resp_expected); > @@ -93,7 +96,7 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw) > > OSM_LOG(p_vl->p_log, OSM_LOG_ERROR, "ERR 3E03: " > "MAD send failed (%s), TID 0x%" PRIx64 "\n", > - ib_get_err_str(status), cl_ntoh64(p_madw->p_mad->trans_id)); > + ib_get_err_str(status), cl_ntoh64(trans_id)); > > /* > The MAD was never successfully sent, so > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] opensm/osm_vl15intf.c: Fix transaction ID printing in vl15_send_mad [not found] ` <20091216115732.GA21723-Wuw85uim5zDR7s880joybQ@public.gmane.org> 2009-12-16 12:05 ` Yevgeny Kliteynik @ 2009-12-16 13:39 ` Sasha Khapyorsky 1 sibling, 0 replies; 3+ messages in thread From: Sasha Khapyorsky @ 2009-12-16 13:39 UTC (permalink / raw) To: Hal Rosenstock Cc: kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb, Line.Holen-xsfywfwIY+M, linux-rdma-u79uwXL29TY76Z2rM5mHXA On 06:57 Wed 16 Dec , Hal Rosenstock wrote: > > opensm/osm_vl15intf.c: Fix transaction ID printing in vl15_send_mad > > Rather than reverting commit 546399c3b983cdfe7adf4bd0b179358744603478, > another alternative is to save off the transaction ID prior to > sending the MAD. > > This resolves OpenSM crash when accessing fields of mad that has already > been returned to the pool. > > Signed-off-by: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > diff --git a/opensm/opensm/osm_vl15intf.c b/opensm/opensm/osm_vl15intf.c > index cc3ff33..ec7dadf 100644 > --- a/opensm/opensm/osm_vl15intf.c > +++ b/opensm/opensm/osm_vl15intf.c > @@ -3,6 +3,7 @@ > * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. > * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved. > * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. > + * Copyright (c) 2009 HNR Consulting. All rights reserved. > * > * This software is available to you under a choice of one of two > * licenses. You may choose to be licensed under the terms of the GNU > @@ -57,6 +58,7 @@ > static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw) > { > ib_api_status_t status; > + ib_net64_t trans_id; > > /* > Non-response-expected mads are not throttled on the wire > @@ -76,6 +78,7 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw) > cl_atomic_inc(&p_vl->p_stats->qp0_unicasts_sent); > > cl_atomic_inc(&p_vl->p_stats->qp0_mads_sent); > + trans_id = p_madw->p_mad->trans_id; This variable would make any sense only in case when appropriate log level is set. I think the better way to solve it is to revert the original patch and to print transaction id inside osm_vendor_send() (there is an error message anyway) before madw is freed. Sasha > > status = osm_vendor_send(osm_madw_get_bind_handle(p_madw), > p_madw, p_madw->resp_expected); > @@ -93,7 +96,7 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw) > > OSM_LOG(p_vl->p_log, OSM_LOG_ERROR, "ERR 3E03: " > "MAD send failed (%s), TID 0x%" PRIx64 "\n", > - ib_get_err_str(status), cl_ntoh64(p_madw->p_mad->trans_id)); > + ib_get_err_str(status), cl_ntoh64(trans_id)); > > /* > The MAD was never successfully sent, so > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-16 13:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-16 11:57 [PATCH] opensm/osm_vl15intf.c: Fix transaction ID printing in vl15_send_mad Hal Rosenstock
[not found] ` <20091216115732.GA21723-Wuw85uim5zDR7s880joybQ@public.gmane.org>
2009-12-16 12:05 ` Yevgeny Kliteynik
2009-12-16 13:39 ` Sasha Khapyorsky
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox