<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/infiniband/ulp, branch v4.4.73</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>IB/IPoIB: ibX: failed to create mcg debug file</title>
<updated>2017-05-20T12:27:00+00:00</updated>
<author>
<name>Shamir Rabinovitch</name>
<email>shamir.rabinovitch@oracle.com</email>
</author>
<published>2017-03-29T10:21:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1360f4301c7842854da749db73dd77e67c1c5c5b'/>
<id>1360f4301c7842854da749db73dd77e67c1c5c5b</id>
<content type='text'>
commit 771a52584096c45e4565e8aabb596eece9d73d61 upstream.

When udev renames the netdev devices, ipoib debugfs entries does not
get renamed. As a result, if subsequent probe of ipoib device reuse the
name then creating a debugfs entry for the new device would fail.

Also, moved ipoib_create_debug_files and ipoib_delete_debug_files as part
of ipoib event handling in order to avoid any race condition between these.

Fixes: 1732b0ef3b3a ([IPoIB] add path record information in debugfs)
Signed-off-by: Vijay Kumar &lt;vijay.ac.kumar@oracle.com&gt;
Signed-off-by: Shamir Rabinovitch &lt;shamir.rabinovitch@oracle.com&gt;
Reviewed-by: Mark Bloch &lt;markb@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 771a52584096c45e4565e8aabb596eece9d73d61 upstream.

When udev renames the netdev devices, ipoib debugfs entries does not
get renamed. As a result, if subsequent probe of ipoib device reuse the
name then creating a debugfs entry for the new device would fail.

Also, moved ipoib_create_debug_files and ipoib_delete_debug_files as part
of ipoib event handling in order to avoid any race condition between these.

Fixes: 1732b0ef3b3a ([IPoIB] add path record information in debugfs)
Signed-off-by: Vijay Kumar &lt;vijay.ac.kumar@oracle.com&gt;
Signed-off-by: Shamir Rabinovitch &lt;shamir.rabinovitch@oracle.com&gt;
Reviewed-by: Mark Bloch &lt;markb@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/srp: Fix race conditions related to task management</title>
<updated>2017-03-15T01:57:13+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2017-02-14T18:56:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=696255449b89af5487bce53b1a65eddedc72aeff'/>
<id>696255449b89af5487bce53b1a65eddedc72aeff</id>
<content type='text'>
commit 0a6fdbdeb1c25e31763c1fb333fa2723a7d2aba6 upstream.

Avoid that srp_process_rsp() overwrites the status information
in ch if the SRP target response timed out and processing of
another task management function has already started. Avoid that
issuing multiple task management functions concurrently triggers
list corruption. This patch prevents that the following stack
trace appears in the system log:

WARNING: CPU: 8 PID: 9269 at lib/list_debug.c:52 __list_del_entry_valid+0xbc/0xc0
list_del corruption. prev-&gt;next should be ffffc90004bb7b00, but was ffff8804052ecc68
CPU: 8 PID: 9269 Comm: sg_reset Tainted: G        W       4.10.0-rc7-dbg+ #3
Call Trace:
 dump_stack+0x68/0x93
 __warn+0xc6/0xe0
 warn_slowpath_fmt+0x4a/0x50
 __list_del_entry_valid+0xbc/0xc0
 wait_for_completion_timeout+0x12e/0x170
 srp_send_tsk_mgmt+0x1ef/0x2d0 [ib_srp]
 srp_reset_device+0x5b/0x110 [ib_srp]
 scsi_ioctl_reset+0x1c7/0x290
 scsi_ioctl+0x12a/0x420
 sd_ioctl+0x9d/0x100
 blkdev_ioctl+0x51e/0x9f0
 block_ioctl+0x38/0x40
 do_vfs_ioctl+0x8f/0x700
 SyS_ioctl+0x3c/0x70
 entry_SYSCALL_64_fastpath+0x18/0xad

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Israel Rukshin &lt;israelr@mellanox.com&gt;
Cc: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Cc: Laurence Oberman &lt;loberman@redhat.com&gt;
Cc: Steve Feeley &lt;Steve.Feeley@sandisk.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0a6fdbdeb1c25e31763c1fb333fa2723a7d2aba6 upstream.

Avoid that srp_process_rsp() overwrites the status information
in ch if the SRP target response timed out and processing of
another task management function has already started. Avoid that
issuing multiple task management functions concurrently triggers
list corruption. This patch prevents that the following stack
trace appears in the system log:

