<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/infiniband/core/uverbs_cmd.c, branch linux-3.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-09-27T02:20:08Z</updated>
<entry>
<title>switch simple cases of fget_light to fdget</title>
<updated>2012-09-27T02:20:08Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2012-08-28T16:52:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2903ff019b346ab8d36ebbf54853c3aaf6590608'/>
<id>urn:sha1:2903ff019b346ab8d36ebbf54853c3aaf6590608</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>switch infinibarf users of fget() to fget_light()</title>
<updated>2012-09-27T01:10:10Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2012-08-27T16:47:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88b428d6e191affae79b5c1f4764dfdebab9fae6'/>
<id>urn:sha1:88b428d6e191affae79b5c1f4764dfdebab9fae6</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>Merge branches 'core', 'cxgb4', 'ipath', 'iser', 'lockdep', 'mlx4', 'nes', 'ocrdma', 'qib' and 'raw-qp' into for-linus</title>
<updated>2012-05-21T16:00:47Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-05-21T16:00:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc169165c82e14ea43e313f937a0a475ca97e588'/>
<id>urn:sha1:cc169165c82e14ea43e313f937a0a475ca97e588</id>
<content type='text'>
</content>
</entry>
<entry>
<title>IB/core: Add raw packet QP type</title>
<updated>2012-05-08T18:18:09Z</updated>
<author>
<name>Or Gerlitz</name>
</author>
<published>2012-03-01T10:17:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c938a616aadb621b8e26b0ac09ac13d053c7ed1c'/>
<id>urn:sha1:c938a616aadb621b8e26b0ac09ac13d053c7ed1c</id>
<content type='text'>
IB_QPT_RAW_PACKET allows applications to build a complete packet,
including L2 headers, when sending; on the receive side, the HW will
not strip any headers.

This QP type is designed for userspace direct access to Ethernet; for
example by applications that do TCP/IP themselves.  Only processes
with the NET_RAW capability are allowed to create raw packet QPs (the
name "raw packet QP" is supposed to suggest an analogy to AF_PACKET /
SOL_RAW sockets).

Signed-off-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Reviewed-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
<entry>
<title>IB/uverbs: Lock SRQ / CQ / PD objects in a consistent order</title>
<updated>2012-05-08T18:17:34Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-04-30T19:51:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5909ce545db415ae8c26e849df862e8cc1acf571'/>
<id>urn:sha1:5909ce545db415ae8c26e849df862e8cc1acf571</id>
<content type='text'>
Since XRC support was added, the uverbs code has locked SRQ, CQ and PD
objects needed during QP and SRQ creation in different orders
depending on the the code path.  This leads to the (at least
theoretical) possibility of deadlock, and triggers the lockdep splat
below.

