<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/infiniband/core, branch v2.6.31</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>RDMA: Add __init/__exit macros to addr.c and cma.c</title>
<updated>2009-06-23T17:38:42+00:00</updated>
<author>
<name>Peter Huewe</name>
<email>peterhuewe@gmx.de</email>
</author>
<published>2009-06-23T17:38:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=716abb1fdf3274ac81dc404f3659cc05d8cdf606'/>
<id>716abb1fdf3274ac81dc404f3659cc05d8cdf606</id>
<content type='text'>
Add __init and __exit annotations to the module_init/module_exit
functions from drivers/infiniband/core/addr.c and cma.c.

Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Acked-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add __init and __exit annotations to the module_init/module_exit
functions from drivers/infiniband/core/addr.c and cma.c.

Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Acked-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>infiniband: remove driver_data direct access of struct device</title>
<updated>2009-06-16T04:30:26+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2009-04-30T21:43:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3f7c58a05fe4aa71983ea27959b7ad840950537e'/>
<id>3f7c58a05fe4aa71983ea27959b7ad840950537e</id>
<content type='text'>
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device.  Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.


Cc: general@lists.openfabrics.org
Cc: Roland Dreier &lt;rolandd@cisco.com&gt;
Cc: Hal Rosenstock &lt;hal.rosenstock@gmail.com&gt;
Cc: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device.  Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.


Cc: general@lists.openfabrics.org
Cc: Roland Dreier &lt;rolandd@cisco.com&gt;
Cc: Hal Rosenstock &lt;hal.rosenstock@gmail.com&gt;
Cc: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDMA/cma: Create cm id even when IB port is down</title>
<updated>2009-04-08T20:42:33+00:00</updated>
<author>
<name>Yossi Etigin</name>
<email>root@voltaire.com</email>
</author>
<published>2009-04-08T20:42:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d2ca39f262806aa2f035f680a14aa55ff9e3d889'/>
<id>d2ca39f262806aa2f035f680a14aa55ff9e3d889</id>
<content type='text'>
When doing rdma_resolve_addr(), if the relevant IB port is down, the
function fails and the cm_id is not bound to the correct device.
Therefore, application does not have a device handle and cannot wait
for the port to become active.  The function fails because the
underlying IPoIB interface is not joined to the broadcast group and
therefore the SA does not have a multicast record to take a Q_Key
from.

The fix is to use lazy Q_Key resolution - cma_set_qkey() will set
id_priv-&gt;qkey if it was not set, and will be called just before the
Q_Key is really required.

Signed-off-by: Yossi Etigin &lt;yosefe@voltaire.com&gt;
Acked-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When doing rdma_resolve_addr(), if the relevant IB port is down, the
function fails and the cm_id is not bound to the correct device.
Therefore, application does not have a device handle and cannot wait
for the port to become active.  The function fails because the
underlying IPoIB interface is not joined to the broadcast group and
therefore the SA does not have a multicast record to take a Q_Key
from.

The fix is to use lazy Q_Key resolution - cma_set_qkey() will set
id_priv-&gt;qkey if it was not set, and will be called just before the
Q_Key is really required.

Signed-off-by: Yossi Etigin &lt;yosefe@voltaire.com&gt;
Acked-by: Sean Hefty &lt;sean.hefty@intel.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RDMA/cma: Use rate from IPoIB broadcast when joining IPoIB multicast groups</title>
<updated>2009-04-01T20:55:32+00:00</updated>
<author>
<name>Yossi Etigin</name>
<email>yosefe@Voltaire.COM</email>
</author>
<published>2009-04-01T20:55:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=84adeee9aaa0d81712de1e0ea74caed3398e4a1d'/>
<id>84adeee9aaa0d81712de1e0ea74caed3398e4a1d</id>
<content type='text'>
When joining an IPoIB multicast group, use the same rate as in the
broadcast group.  Otherwise, if the RDMA CM creates this group before
IPoIB does, it might get a different rate.  This will cause IPoIB to
fail joining to the same group later on, because IPoIB uses strict
rate selection.

Signed-off-by: Yossi Etigin &lt;yosefe@voltaire.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When joining an IPoIB multicast group, use the same rate as in the
broadcast group.  Otherwise, if the RDMA CM creates this group before
IPoIB does, it might get a different rate.  This will cause IPoIB to
fail joining to the same group later on, because IPoIB uses strict
rate selection.