WARNING: CPU: 8 PID: 9269 at lib/list_debug.c:52 __list_del_entry_valid+0xbc/0xc0
list_del corruption. prev-&gt;next should be ffffc90004bb7b00, but was ffff8804052ecc68
CPU: 8 PID: 9269 Comm: sg_reset Tainted: G        W       4.10.0-rc7-dbg+ #3
Call Trace:
 dump_stack+0x68/0x93
 __warn+0xc6/0xe0
 warn_slowpath_fmt+0x4a/0x50
 __list_del_entry_valid+0xbc/0xc0
 wait_for_completion_timeout+0x12e/0x170
 srp_send_tsk_mgmt+0x1ef/0x2d0 [ib_srp]
 srp_reset_device+0x5b/0x110 [ib_srp]
 scsi_ioctl_reset+0x1c7/0x290
 scsi_ioctl+0x12a/0x420
 sd_ioctl+0x9d/0x100
 blkdev_ioctl+0x51e/0x9f0
 block_ioctl+0x38/0x40
 do_vfs_ioctl+0x8f/0x700
 SyS_ioctl+0x3c/0x70
 entry_SYSCALL_64_fastpath+0x18/0xad

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Israel Rukshin &lt;israelr@mellanox.com&gt;
Cc: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Cc: Laurence Oberman &lt;loberman@redhat.com&gt;
Cc: Steve Feeley &lt;Steve.Feeley@sandisk.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/srp: Avoid that duplicate responses trigger a kernel bug</title>
<updated>2017-03-15T01:57:13+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2017-02-14T18:56:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=944690cdb5f48d03842365b7359fe090d6c2b1fa'/>
<id>944690cdb5f48d03842365b7359fe090d6c2b1fa</id>
<content type='text'>
commit 6cb72bc1b40bb2c1750ee7a5ebade93bed49a5fb upstream.