Fix this by making sure we always lock the SRQ first, then CQs and
finally the PD.

    ======================================================
    [ INFO: possible circular locking dependency detected ]
    3.4.0-rc5+ #34 Not tainted
    -------------------------------------------------------
    ibv_srq_pingpon/2484 is trying to acquire lock:
     (SRQ-uobj){+++++.}, at: [&lt;ffffffffa00af51b&gt;] idr_read_uobj+0x2f/0x4d [ib_uverbs]

    but task is already holding lock:
     (CQ-uobj){+++++.}, at: [&lt;ffffffffa00af51b&gt;] idr_read_uobj+0x2f/0x4d [ib_uverbs]

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -&gt; #2 (CQ-uobj){+++++.}:
           [&lt;ffffffff81070fd0&gt;] lock_acquire+0xbf/0xfe
           [&lt;ffffffff81384f28&gt;] down_read+0x34/0x43
           [&lt;ffffffffa00af51b&gt;] idr_read_uobj+0x2f/0x4d [ib_uverbs]
           [&lt;ffffffffa00af542&gt;] idr_read_obj+0x9/0x19 [ib_uverbs]
           [&lt;ffffffffa00b16c3&gt;] ib_uverbs_create_qp+0x180/0x684 [ib_uverbs]
           [&lt;ffffffffa00ae3dd&gt;] ib_uverbs_write+0xb7/0xc2 [ib_uverbs]
           [&lt;ffffffff810fe47f&gt;] vfs_write+0xa7/0xee
           [&lt;ffffffff810fe65f&gt;] sys_write+0x45/0x69
           [&lt;ffffffff8138cdf9&gt;] system_call_fastpath+0x16/0x1b

    -&gt; #1 (PD-uobj){++++++}:
           [&lt;ffffffff81070fd0&gt;] lock_acquire+0xbf/0xfe
           [&lt;ffffffff81384f28&gt;] down_read+0x34/0x43
           [&lt;ffffffffa00af51b&gt;] idr_read_uobj+0x2f/0x4d [ib_uverbs]
           [&lt;ffffffffa00af542&gt;] idr_read_obj+0x9/0x19 [ib_uverbs]
           [&lt;ffffffffa00af8ad&gt;] __uverbs_create_xsrq+0x96/0x386 [ib_uverbs]
           [&lt;ffffffffa00b31b9&gt;] ib_uverbs_detach_mcast+0x1cd/0x1e6 [ib_uverbs]
           [&lt;ffffffffa00ae3dd&gt;] ib_uverbs_write+0xb7/0xc2 [ib_uverbs]
           [&lt;ffffffff810fe47f&gt;] vfs_write+0xa7/0xee
           [&lt;ffffffff810fe65f&gt;] sys_write+0x45/0x69
           [&lt;ffffffff8138cdf9&gt;] system_call_fastpath+0x16/0x1b

    -&gt; #0 (SRQ-uobj){+++++.}:
           [&lt;ffffffff81070898&gt;] __lock_acquire+0xa29/0xd06
           [&lt;ffffffff81070fd0&gt;] lock_acquire+0xbf/0xfe
           [&lt;ffffffff81384f28&gt;] down_read+0x34/0x43
           [&lt;ffffffffa00af51b&gt;] idr_read_uobj+0x2f/0x4d [ib_uverbs]
           [&lt;ffffffffa00af542&gt;] idr_read_obj+0x9/0x19 [ib_uverbs]
           [&lt;ffffffffa00b1728&gt;] ib_uverbs_create_qp+0x1e5/0x684 [ib_uverbs]
           [&lt;ffffffffa00ae3dd&gt;] ib_uverbs_write+0xb7/0xc2 [ib_uverbs]
           [&lt;ffffffff810fe47f&gt;] vfs_write+0xa7/0xee
           [&lt;ffffffff810fe65f&gt;] sys_write+0x45/0x69
           [&lt;ffffffff8138cdf9&gt;] system_call_fastpath+0x16/0x1b

    other info that might help us debug this:

    Chain exists of:
      SRQ-uobj --&gt; PD-uobj --&gt; CQ-uobj

     Possible unsafe locking scenario:

           CPU0                    CPU1
           ----                    ----
      lock(CQ-uobj);
                                   lock(PD-uobj);
                                   lock(CQ-uobj);
      lock(SRQ-uobj);

     *** DEADLOCK ***

    3 locks held by ibv_srq_pingpon/2484:
     #0:  (QP-uobj){+.+...}, at: [&lt;ffffffffa00b162c&gt;] ib_uverbs_create_qp+0xe9/0x684 [ib_uverbs]
     #1:  (PD-uobj){++++++}, at: [&lt;ffffffffa00af51b&gt;] idr_read_uobj+0x2f/0x4d [ib_uverbs]
     #2:  (CQ-uobj){+++++.}, at: [&lt;ffffffffa00af51b&gt;] idr_read_uobj+0x2f/0x4d [ib_uverbs]

    stack backtrace:
    Pid: 2484, comm: ibv_srq_pingpon Not tainted 3.4.0-rc5+ #34
    Call Trace:
     [&lt;ffffffff8137eff0&gt;] print_circular_bug+0x1f8/0x209
     [&lt;ffffffff81070898&gt;] __lock_acquire+0xa29/0xd06
     [&lt;ffffffffa00af37c&gt;] ? __idr_get_uobj+0x20/0x5e [ib_uverbs]
     [&lt;ffffffffa00af51b&gt;] ? idr_read_uobj+0x2f/0x4d [ib_uverbs]
     [&lt;ffffffff81070fd0&gt;] lock_acquire+0xbf/0xfe
     [&lt;ffffffffa00af51b&gt;] ? idr_read_uobj+0x2f/0x4d [ib_uverbs]
     [&lt;ffffffff81070eee&gt;] ? lock_release+0x166/0x189
     [&lt;ffffffff81384f28&gt;] down_read+0x34/0x43
     [&lt;ffffffffa00af51b&gt;] ? idr_read_uobj+0x2f/0x4d [ib_uverbs]
     [&lt;ffffffffa00af51b&gt;] idr_read_uobj+0x2f/0x4d [ib_uverbs]
     [&lt;ffffffffa00af542&gt;] idr_read_obj+0x9/0x19 [ib_uverbs]
     [&lt;ffffffffa00b1728&gt;] ib_uverbs_create_qp+0x1e5/0x684 [ib_uverbs]
     [&lt;ffffffff81070fec&gt;] ? lock_acquire+0xdb/0xfe
     [&lt;ffffffff81070c09&gt;] ? lock_release_non_nested+0x94/0x213
     [&lt;ffffffff810d470f&gt;] ? might_fault+0x40/0x90
     [&lt;ffffffff810d470f&gt;] ? might_fault+0x40/0x90
     [&lt;ffffffffa00ae3dd&gt;] ib_uverbs_write+0xb7/0xc2 [ib_uverbs]
     [&lt;ffffffff810fe47f&gt;] vfs_write+0xa7/0xee
     [&lt;ffffffff810ff736&gt;] ? fget_light+0x3b/0x99
     [&lt;ffffffff810fe65f&gt;] sys_write+0x45/0x69
     [&lt;ffffffff8138cdf9&gt;] system_call_fastpath+0x16/0x1b