Signed-off-by: Yossi Etigin &lt;yosefe@voltaire.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branches 'cxgb3', 'endian', 'ipath', 'ipoib', 'iser', 'mad', 'misc', 'mlx4', 'mthca', 'nes' and 'sysfs' into for-next</title>
<updated>2009-03-25T03:44:41+00:00</updated>
<author>
<name>Roland Dreier</name>
<email>rolandd@cisco.com</email>
</author>
<published>2009-03-25T03:44:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=09f98bafea792644f2dea39eb080aa57d854f5b3'/>
<id>09f98bafea792644f2dea39eb080aa57d854f5b3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>IB: Remove useless ibdev_is_alive() tests from sysfs code</title>
<updated>2009-03-04T23:22:39+00:00</updated>
<author>
<name>Roland Dreier</name>
<email>rolandd@cisco.com</email>
</author>
<published>2009-03-04T23:22:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6432f366842c78d17b2df974c68f39cb5794f2c2'/>
<id>6432f366842c78d17b2df974c68f39cb5794f2c2</id>
<content type='text'>
Some attribute show functions test ibdev_is_alive() to make sure that
it's OK to access device state.  However, the sysfs attributes will
not be registered until the device is fully initialized, and they'll
be unregistered before anything is torn down, so ibdev_is_alive()
doesn't do anything useful.  Remove it.

Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some attribute show functions test ibdev_is_alive() to make sure that
it's OK to access device state.  However, the sysfs attributes will
not be registered until the device is fully initialized, and they'll
be unregistered before anything is torn down, so ibdev_is_alive()
doesn't do anything useful.  Remove it.

Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/sa_query: Fix AH leak due to update_sm_ah() race</title>
<updated>2009-03-03T22:30:01+00:00</updated>
<author>
<name>Jack Morgenstein</name>
<email>jackm@dev.mellanox.co.il</email>
</author>
<published>2009-03-03T22:30:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6b708b3dde0ab3a10a0eea7774c1d6482f32f587'/>
<id>6b708b3dde0ab3a10a0eea7774c1d6482f32f587</id>
<content type='text'>
Our testing uncovered a race condition in ib_sa_event():

	spin_lock_irqsave(&amp;port-&gt;ah_lock, flags);
	if (port-&gt;sm_ah)
		kref_put(&amp;port-&gt;sm_ah-&gt;ref, free_sm_ah);
	port-&gt;sm_ah = NULL;
	spin_unlock_irqrestore(&amp;port-&gt;ah_lock, flags);

	schedule_work(&amp;sa_dev-&gt;port[event-&gt;element.port_num -
				    sa_dev-&gt;start_port].update_task);

If two events occur back-to-back (e.g., client-reregister and LID
change), both may pass the spinlock-protected code above before the
scheduled work updates the port-&gt;sm_ah handle.  Then if the scheduled
work ends up running twice, the second operation will then find a
non-NULL port-&gt;sm_ah, and will simply overwrite it in update_sm_ah --
resulting in an AH leak.

Signed-off-by: Jack Morgenstein &lt;jackm@dev.mellanox.co.il&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Our testing uncovered a race condition in ib_sa_event():

	spin_lock_irqsave(&amp;port-&gt;ah_lock, flags);
	if (port-&gt;sm_ah)
		kref_put(&amp;port-&gt;sm_ah-&gt;ref, free_sm_ah);
	port-&gt;sm_ah = NULL;
	spin_unlock_irqrestore(&amp;port-&gt;ah_lock, flags);

	schedule_work(&amp;sa_dev-&gt;port[event-&gt;element.port_num -
				    sa_dev-&gt;start_port].update_task);

If two events occur back-to-back (e.g., client-reregister and LID
change), both may pass the spinlock-protected code above before the
scheduled work updates the port-&gt;sm_ah handle.  Then if the scheduled
work ends up running twice, the second operation will then find a
non-NULL port-&gt;sm_ah, and will simply overwrite it in update_sm_ah --
resulting in an AH leak.

Signed-off-by: Jack Morgenstein &lt;jackm@dev.mellanox.co.il&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mad: Fix ib_post_send_mad() returning 0 with no generate send comp</title>
<updated>2009-03-03T22:22:17+00:00</updated>
<author>
<name>Ralph Campbell</name>
<email>ralph.campbell@qlogic.com</email>
</author>
<published>2009-03-03T22:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4780c1953f9bef07365b13af01ae4e8238ecd3de'/>
<id>4780c1953f9bef07365b13af01ae4e8238ecd3de</id>
<content type='text'>
If ib_post_send_mad() returns 0, the API guarantees that there will be
a callback to send_buf-&gt;mad_agent-&gt;send_handler() so that the sender
can call ib_free_send_mad().  Otherwise, the ib_mad_send_buf will be
leaked and the mad_agent reference count will never go to zero and the
IB device module cannot be unloaded.  The above can happen without
this patch if process_mad() returns (IB_MAD_RESULT_SUCCESS |
IB_MAD_RESULT_CONSUMED).