After srp_process_rsp() returns there is a short time during which
the scsi_host_find_tag() call will return a pointer to the SCSI
command that is being completed. If during that time a duplicate
response is received, avoid that the following call stack appears:

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: srp_recv_done+0x450/0x6b0 [ib_srp]
Oops: 0000 [#1] SMP
CPU: 10 PID: 0 Comm: swapper/10 Not tainted 4.10.0-rc7-dbg+ #1
Call Trace:
 &lt;IRQ&gt;
 __ib_process_cq+0x4b/0xd0 [ib_core]
 ib_poll_handler+0x1d/0x70 [ib_core]
 irq_poll_softirq+0xba/0x120
 __do_softirq+0xba/0x4c0
 irq_exit+0xbe/0xd0
 smp_apic_timer_interrupt+0x38/0x50
 apic_timer_interrupt+0x90/0xa0
 &lt;/IRQ&gt;
RIP: srp_recv_done+0x450/0x6b0 [ib_srp] RSP: ffff88046f483e20

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Israel Rukshin &lt;israelr@mellanox.com&gt;
Cc: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Cc: Laurence Oberman &lt;loberman@redhat.com&gt;
Cc: Steve Feeley &lt;Steve.Feeley@sandisk.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6cb72bc1b40bb2c1750ee7a5ebade93bed49a5fb upstream.

After srp_process_rsp() returns there is a short time during which
the scsi_host_find_tag() call will return a pointer to the SCSI
command that is being completed. If during that time a duplicate
response is received, avoid that the following call stack appears:

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: srp_recv_done+0x450/0x6b0 [ib_srp]
Oops: 0000 [#1] SMP
CPU: 10 PID: 0 Comm: swapper/10 Not tainted 4.10.0-rc7-dbg+ #1
Call Trace:
 &lt;IRQ&gt;
 __ib_process_cq+0x4b/0xd0 [ib_core]
 ib_poll_handler+0x1d/0x70 [ib_core]
 irq_poll_softirq+0xba/0x120
 __do_softirq+0xba/0x4c0
 irq_exit+0xbe/0xd0
 smp_apic_timer_interrupt+0x38/0x50
 apic_timer_interrupt+0x90/0xa0
 &lt;/IRQ&gt;
RIP: srp_recv_done+0x450/0x6b0 [ib_srp] RSP: ffff88046f483e20

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Israel Rukshin &lt;israelr@mellanox.com&gt;
Cc: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Cc: Laurence Oberman &lt;loberman@redhat.com&gt;
Cc: Steve Feeley &lt;Steve.Feeley@sandisk.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/IPoIB: Add destination address when re-queue packet</title>
<updated>2017-03-15T01:57:13+00:00</updated>
<author>
<name>Erez Shitrit</name>
<email>erezsh@mellanox.com</email>
</author>
<published>2017-02-01T17:10:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bb4a21dcb6fb57892eea7c941fdfd57e55ba5dbe'/>
<id>bb4a21dcb6fb57892eea7c941fdfd57e55ba5dbe</id>
<content type='text'>
commit 2b0841766a898aba84630fb723989a77a9d3b4e6 upstream.

When sending packet to destination that was not resolved yet
via path query, the driver keeps the skb and tries to re-send it
again when the path is resolved.

But when re-sending via dev_queue_xmit the kernel doesn't call
to dev_hard_header, so IPoIB needs to keep 20 bytes in the skb
and to put the destination address inside them.

In that way the dev_start_xmit will have the correct destination,
and the driver won't take the destination from the skb-&gt;data, while
nothing exists there, which causes to packet be be dropped.

The test flow is:
1. Run the SM on remote node,
2. Restart the driver.
4. Ping some destination,
3. Observe that first ICMP request will be dropped.

Fixes: fc791b633515 ("IB/ipoib: move back IB LL address into the hard header")
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Noa Osherovich &lt;noaos@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Tested-by: Yuval Shaia &lt;yuval.shaia@oracle.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2b0841766a898aba84630fb723989a77a9d3b4e6 upstream.

When sending packet to destination that was not resolved yet
via path query, the driver keeps the skb and tries to re-send it
again when the path is resolved.

But when re-sending via dev_queue_xmit the kernel doesn't call
to dev_hard_header, so IPoIB needs to keep 20 bytes in the skb
and to put the destination address inside them.

In that way the dev_start_xmit will have the correct destination,
and the driver won't take the destination from the skb-&gt;data, while
nothing exists there, which causes to packet be be dropped.

The test flow is:
1. Run the SM on remote node,
2. Restart the driver.
4. Ping some destination,
3. Observe that first ICMP request will be dropped.

Fixes: fc791b633515 ("IB/ipoib: move back IB LL address into the hard header")
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Noa Osherovich &lt;noaos@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Tested-by: Yuval Shaia &lt;yuval.shaia@oracle.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/ipoib: Fix deadlock between rmmod and set_mode</title>
<updated>2017-03-15T01:57:13+00:00</updated>
<author>
<name>Feras Daoud</name>
<email>ferasda@mellanox.com</email>
</author>
<published>2016-12-28T12:47:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=10beca53745eff651209fbd6d8ddbbc0f46c30a4'/>
<id>10beca53745eff651209fbd6d8ddbbc0f46c30a4</id>
<content type='text'>
commit 0a0007f28304cb9fc87809c86abb80ec71317f20 upstream.

When calling set_mode from sys/fs, the call flow locks the sys/fs lock
first and then tries to lock rtnl_lock (when calling ipoib_set_mod).
On the other hand, the rmmod call flow takes the rtnl_lock first
(when calling unregister_netdev) and then tries to take the sys/fs
lock. Deadlock a-&gt;b, b-&gt;a.

The problem starts when ipoib_set_mod frees it's rtnl_lck and tries
to get it after that.

    set_mod:
    [&lt;ffffffff8104f2bd&gt;] ? check_preempt_curr+0x6d/0x90
    [&lt;ffffffff814fee8e&gt;] __mutex_lock_slowpath+0x13e/0x180
    [&lt;ffffffff81448655&gt;] ? __rtnl_unlock+0x15/0x20
    [&lt;ffffffff814fed2b&gt;] mutex_lock+0x2b/0x50
    [&lt;ffffffff81448675&gt;] rtnl_lock+0x15/0x20
    [&lt;ffffffffa02ad807&gt;] ipoib_set_mode+0x97/0x160 [ib_ipoib]
    [&lt;ffffffffa02b5f5b&gt;] set_mode+0x3b/0x80 [ib_ipoib]
    [&lt;ffffffff8134b840&gt;] dev_attr_store+0x20/0x30
    [&lt;ffffffff811f0fe5&gt;] sysfs_write_file+0xe5/0x170
    [&lt;ffffffff8117b068&gt;] vfs_write+0xb8/0x1a0
    [&lt;ffffffff8117ba81&gt;] sys_write+0x51/0x90
    [&lt;ffffffff8100b0f2&gt;] system_call_fastpath+0x16/0x1b

    rmmod:
    [&lt;ffffffff81279ffc&gt;] ? put_dec+0x10c/0x110
    [&lt;ffffffff8127a2ee&gt;] ? number+0x2ee/0x320
    [&lt;ffffffff814fe6a5&gt;] schedule_timeout+0x215/0x2e0
    [&lt;ffffffff8127cc04&gt;] ? vsnprintf+0x484/0x5f0
    [&lt;ffffffff8127b550&gt;] ? string+0x40/0x100
    [&lt;ffffffff814fe323&gt;] wait_for_common+0x123/0x180
    [&lt;ffffffff81060250&gt;] ? default_wake_function+0x0/0x20
    [&lt;ffffffff8119661e&gt;] ? ifind_fast+0x5e/0xb0
    [&lt;ffffffff814fe43d&gt;] wait_for_completion+0x1d/0x20
    [&lt;ffffffff811f2e68&gt;] sysfs_addrm_finish+0x228/0x270
    [&lt;ffffffff811f2fb3&gt;] sysfs_remove_dir+0xa3/0xf0
    [&lt;ffffffff81273f66&gt;] kobject_del+0x16/0x40
    [&lt;ffffffff8134cd14&gt;] device_del+0x184/0x1e0
    [&lt;ffffffff8144e59b&gt;] netdev_unregister_kobject+0xab/0xc0
    [&lt;ffffffff8143c05e&gt;] rollback_registered+0xae/0x130
    [&lt;ffffffff8143c102&gt;] unregister_netdevice+0x22/0x70
    [&lt;ffffffff8143c16e&gt;] unregister_netdev+0x1e/0x30
    [&lt;ffffffffa02a91b0&gt;] ipoib_remove_one+0xe0/0x120 [ib_ipoib]
    [&lt;ffffffffa01ed95f&gt;] ib_unregister_device+0x4f/0x100 [ib_core]
    [&lt;ffffffffa021f5e1&gt;] mlx4_ib_remove+0x41/0x180 [mlx4_ib]
    [&lt;ffffffffa01ab771&gt;] mlx4_remove_device+0x71/0x90 [mlx4_core]

Fixes: 862096a8bbf8 ("IB/ipoib: Add more rtnl_link_ops callbacks")
Cc: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Feras Daoud &lt;ferasda@mellanox.com&gt;
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0a0007f28304cb9fc87809c86abb80ec71317f20 upstream.

When calling set_mode from sys/fs, the call flow locks the sys/fs lock
first and then tries to lock rtnl_lock (when calling ipoib_set_mod).
On the other hand, the rmmod call flow takes the rtnl_lock first
(when calling unregister_netdev) and then tries to take the sys/fs
lock. Deadlock a-&gt;b, b-&gt;a.

The problem starts when ipoib_set_mod frees it's rtnl_lck and tries
to get it after that.

    set_mod:
    [&lt;ffffffff8104f2bd&gt;] ? check_preempt_curr+0x6d/0x90
    [&lt;ffffffff814fee8e&gt;] __mutex_lock_slowpath+0x13e/0x180
    [&lt;ffffffff81448655&gt;] ? __rtnl_unlock+0x15/0x20
    [&lt;ffffffff814fed2b&gt;] mutex_lock+0x2b/0x50
    [&lt;ffffffff81448675&gt;] rtnl_lock+0x15/0x20
    [&lt;ffffffffa02ad807&gt;] ipoib_set_mode+0x97/0x160 [ib_ipoib]
    [&lt;ffffffffa02b5f5b&gt;] set_mode+0x3b/0x80 [ib_ipoib]
    [&lt;ffffffff8134b840&gt;] dev_attr_store+0x20/0x30
    [&lt;ffffffff811f0fe5&gt;] sysfs_write_file+0xe5/0x170
    [&lt;ffffffff8117b068&gt;] vfs_write+0xb8/0x1a0
    [&lt;ffffffff8117ba81&gt;] sys_write+0x51/0x90
    [&lt;ffffffff8100b0f2&gt;] system_call_fastpath+0x16/0x1b

    rmmod:
    [&lt;ffffffff81279ffc&gt;] ? put_dec+0x10c/0x110
    [&lt;ffffffff8127a2ee&gt;] ? number+0x2ee/0x320
    [&lt;ffffffff814fe6a5&gt;] schedule_timeout+0x215/0x2e0
    [&lt;ffffffff8127cc04&gt;] ? vsnprintf+0x484/0x5f0
    [&lt;ffffffff8127b550&gt;] ? string+0x40/0x100
    [&lt;ffffffff814fe323&gt;] wait_for_common+0x123/0x180
    [&lt;ffffffff81060250&gt;] ? default_wake_function+0x0/0x20
    [&lt;ffffffff8119661e&gt;] ? ifind_fast+0x5e/0xb0
    [&lt;ffffffff814fe43d&gt;] wait_for_completion+0x1d/0x20
    [&lt;ffffffff811f2e68&gt;] sysfs_addrm_finish+0x228/0x270
    [&lt;ffffffff811f2fb3&gt;] sysfs_remove_dir+0xa3/0xf0
    [&lt;ffffffff81273f66&gt;] kobject_del+0x16/0x40
    [&lt;ffffffff8134cd14&gt;] device_del+0x184/0x1e0
    [&lt;ffffffff8144e59b&gt;] netdev_unregister_kobject+0xab/0xc0
    [&lt;ffffffff8143c05e&gt;] rollback_registered+0xae/0x130
    [&lt;ffffffff8143c102&gt;] unregister_netdevice+0x22/0x70
    [&lt;ffffffff8143c16e&gt;] unregister_netdev+0x1e/0x30
    [&lt;ffffffffa02a91b0&gt;] ipoib_remove_one+0xe0/0x120 [ib_ipoib]
    [&lt;ffffffffa01ed95f&gt;] ib_unregister_device+0x4f/0x100 [ib_core]
    [&lt;ffffffffa021f5e1&gt;] mlx4_ib_remove+0x41/0x180 [mlx4_ib]
    [&lt;ffffffffa01ab771&gt;] mlx4_remove_device+0x71/0x90 [mlx4_core]

Fixes: 862096a8bbf8 ("IB/ipoib: Add more rtnl_link_ops callbacks")
Cc: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Feras Daoud &lt;ferasda@mellanox.com&gt;
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/ipoib: move back IB LL address into the hard header</title>
<updated>2017-02-01T07:30:53+00:00</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2016-10-13T16:26:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e114e66eec3d447cd1f5b5637e30c42424313eaf'/>
<id>e114e66eec3d447cd1f5b5637e30c42424313eaf</id>
<content type='text'>
commit fc791b6335152c5278dc4a4991bcb2d329f806f9 upstream.

After the commit 9207f9d45b0a ("net: preserve IP control block
during GSO segmentation"), the GSO CB and the IPoIB CB conflict.
That destroy the IPoIB address information cached there,
causing a severe performance regression, as better described here:

http://marc.info/?l=linux-kernel&amp;m=146787279825501&amp;w=2

This change moves the data cached by the IPoIB driver from the
skb control lock into the IPoIB hard header, as done before
the commit 936d7de3d736 ("IPoIB: Stop lying about hard_header_len
and use skb-&gt;cb to stash LL addresses").
In order to avoid GRO issue, on packet reception, the IPoIB driver
stash into the skb a dummy pseudo header, so that the received
packets have actually a hard header matching the declared length.
To avoid changing the connected mode maximum mtu, the allocated
head buffer size is increased by the pseudo header length.

After this commit, IPoIB performances are back to pre-regression
value.

v2 -&gt; v3: rebased
v1 -&gt; v2: avoid changing the max mtu, increasing the head buf size

Fixes: 9207f9d45b0a ("net: preserve IP control block during GSO segmentation")
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Vasiliy Tolstov &lt;v.tolstov@selfip.ru&gt;
Cc: Nikolay Borisov &lt;n.borisov.lkml@gmail.com&gt;
Cc: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit fc791b6335152c5278dc4a4991bcb2d329f806f9 upstream.

After the commit 9207f9d45b0a ("net: preserve IP control block
during GSO segmentation"), the GSO CB and the IPoIB CB conflict.
That destroy the IPoIB address information cached there,
causing a severe performance regression, as better described here:

http://marc.info/?l=linux-kernel&amp;m=146787279825501&amp;w=2

This change moves the data cached by the IPoIB driver from the
skb control lock into the IPoIB hard header, as done before
the commit 936d7de3d736 ("IPoIB: Stop lying about hard_header_len
and use skb-&gt;cb to stash LL addresses").
In order to avoid GRO issue, on packet reception, the IPoIB driver
stash into the skb a dummy pseudo header, so that the received
packets have actually a hard header matching the declared length.
To avoid changing the connected mode maximum mtu, the allocated
head buffer size is increased by the pseudo header length.

After this commit, IPoIB performances are back to pre-regression
value.

v2 -&gt; v3: rebased
v1 -&gt; v2: avoid changing the max mtu, increasing the head buf size

Fixes: 9207f9d45b0a ("net: preserve IP control block during GSO segmentation")
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Vasiliy Tolstov &lt;v.tolstov@selfip.ru&gt;
Cc: Nikolay Borisov &lt;n.borisov.lkml@gmail.com&gt;
Cc: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/IPoIB: Remove can't use GFP_NOIO warning</title>
<updated>2017-01-26T07:23:47+00:00</updated>
<author>
<name>Kamal Heib</name>
<email>kamalh@mellanox.com</email>
</author>
<published>2016-11-10T08:16:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=aa02f29e95f3a1c0a797c950662e88c57763167b'/>
<id>aa02f29e95f3a1c0a797c950662e88c57763167b</id>
<content type='text'>
commit 0b59970e7d96edcb3c7f651d9d48e1a59af3c3b0 upstream.

Remove the warning print of "can't use of GFP_NOIO" to avoid prints in
each QP creation when devices aren't supporting IB_QP_CREATE_USE_GFP_NOIO.

This print become more annoying when the IPoIB interface is configured
to work in connected mode.

Fixes: 09b93088d750 ('IB: Add a QP creation flag to use GFP_NOIO allocations')
Signed-off-by: Kamal Heib &lt;kamalh@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Reviewed-by: Yuval Shaia &lt;yuval.shaia@oracle.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0b59970e7d96edcb3c7f651d9d48e1a59af3c3b0 upstream.

Remove the warning print of "can't use of GFP_NOIO" to avoid prints in
each QP creation when devices aren't supporting IB_QP_CREATE_USE_GFP_NOIO.

This print become more annoying when the IPoIB interface is configured
to work in connected mode.

Fixes: 09b93088d750 ('IB: Add a QP creation flag to use GFP_NOIO allocations')
Signed-off-by: Kamal Heib &lt;kamalh@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Reviewed-by: Yuval Shaia &lt;yuval.shaia@oracle.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IPoIB: Avoid reading an uninitialized member variable</title>
<updated>2017-01-09T07:07:51+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-11-21T18:21:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b13692156167666ba9bc5e30e41fe0eecd86bd0'/>
<id>7b13692156167666ba9bc5e30e41fe0eecd86bd0</id>
<content type='text'>
commit 11b642b84e8c43e8597de031678d15c08dd057bc upstream.

This patch avoids that Coverity reports the following:

    Using uninitialized value port_attr.state when calling printk

Fixes: commit 94232d9ce817 ("IPoIB: Start multicast join process only on active ports")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 11b642b84e8c43e8597de031678d15c08dd057bc upstream.

This patch avoids that Coverity reports the following:

    Using uninitialized value port_attr.state when calling printk

Fixes: commit 94232d9ce817 ("IPoIB: Start multicast join process only on active ports")
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/ipoib: Don't allow MC joins during light MC flush</title>
<updated>2016-10-07T13:23:46+00:00</updated>
<author>
<name>Alex Vesker</name>
<email>valex@mellanox.com</email>
</author>
<published>2016-09-12T06:55:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=87160fb51bc343793cc8f5f031a87f1a35aecb82'/>
<id>87160fb51bc343793cc8f5f031a87f1a35aecb82</id>
<content type='text'>
commit 344bacca8cd811809fc33a249f2738ab757d327f upstream.

This fix solves a race between light flush and on the fly joins.
Light flush doesn't set the device to down and unset IPOIB_OPER_UP
flag, this means that if while flushing we have a MC join in progress
and the QP was attached to BC MGID we can have a mismatches when
re-attaching a QP to the BC MGID.

The light flush would set the broadcast group to NULL causing an on
the fly join to rejoin and reattach to the BC MCG as well as adding
the BC MGID to the multicast list. The flush process would later on
remove the BC MGID and detach it from the QP. On the next flush
the BC MGID is present in the multicast list but not found when trying
to detach it because of the previous double attach and single detach.

[18332.714265] ------------[ cut here ]------------
[18332.717775] WARNING: CPU: 6 PID: 3767 at drivers/infiniband/core/verbs.c:280 ib_dealloc_pd+0xff/0x120 [ib_core]
...
[18332.775198] Hardware name: Red Hat KVM, BIOS Bochs 01/01/2011
[18332.779411]  0000000000000000 ffff8800b50dfbb0 ffffffff813fed47 0000000000000000
[18332.784960]  0000000000000000 ffff8800b50dfbf0 ffffffff8109add1 0000011832f58300
[18332.790547]  ffff880226a596c0 ffff880032482000 ffff880032482830 ffff880226a59280
[18332.796199] Call Trace:
[18332.798015]  [&lt;ffffffff813fed47&gt;] dump_stack+0x63/0x8c
[18332.801831]  [&lt;ffffffff8109add1&gt;] __warn+0xd1/0xf0
[18332.805403]  [&lt;ffffffff8109aebd&gt;] warn_slowpath_null+0x1d/0x20
[18332.809706]  [&lt;ffffffffa025d90f&gt;] ib_dealloc_pd+0xff/0x120 [ib_core]
[18332.814384]  [&lt;ffffffffa04f3d7c&gt;] ipoib_transport_dev_cleanup+0xfc/0x1d0 [ib_ipoib]
[18332.820031]  [&lt;ffffffffa04ed648&gt;] ipoib_ib_dev_cleanup+0x98/0x110 [ib_ipoib]
[18332.825220]  [&lt;ffffffffa04e62c8&gt;] ipoib_dev_cleanup+0x2d8/0x550 [ib_ipoib]
[18332.830290]  [&lt;ffffffffa04e656f&gt;] ipoib_uninit+0x2f/0x40 [ib_ipoib]
[18332.834911]  [&lt;ffffffff81772a8a&gt;] rollback_registered_many+0x1aa/0x2c0
[18332.839741]  [&lt;ffffffff81772bd1&gt;] rollback_registered+0x31/0x40
[18332.844091]  [&lt;ffffffff81773b18&gt;] unregister_netdevice_queue+0x48/0x80
[18332.848880]  [&lt;ffffffffa04f489b&gt;] ipoib_vlan_delete+0x1fb/0x290 [ib_ipoib]
[18332.853848]  [&lt;ffffffffa04df1cd&gt;] delete_child+0x7d/0xf0 [ib_ipoib]
[18332.858474]  [&lt;ffffffff81520c08&gt;] dev_attr_store+0x18/0x30
[18332.862510]  [&lt;ffffffff8127fe4a&gt;] sysfs_kf_write+0x3a/0x50
[18332.866349]  [&lt;ffffffff8127f4e0&gt;] kernfs_fop_write+0x120/0x170
[18332.870471]  [&lt;ffffffff81207198&gt;] __vfs_write+0x28/0xe0
[18332.874152]  [&lt;ffffffff810e09bf&gt;] ? percpu_down_read+0x1f/0x50
[18332.878274]  [&lt;ffffffff81208062&gt;] vfs_write+0xa2/0x1a0
[18332.881896]  [&lt;ffffffff812093a6&gt;] SyS_write+0x46/0xa0
[18332.885632]  [&lt;ffffffff810039b7&gt;] do_syscall_64+0x57/0xb0
[18332.889709]  [&lt;ffffffff81883321&gt;] entry_SYSCALL64_slow_path+0x25/0x25
[18332.894727] ---[ end trace 09ebbe31f831ef17 ]---

Fixes: ee1e2c82c245 ("IPoIB: Refresh paths instead of flushing them on SM change events")
Signed-off-by: Alex Vesker &lt;valex@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 344bacca8cd811809fc33a249f2738ab757d327f upstream.

This fix solves a race between light flush and on the fly joins.
Light flush doesn't set the device to down and unset IPOIB_OPER_UP
flag, this means that if while flushing we have a MC join in progress
and the QP was attached to BC MGID we can have a mismatches when
re-attaching a QP to the BC MGID.

The light flush would set the broadcast group to NULL causing an on
the fly join to rejoin and reattach to the BC MCG as well as adding
the BC MGID to the multicast list. The flush process would later on
remove the BC MGID and detach it from the QP. On the next flush
the BC MGID is present in the multicast list but not found when trying
to detach it because of the previous double attach and single detach.

[18332.714265] ------------[ cut here ]------------
[18332.717775] WARNING: CPU: 6 PID: 3767 at drivers/infiniband/core/verbs.c:280 ib_dealloc_pd+0xff/0x120 [ib_core]
...
[18332.775198] Hardware name: Red Hat KVM, BIOS Bochs 01/01/2011
[18332.779411]  0000000000000000 ffff8800b50dfbb0 ffffffff813fed47 0000000000000000
[18332.784960]  0000000000000000 ffff8800b50dfbf0 ffffffff8109add1 0000011832f58300
[18332.790547]  ffff880226a596c0 ffff880032482000 ffff880032482830 ffff880226a59280
[18332.796199] Call Trace:
[18332.798015]  [&lt;ffffffff813fed47&gt;] dump_stack+0x63/0x8c
[18332.801831]  [&lt;ffffffff8109add1&gt;] __warn+0xd1/0xf0
[18332.805403]  [&lt;ffffffff8109aebd&gt;] warn_slowpath_null+0x1d/0x20
[18332.809706]  [&lt;ffffffffa025d90f&gt;] ib_dealloc_pd+0xff/0x120 [ib_core]
[18332.814384]  [&lt;ffffffffa04f3d7c&gt;] ipoib_transport_dev_cleanup+0xfc/0x1d0 [ib_ipoib]
[18332.820031]  [&lt;ffffffffa04ed648&gt;] ipoib_ib_dev_cleanup+0x98/0x110 [ib_ipoib]
[18332.825220]  [&lt;ffffffffa04e62c8&gt;] ipoib_dev_cleanup+0x2d8/0x550 [ib_ipoib]
[18332.830290]  [&lt;ffffffffa04e656f&gt;] ipoib_uninit+0x2f/0x40 [ib_ipoib]
[18332.834911]  [&lt;ffffffff81772a8a&gt;] rollback_registered_many+0x1aa/0x2c0
[18332.839741]  [&lt;ffffffff81772bd1&gt;] rollback_registered+0x31/0x40
[18332.844091]  [&lt;ffffffff81773b18&gt;] unregister_netdevice_queue+0x48/0x80
[18332.848880]  [&lt;ffffffffa04f489b&gt;] ipoib_vlan_delete+0x1fb/0x290 [ib_ipoib]
[18332.853848]  [&lt;ffffffffa04df1cd&gt;] delete_child+0x7d/0xf0 [ib_ipoib]
[18332.858474]  [&lt;ffffffff81520c08&gt;] dev_attr_store+0x18/0x30
[18332.862510]  [&lt;ffffffff8127fe4a&gt;] sysfs_kf_write+0x3a/0x50
[18332.866349]  [&lt;ffffffff8127f4e0&gt;] kernfs_fop_write+0x120/0x170
[18332.870471]  [&lt;ffffffff81207198&gt;] __vfs_write+0x28/0xe0
[18332.874152]  [&lt;ffffffff810e09bf&gt;] ? percpu_down_read+0x1f/0x50
[18332.878274]  [&lt;ffffffff81208062&gt;] vfs_write+0xa2/0x1a0
[18332.881896]  [&lt;ffffffff812093a6&gt;] SyS_write+0x46/0xa0
[18332.885632]  [&lt;ffffffff810039b7&gt;] do_syscall_64+0x57/0xb0
[18332.889709]  [&lt;ffffffff81883321&gt;] entry_SYSCALL64_slow_path+0x25/0x25
[18332.894727] ---[ end trace 09ebbe31f831ef17 ]---

Fixes: ee1e2c82c245 ("IPoIB: Refresh paths instead of flushing them on SM change events")
Signed-off-by: Alex Vesker &lt;valex@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>IB/ipoib: Fix memory corruption in ipoib cm mode connect flow</title>
<updated>2016-10-07T13:23:46+00:00</updated>
<author>
<name>Erez Shitrit</name>
<email>erezsh@mellanox.com</email>
</author>
<published>2016-08-28T07:58:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=79b993c132a79a4eaf8a1d3489b8cced7b5adad8'/>
<id>79b993c132a79a4eaf8a1d3489b8cced7b5adad8</id>
<content type='text'>
commit 546481c2816ea3c061ee9d5658eb48070f69212e upstream.

When a new CM connection is being requested, ipoib driver copies data
from the path pointer in the CM/tx object, the path object might be
invalid at the point and memory corruption will happened later when now
the CM driver will try using that data.

The next scenario demonstrates it:
	neigh_add_path --&gt; ipoib_cm_create_tx --&gt;
	queue_work (pointer to path is in the cm/tx struct)
	#while the work is still in the queue,
	#the port goes down and causes the ipoib_flush_paths:
	ipoib_flush_paths --&gt; path_free --&gt; kfree(path)
	#at this point the work scheduled starts.
	ipoib_cm_tx_start --&gt; copy from the (invalid)path pointer:
	(memcpy(&amp;pathrec, &amp;p-&gt;path-&gt;pathrec, sizeof pathrec);)
	 -&gt; memory corruption.

To fix that the driver now starts the CM/tx connection only if that
specific path exists in the general paths database.
This check is protected with the relevant locks, and uses the gid from
the neigh member in the CM/tx object which is valid according to the ref
count that was taken by the CM/tx.

Fixes: 839fcaba35 ('IPoIB: Connected mode experimental support')
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 546481c2816ea3c061ee9d5658eb48070f69212e upstream.

When a new CM connection is being requested, ipoib driver copies data
from the path pointer in the CM/tx object, the path object might be
invalid at the point and memory corruption will happened later when now
the CM driver will try using that data.

The next scenario demonstrates it:
	neigh_add_path --&gt; ipoib_cm_create_tx --&gt;
	queue_work (pointer to path is in the cm/tx struct)
	#while the work is still in the queue,
	#the port goes down and causes the ipoib_flush_paths:
	ipoib_flush_paths --&gt; path_free --&gt; kfree(path)
	#at this point the work scheduled starts.
	ipoib_cm_tx_start --&gt; copy from the (invalid)path pointer:
	(memcpy(&amp;pathrec, &amp;p-&gt;path-&gt;pathrec, sizeof pathrec);)
	 -&gt; memory corruption.

To fix that the driver now starts the CM/tx connection only if that
specific path exists in the general paths database.
This check is protected with the relevant locks, and uses the gid from
the neigh member in the CM/tx object which is valid according to the ref
count that was taken by the CM/tx.

Fixes: 839fcaba35 ('IPoIB: Connected mode experimental support')
Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leon@kernel.org&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
