<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [openib-general] some bugs that can be found using the gen2_basic in the contrib/m ellanox folder</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi Roland,</FONT>
</P>
<P><FONT SIZE=2>Dotan is on vacation until the end of the month, (Ami will send an update)</FONT>
<BR><FONT SIZE=2>Regarding the max qp number the main reason for the test is to see that we are in the ballpark,</FONT>
</P>
<P><FONT SIZE=2>Your point was taken and we will focus on some heavy data movement from there we will continue to some error flows</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Roland Dreier [<A HREF="mailto:rolandd@cisco.com">mailto:rolandd@cisco.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Monday, October 03, 2005 7:30 PM</FONT>
<BR><FONT SIZE=2>To: Dotan Barak</FONT>
<BR><FONT SIZE=2>Cc: openib-general@openib.org</FONT>
<BR><FONT SIZE=2>Subject: Re: [openib-general] some bugs that can be found using the gen2_basic in the contrib/m mellanox folder</FONT>
</P>
<P><FONT SIZE=2>I finally got a chance to try your tests. A few comments:</FONT>
</P>
<P><FONT SIZE=2> - Several of the tests are buggy. See the patch below at least.</FONT>
</P>
<P><FONT SIZE=2> - It would be much more useful if the COMPARE() macro printed the</FONT>
<BR><FONT SIZE=2> expected and actual value on failure.</FONT>
</P>
<P><FONT SIZE=2> - Similarly, other macros should probably also print more context.</FONT>
<BR><FONT SIZE=2> For example, in something like:</FONT>
</P>
<P><FONT SIZE=2> CHECK_PTR("ibv_create_qp", qp[i], goto cleanup);</FONT>
</P>
<P><FONT SIZE=2> I would probably want to know the value of i on failure.</FONT>
</P>
<P><FONT SIZE=2> - I don't believe some of the tests are really valid. For example,</FONT>
<BR><FONT SIZE=2> the max number of QPs doesn't have to be precisely correct -- no</FONT>
<BR><FONT SIZE=2> valid app is going to depend on being able to create exactly that</FONT>
<BR><FONT SIZE=2> number of QPs and no more.</FONT>
</P>
<P><FONT SIZE=2> - In any case, I'm not convinced that this sort of negative testing</FONT>
<BR><FONT SIZE=2> is the most valuable thing to focus on right now. I think it would</FONT>
<BR><FONT SIZE=2> be better to have regression tests of basic functionality (sends,</FONT>
<BR><FONT SIZE=2> receives, RDMA, CQ polling, etc) and stress tests before testing</FONT>
<BR><FONT SIZE=2> whether a buggy app will get the right error value when passing</FONT>
<BR><FONT SIZE=2> invalid parameters.</FONT>
</P>
<P><FONT SIZE=2> - R.</FONT>
</P>
<P><FONT SIZE=2>Index: test_cq.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- test_cq.c (revision 3639)</FONT>
<BR><FONT SIZE=2>+++ test_cq.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -106,6 +106,7 @@ int cq_2(</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> struct ibv_context *ib_cont = NULL;</FONT>
<BR><FONT SIZE=2> struct ibv_pd *pd = NULL;</FONT>
<BR><FONT SIZE=2>+ struct ibv_comp_channel *channel = NULL;</FONT>
<BR><FONT SIZE=2> struct ibv_cq *cq = NULL;</FONT>
<BR><FONT SIZE=2> struct ibv_cq *event_cq = NULL;</FONT>
<BR><FONT SIZE=2> struct ibv_qp *qp = NULL;</FONT>
<BR><FONT SIZE=2>@@ -132,8 +133,11 @@ int cq_2(</FONT>
<BR><FONT SIZE=2> pd = ibv_alloc_pd(ib_cont);</FONT>
<BR><FONT SIZE=2> CHECK_PTR("ibv_alloc_pd", pd, goto cleanup);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>+ channel = ibv_create_comp_channel(ib_cont);</FONT>
<BR><FONT SIZE=2>+ CHECK_PTR("ibv_create_comp_channel", channel, goto cleanup);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> cq_size = VL_range(rand_gen, 1, device_attr.max_cqe);</FONT>
<BR><FONT SIZE=2>- cq = ibv_create_cq(ib_cont, cq_size, (void *)&count, NULL, 0);</FONT>
<BR><FONT SIZE=2>+ cq = ibv_create_cq(ib_cont, cq_size, (void *)&count, channel, 0);</FONT>
<BR><FONT SIZE=2> CHECK_PTR("ibv_create_cq", cq, goto cleanup);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> mr_size = VL_range(rand_gen, 1, 1024); @@ -211,6 +215,7 @@ int cq_2(</FONT>
<BR><FONT SIZE=2> CHECK_MALLOC(event_count, goto cleanup);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> *event_count = 0;</FONT>
<BR><FONT SIZE=2>+ rc = ibv_get_cq_event(channel, (void *)&event_cq, (void </FONT>
<BR><FONT SIZE=2>+*)&event_count);</FONT>
<BR><FONT SIZE=2> rc = ibv_get_cq_event(NULL, (void *)&event_cq, (void *)&event_count);</FONT>
<BR><FONT SIZE=2> CHECK_VALUE("ibv_get_cq_event", rc, 0, goto cleanup);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>Index: test_hca.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- test_hca.c (revision 3639)</FONT>
<BR><FONT SIZE=2>+++ test_hca.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -230,7 +230,7 @@ int hca_5(</FONT>
<BR><FONT SIZE=2> j = port_attr.gid_tbl_len + VL_random(rand_gen, 0xFFFFFFFF - port_attr.gid_tbl_len);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> rc = ibv_query_gid(ib_cont, i, j, &gid);</FONT>
<BR><FONT SIZE=2>- CHECK_VALUE("ibv_query_gid", rc, 0, goto cleanup);</FONT>
<BR><FONT SIZE=2>+ CHECK_VALUE("ibv_query_gid", rc, -1, goto cleanup);</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> PASSED;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>@@ -239,7 +239,7 @@ int hca_5(</FONT>
<BR><FONT SIZE=2> i = VL_range(rand_gen, device_attr.phys_port_cnt + 1, 0xFF);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> rc = ibv_query_gid(ib_cont, i, j, &gid);</FONT>
<BR><FONT SIZE=2>- CHECK_VALUE("ibv_query_gid", rc, 0, goto cleanup);</FONT>
<BR><FONT SIZE=2>+ CHECK_VALUE("ibv_query_gid", rc, -1, goto cleanup);</FONT>
<BR><FONT SIZE=2> PASSED;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> test_result = 0;</FONT>
<BR><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>openib-general mailing list</FONT>
<BR><FONT SIZE=2>openib-general@openib.org</FONT>
<BR><FONT SIZE=2><A HREF="http://openib.org/mailman/listinfo/openib-general" TARGET="_blank">http://openib.org/mailman/listinfo/openib-general</A></FONT>
</P>
<P><FONT SIZE=2>To unsubscribe, please visit <A HREF="http://openib.org/mailman/listinfo/openib-general" TARGET="_blank">http://openib.org/mailman/listinfo/openib-general</A></FONT>
</P>
</BODY>
</HTML>