If process_mad() returns IB_MAD_RESULT_SUCCESS and there is no agent
registered to receive the mad being sent, handle_outgoing_dr_smp()
returns zero which causes a MAD packet which is at the end of the
directed route to be incorrectly sent on the wire but doesn't cause a
hang since the HCA generates a send completion.

Signed-off-by: Ralph Campbell &lt;ralph.campbell@qlogic.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If ib_post_send_mad() returns 0, the API guarantees that there will be
a callback to send_buf-&gt;mad_agent-&gt;send_handler() so that the sender
can call ib_free_send_mad().  Otherwise, the ib_mad_send_buf will be
leaked and the mad_agent reference count will never go to zero and the
IB device module cannot be unloaded.  The above can happen without
this patch if process_mad() returns (IB_MAD_RESULT_SUCCESS |
IB_MAD_RESULT_CONSUMED).

If process_mad() returns IB_MAD_RESULT_SUCCESS and there is no agent
registered to receive the mad being sent, handle_outgoing_dr_smp()
returns zero which causes a MAD packet which is at the end of the
directed route to be incorrectly sent on the wire but doesn't cause a
hang since the HCA generates a send completion.

Signed-off-by: Ralph Campbell &lt;ralph.campbell@qlogic.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mad: initialize mad_agent_priv before putting on lists</title>
<updated>2009-02-27T22:44:32+00:00</updated>
<author>
<name>Ralph Campbell</name>
<email>ralph.campbell@qlogic.com</email>
</author>
<published>2009-02-27T22:44:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d9620a4c82c61a91c9313f80ba951c902573c028'/>
<id>d9620a4c82c61a91c9313f80ba951c902573c028</id>
<content type='text'>
There is a potential race in ib_register_mad_agent() where the struct
ib_mad_agent_private is not fully initialized before it is added to
the list of agents per IB port. This means the ib_mad_agent_private
could be seen before the refcount, spin locks, and linked lists are
initialized.  The fix is to initialize the structure earlier.

Signed-off-by: Ralph Campbell &lt;ralph.campbell@qlogic.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a potential race in ib_register_mad_agent() where the struct
ib_mad_agent_private is not fully initialized before it is added to
the list of agents per IB port. This means the ib_mad_agent_private
could be seen before the refcount, spin locks, and linked lists are
initialized.  The fix is to initialize the structure earlier.

Signed-off-by: Ralph Campbell &lt;ralph.campbell@qlogic.com&gt;
Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IB/mad: Fix null pointer dereference in local_completions()</title>
<updated>2009-02-27T18:34:30+00:00</updated>
<author>
<name>Ralph Campbell</name>
<email>ralph.campbell@qlogic.com</email>
</author>
<published>2009-02-27T18:34:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1d9bc6d648ece77ffb41c5a577eab81fac5ad4de'/>
<id>1d9bc6d648ece77ffb41c5a577eab81fac5ad4de</id>
<content type='text'>
handle_outgoing_dr_smp() can queue a struct ib_mad_local_private
*local on the mad_agent_priv-&gt;local_work work queue with
local-&gt;mad_priv == NULL if device-&gt;process_mad() returns
IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY and
(!ib_response_mad(&amp;mad_priv-&gt;mad.mad) ||
!mad_agent_priv-&gt;agent.recv_handler).

In this case, local_completions() will be called with local-&gt;mad_priv
== NULL. The code does check for this case and skips calling
recv_mad_agent-&gt;agent.recv_handler() but recv == 0 so
kmem_cache_free() is called with a NULL pointer.

Also, since recv isn't reinitialized each time through the loop, it
can cause a memory leak if recv should have been zero.

Signed-off-by: Ralph Campbell &lt;ralph.campbell@qlogic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
handle_outgoing_dr_smp() can queue a struct ib_mad_local_private
*local on the mad_agent_priv-&gt;local_work work queue with
local-&gt;mad_priv == NULL if device-&gt;process_mad() returns
IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY and
(!ib_response_mad(&amp;mad_priv-&gt;mad.mad) ||
!mad_agent_priv-&gt;agent.recv_handler).

In this case, local_completions() will be called with local-&gt;mad_priv
== NULL. The code does check for this case and skips calling
recv_mad_agent-&gt;agent.recv_handler() but recv == 0 so
kmem_cache_free() is called with a NULL pointer.

Also, since recv isn't reinitialized each time through the loop, it
can cause a memory leak if recv should have been zero.

Signed-off-by: Ralph Campbell &lt;ralph.campbell@qlogic.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