Reported-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
<entry>
<title>IB/uverbs: Make lockdep output more readable</title>
<updated>2012-05-08T18:17:34Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-04-30T17:27:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3bea57a5fc1762a72fb9ac88b9aa9e48dcbea8bc'/>
<id>urn:sha1:3bea57a5fc1762a72fb9ac88b9aa9e48dcbea8bc</id>
<content type='text'>
Add names for our lockdep classes, so instead of having to decipher
lockdep output with mysterious names:

    Chain exists of:
      key#14 --&gt; key#11 --&gt; key#13

lockdep will give us something nicer:

    Chain exists of:
      SRQ-uobj --&gt; PD-uobj --&gt; CQ-uobj

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
<entry>
<title>RDMA/core: Fix kernel panic by always initializing qp-&gt;usecnt</title>
<updated>2012-01-27T17:20:10Z</updated>
<author>
<name>Bernd Schubert</name>
</author>
<published>2012-01-20T18:43:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e47e321a35c741ee41b67976f8c6a3a7a42bc5c0'/>
<id>urn:sha1:e47e321a35c741ee41b67976f8c6a3a7a42bc5c0</id>
<content type='text'>
We have just been investigating kernel panics related to
cq-&gt;ibcq.event_handler() completion calls.  The problem is that
ib_destroy_qp() fails with -EBUSY.

Further investigation revealed qp-&gt;usecnt is not initialized.  This
counter was introduced in linux-3.2 by commit 0e0ec7e0638e
("RDMA/core: Export ib_open_qp() to share XRC TGT QPs") but it only
gets initialized for IB_QPT_XRC_TGT, but it is checked in
ib_destroy_qp() for any QP type.

Fix this by initializing qp-&gt;usecnt for every QP we create.

Signed-off-by: Bernd Schubert &lt;bernd.schubert@itwm.fraunhofer.de&gt;
Signed-off-by: Sven Breuner &lt;sven.breuner@itwm.fraunhofer.de&gt;

[ Initialize qp-&gt;usecnt in uverbs too.  - Sean ]

Signed-off-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'cma', 'misc', 'mlx4', 'nes', 'qib' and 'uverbs' into for-next</title>
<updated>2012-01-04T17:18:20Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-01-04T17:18:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1583676d9e3f97371eaa726c4e061f9b23f43c44'/>
<id>urn:sha1:1583676d9e3f97371eaa726c4e061f9b23f43c44</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rdma/core: Fix sparse warnings</title>
<updated>2012-01-04T17:17:45Z</updated>
<author>
<name>Sean Hefty</name>
</author>
<published>2011-12-06T21:13:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c89d1bedf8b130d5b20f56a484989a19a2c2842a'/>
<id>urn:sha1:c89d1bedf8b130d5b20f56a484989a19a2c2842a</id>
<content type='text'>
Clean up sparse warnings in the rdma core layer.

Signed-off-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
<entry>
<title>IB/uverbs: Protect QP multicast list</title>
<updated>2012-01-04T04:36:48Z</updated>
<author>
<name>Eli Cohen</name>
</author>
<published>2012-01-04T04:36:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e214a0fe2b382fa302c036ecd6e6ffe99e3b9875'/>
<id>urn:sha1:e214a0fe2b382fa302c036ecd6e6ffe99e3b9875</id>
<content type='text'>
Userspace verbs multicast attach/detach operations on a QP are done
while holding the rwsem of the QP for reading.  That's not sufficient
since a reader lock allows more than one reader to acquire the
lock.  However, multicast attach/detach does list manipulation that
can corrupt the list if multiple threads run in parallel.

Fix this by acquiring the rwsem as a writer to serialize attach/detach
operations.  Add idr_write_qp() and put_qp_write() to encapsulate
this.

This fixes oops seen when running applications that perform multicast
joins/leaves.

Reported by: Mike Dubman &lt;miked@mellanox.com&gt;
Signed-off-by: Eli Cohen &lt;eli@mellanox.com&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
</content>
</entry>
</feed>
