<br><br>
<div class="gmail_quote">On Wed, Jul 29, 2009 at 3:15 PM, Roland Dreier <span dir="ltr"><<a href="mailto:rdreier@cisco.com">rdreier@cisco.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im"><br> > Based on the spec limiting hop pointer to 255 and not 63, I think the<br> > above should just be a check on hop count and not hop pointer:<br> >             if (hop_cnt >= IB_SMP_MAX_PATH_HOPS)<br>
<br></div>Yes, it seems that the current code then properly checks hop_ptr against<br>hop_cnt in all cases.  Do we all agree that the following patch is<br>right?  If so I'll queue it for 2.6.32:<br><br> drivers/infiniband/core/smi.c |    4 ++++<br>
 1 files changed, 4 insertions(+), 0 deletions(-)<br>
<div class="im"><br>diff --git a/drivers/infiniband/core/smi.c b/drivers/infiniband/core/smi.c<br></div>index 8723675..a10152d 100644<br>
<div class="im">--- a/drivers/infiniband/core/smi.c<br>+++ b/drivers/infiniband/core/smi.c<br></div>@@ -52,6 +52,10 @@ enum smi_action smi_handle_dr_smp_send(struct ib_smp *smp,<br>
<div class="im">       hop_cnt = smp->hop_cnt;<br><br></div>
<div class="im">       /* See section 14.2.2.2, Vol 1 IB spec */<br></div>+       /* C14-6 -- valid hop_cnt values are from 0 to 63 */<br>+       if (hop_cnt >= IB_SMP_MAX_PATH_HOPS)<br>+               return IB_SMI_DISCARD;<br>

<div class="im">+<br>       if (!ib_get_smp_direction(smp)) {<br></div>               /* C14-9:1 */<br>               if (hop_cnt && hop_ptr == 0) {<br></blockquote>
<div> </div>
<div>That looks right to me on the send side. Shouldn't there be the same check on the recv side (smi_handle_dr_smp_recv) which was the intent of Roel's original patch ?</div>
<div> </div>
<div>-- Hal</div>
<div> </div></div>