<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net/tipc/node.c, branch v4.2.4</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>tipc: add packet sequence number at instant of transmission</title>
<updated>2015-05-14T16:24:46+00:00</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-05-14T14:46:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dd3f9e70f59f43a5712eba9cf3ee4f1e6999540c'/>
<id>dd3f9e70f59f43a5712eba9cf3ee4f1e6999540c</id>
<content type='text'>
Currently, the packet sequence number is updated and added to each
packet at the moment a packet is added to the link backlog queue.
This is wasteful, since it forces the code to traverse the send
packet list packet by packet when adding them to the backlog queue.
It would be better to just splice the whole packet list into the
backlog queue when that is the right action to do.

In this commit, we do this change. Also, since the sequence numbers
cannot now be assigned to the packets at the moment they are added
the backlog queue, we do instead calculate and add them at the moment
of transmission, when the backlog queue has to be traversed anyway.
We do this in the function tipc_link_push_packet().

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, the packet sequence number is updated and added to each
packet at the moment a packet is added to the link backlog queue.
This is wasteful, since it forces the code to traverse the send
packet list packet by packet when adding them to the backlog queue.
It would be better to just splice the whole packet list into the
backlog queue when that is the right action to do.

In this commit, we do this change. Also, since the sequence numbers
cannot now be assigned to the packets at the moment they are added
the backlog queue, we do instead calculate and add them at the moment
of transmission, when the backlog queue has to be traversed anyway.
We do this in the function tipc_link_push_packet().

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: simplify include dependencies</title>
<updated>2015-05-14T16:24:45+00:00</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-05-14T14:46:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a6bf70f792963b32e410e5c3d2f96903265b090a'/>
<id>a6bf70f792963b32e410e5c3d2f96903265b090a</id>
<content type='text'>
When we try to add new inline functions in the code, we sometimes
run into circular include dependencies.

The main problem is that the file core.h, which really should be at
the root of the dependency chain, instead is a leaf. I.e., core.h
includes a number of header files that themselves should be allowed
to include core.h. In reality this is unnecessary, because core.h does
not need to know the full signature of any of the structs it refers to,
only their type declaration.

In this commit, we remove all dependencies from core.h towards any
other tipc header file.

As a consequence of this change, we can now move the function
tipc_own_addr(net) from addr.c to addr.h, and make it inline.

There are no functional changes in this commit.

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we try to add new inline functions in the code, we sometimes
run into circular include dependencies.

The main problem is that the file core.h, which really should be at
the root of the dependency chain, instead is a leaf. I.e., core.h
includes a number of header files that themselves should be allowed
to include core.h. In reality this is unnecessary, because core.h does
not need to know the full signature of any of the structs it refers to,
only their type declaration.

In this commit, we remove all dependencies from core.h towards any
other tipc header file.

As a consequence of this change, we can now move the function
tipc_own_addr(net) from addr.c to addr.h, and make it inline.

There are no functional changes in this commit.

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: simplify link mtu negotiation</title>
<updated>2015-04-02T20:27:12+00:00</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-04-02T13:33:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ed193ece2649c194a87a9d8470195760d367c075'/>
<id>ed193ece2649c194a87a9d8470195760d367c075</id>
<content type='text'>
When a link is being established, the two endpoints advertise their
respective interface MTU in the transmitted RESET and ACTIVATE messages.
If there is any difference, the lower of the two MTUs will be selected
for use by both endpoints.

However, as a remnant of earlier attempts to introduce TIPC level
routing. there also exists an MTU discovery mechanism. If an intermediate
node has a lower MTU than the two endpoints, they will discover this
through a bisectional approach, and finally adopt this MTU for common use.

Since there is no TIPC level routing, and probably never will be,
this mechanism doesn't make any sense, and only serves to make the
link level protocol unecessarily complex.

In this commit, we eliminate the MTU discovery algorithm,and fall back
to the simple MTU advertising approach. This change is fully backwards
compatible.

Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a link is being established, the two endpoints advertise their
respective interface MTU in the transmitted RESET and ACTIVATE messages.
If there is any difference, the lower of the two MTUs will be selected
for use by both endpoints.

However, as a remnant of earlier attempts to introduce TIPC level
routing. there also exists an MTU discovery mechanism. If an intermediate
node has a lower MTU than the two endpoints, they will discover this
through a bisectional approach, and finally adopt this MTU for common use.

Since there is no TIPC level routing, and probably never will be,
this mechanism doesn't make any sense, and only serves to make the
link level protocol unecessarily complex.

In this commit, we eliminate the MTU discovery algorithm,and fall back
to the simple MTU advertising approach. This change is fully backwards
compatible.

Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: eliminate delayed link deletion at link failover</title>
<updated>2015-04-02T20:27:12+00:00</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-04-02T13:33:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dff29b1a88524fe6afe296d6c477c491d1e02af0'/>
<id>dff29b1a88524fe6afe296d6c477c491d1e02af0</id>
<content type='text'>
When a bearer is disabled manually, all its links have to be reset
and deleted. However, if there is a remaining, parallel link ready
to take over a deleted link's traffic, we currently delay the delete
of the removed link until the failover procedure is finished. This
is because the remaining link needs to access state from the reset
link, such as the last received packet number, and any partially
reassembled buffer, in order to perform a successful failover.

In this commit, we do instead move the state data over to the new
link, so that it can fulfill the procedure autonomously, without
accessing any data on the old link. This means that we can now
proceed and delete all pertaining links immediately when a bearer
is disabled. This saves us from some unnecessary complexity in such
situations.

We also choose to change the confusing definitions CHANGEOVER_PROTOCOL,
ORIGINAL_MSG and DUPLICATE_MSG to the more descriptive TUNNEL_PROTOCOL,
FAILOVER_MSG and SYNCH_MSG respectively.

Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a bearer is disabled manually, all its links have to be reset
and deleted. However, if there is a remaining, parallel link ready
to take over a deleted link's traffic, we currently delay the delete
of the removed link until the failover procedure is finished. This
is because the remaining link needs to access state from the reset
link, such as the last received packet number, and any partially
reassembled buffer, in order to perform a successful failover.

In this commit, we do instead move the state data over to the new
link, so that it can fulfill the procedure autonomously, without
accessing any data on the old link. This means that we can now
proceed and delete all pertaining links immediately when a bearer
is disabled. This saves us from some unnecessary complexity in such
situations.

We also choose to change the confusing definitions CHANGEOVER_PROTOCOL,
ORIGINAL_MSG and DUPLICATE_MSG to the more descriptive TUNNEL_PROTOCOL,
FAILOVER_MSG and SYNCH_MSG respectively.

Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: involve reference counter for node structure</title>
<updated>2015-03-29T19:40:28+00:00</updated>
<author>
<name>Ying Xue</name>
<email>ying.xue@windriver.com</email>
</author>
<published>2015-03-26T10:10:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8a0f6ebe8494c5c6ccfe12264385b64c280e3241'/>
<id>8a0f6ebe8494c5c6ccfe12264385b64c280e3241</id>
<content type='text'>
TIPC node hash node table is protected with rcu lock on read side.
tipc_node_find() is used to look for a node object with node address
through iterating the hash node table. As the entire process of what
tipc_node_find() traverses the table is guarded with rcu read lock,
it's safe for us. However, when callers use the node object returned
by tipc_node_find(), there is no rcu read lock applied. Therefore,
this is absolutely unsafe for callers of tipc_node_find().

Now we introduce a reference counter for node structure. Before
tipc_node_find() returns node object to its caller, it first increases
the reference counter. Accordingly, after its caller used it up,
it decreases the counter again. This can prevent a node being used by
one thread from being freed by another thread.

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericson.com&gt;
Signed-off-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TIPC node hash node table is protected with rcu lock on read side.
tipc_node_find() is used to look for a node object with node address
through iterating the hash node table. As the entire process of what
tipc_node_find() traverses the table is guarded with rcu read lock,
it's safe for us. However, when callers use the node object returned
by tipc_node_find(), there is no rcu read lock applied. Therefore,
this is absolutely unsafe for callers of tipc_node_find().

Now we introduce a reference counter for node structure. Before
tipc_node_find() returns node object to its caller, it first increases
the reference counter. Accordingly, after its caller used it up,
it decreases the counter again. This can prevent a node being used by
one thread from being freed by another thread.

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericson.com&gt;
Signed-off-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: fix potential deadlock when all links are reset</title>
<updated>2015-03-29T19:40:27+00:00</updated>
<author>
<name>Ying Xue</name>
<email>ying.xue@windriver.com</email>
</author>
<published>2015-03-26T10:10:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b952b2befb6f6b009e91f087285b9a0a6beb1cc8'/>
<id>b952b2befb6f6b009e91f087285b9a0a6beb1cc8</id>
<content type='text'>
[   60.988363] ======================================================
[   60.988754] [ INFO: possible circular locking dependency detected ]
[   60.989152] 3.19.0+ #194 Not tainted
[   60.989377] -------------------------------------------------------
[   60.989781] swapper/3/0 is trying to acquire lock:
[   60.990079]  (&amp;(&amp;n_ptr-&gt;lock)-&gt;rlock){+.-...}, at: [&lt;ffffffffa0006dca&gt;] tipc_link_retransmit+0x1aa/0x240 [tipc]
[   60.990743]
[   60.990743] but task is already holding lock:
[   60.991106]  (&amp;(&amp;bclink-&gt;lock)-&gt;rlock){+.-...}, at: [&lt;ffffffffa00004be&gt;] tipc_bclink_lock+0x8e/0xa0 [tipc]
[   60.991738]
[   60.991738] which lock already depends on the new lock.
[   60.991738]
[   60.992174]
[   60.992174] the existing dependency chain (in reverse order) is:
[   60.992174]
-&gt; #1 (&amp;(&amp;bclink-&gt;lock)-&gt;rlock){+.-...}:
[   60.992174]        [&lt;ffffffff810a9c0c&gt;] lock_acquire+0x9c/0x140
[   60.992174]        [&lt;ffffffff8179c41f&gt;] _raw_spin_lock_bh+0x3f/0x50
[   60.992174]        [&lt;ffffffffa00004be&gt;] tipc_bclink_lock+0x8e/0xa0 [tipc]
[   60.992174]        [&lt;ffffffffa0000f57&gt;] tipc_bclink_add_node+0x97/0xf0 [tipc]
[   60.992174]        [&lt;ffffffffa0011815&gt;] tipc_node_link_up+0xf5/0x110 [tipc]
[   60.992174]        [&lt;ffffffffa0007783&gt;] link_state_event+0x2b3/0x4f0 [tipc]
[   60.992174]        [&lt;ffffffffa00193c0&gt;] tipc_link_proto_rcv+0x24c/0x418 [tipc]
[   60.992174]        [&lt;ffffffffa0008857&gt;] tipc_rcv+0x827/0xac0 [tipc]
[   60.992174]        [&lt;ffffffffa0002ca3&gt;] tipc_l2_rcv_msg+0x73/0xd0 [tipc]
[   60.992174]        [&lt;ffffffff81646e66&gt;] __netif_receive_skb_core+0x746/0x980
[   60.992174]        [&lt;ffffffff816470c1&gt;] __netif_receive_skb+0x21/0x70
[   60.992174]        [&lt;ffffffff81647295&gt;] netif_receive_skb_internal+0x35/0x130
[   60.992174]        [&lt;ffffffff81648218&gt;] napi_gro_receive+0x158/0x1d0
[   60.992174]        [&lt;ffffffff81559e05&gt;] e1000_clean_rx_irq+0x155/0x490
[   60.992174]        [&lt;ffffffff8155c1b7&gt;] e1000_clean+0x267/0x990
[   60.992174]        [&lt;ffffffff81647b60&gt;] net_rx_action+0x150/0x360
[   60.992174]        [&lt;ffffffff8105ec43&gt;] __do_softirq+0x123/0x360
[   60.992174]        [&lt;ffffffff8105f12e&gt;] irq_exit+0x8e/0xb0
[   60.992174]        [&lt;ffffffff8179f9f5&gt;] do_IRQ+0x65/0x110
[   60.992174]        [&lt;ffffffff8179da6f&gt;] ret_from_intr+0x0/0x13
[   60.992174]        [&lt;ffffffff8100de9f&gt;] arch_cpu_idle+0xf/0x20
[   60.992174]        [&lt;ffffffff8109dfa6&gt;] cpu_startup_entry+0x2f6/0x3f0
[   60.992174]        [&lt;ffffffff81033cda&gt;] start_secondary+0x13a/0x150
[   60.992174]
-&gt; #0 (&amp;(&amp;n_ptr-&gt;lock)-&gt;rlock){+.-...}:
[   60.992174]        [&lt;ffffffff810a8f7d&gt;] __lock_acquire+0x163d/0x1ca0
[   60.992174]        [&lt;ffffffff810a9c0c&gt;] lock_acquire+0x9c/0x140
[   60.992174]        [&lt;ffffffff8179c41f&gt;] _raw_spin_lock_bh+0x3f/0x50
[   60.992174]        [&lt;ffffffffa0006dca&gt;] tipc_link_retransmit+0x1aa/0x240 [tipc]
[   60.992174]        [&lt;ffffffffa0001e11&gt;] tipc_bclink_rcv+0x611/0x640 [tipc]
[   60.992174]        [&lt;ffffffffa0008646&gt;] tipc_rcv+0x616/0xac0 [tipc]
[   60.992174]        [&lt;ffffffffa0002ca3&gt;] tipc_l2_rcv_msg+0x73/0xd0 [tipc]
[   60.992174]        [&lt;ffffffff81646e66&gt;] __netif_receive_skb_core+0x746/0x980
[   60.992174]        [&lt;ffffffff816470c1&gt;] __netif_receive_skb+0x21/0x70
[   60.992174]        [&lt;ffffffff81647295&gt;] netif_receive_skb_internal+0x35/0x130
[   60.992174]        [&lt;ffffffff81648218&gt;] napi_gro_receive+0x158/0x1d0
[   60.992174]        [&lt;ffffffff81559e05&gt;] e1000_clean_rx_irq+0x155/0x490
[   60.992174]        [&lt;ffffffff8155c1b7&gt;] e1000_clean+0x267/0x990
[   60.992174]        [&lt;ffffffff81647b60&gt;] net_rx_action+0x150/0x360
[   60.992174]        [&lt;ffffffff8105ec43&gt;] __do_softirq+0x123/0x360
[   60.992174]        [&lt;ffffffff8105f12e&gt;] irq_exit+0x8e/0xb0
[   60.992174]        [&lt;ffffffff8179f9f5&gt;] do_IRQ+0x65/0x110
[   60.992174]        [&lt;ffffffff8179da6f&gt;] ret_from_intr+0x0/0x13
[   60.992174]        [&lt;ffffffff8100de9f&gt;] arch_cpu_idle+0xf/0x20
[   60.992174]        [&lt;ffffffff8109dfa6&gt;] cpu_startup_entry+0x2f6/0x3f0
[   60.992174]        [&lt;ffffffff81033cda&gt;] start_secondary+0x13a/0x150
[   60.992174]
[   60.992174] other info that might help us debug this:
[   60.992174]
[   60.992174]  Possible unsafe locking scenario:
[   60.992174]
[   60.992174]        CPU0                    CPU1
[   60.992174]        ----                    ----
[   60.992174]   lock(&amp;(&amp;bclink-&gt;lock)-&gt;rlock);
[   60.992174]                                lock(&amp;(&amp;n_ptr-&gt;lock)-&gt;rlock);
[   60.992174]                                lock(&amp;(&amp;bclink-&gt;lock)-&gt;rlock);
[   60.992174]   lock(&amp;(&amp;n_ptr-&gt;lock)-&gt;rlock);
[   60.992174]
[   60.992174]  *** DEADLOCK ***
[   60.992174]
[   60.992174] 3 locks held by swapper/3/0:
[   60.992174]  #0:  (rcu_read_lock){......}, at: [&lt;ffffffff81646791&gt;] __netif_receive_skb_core+0x71/0x980
[   60.992174]  #1:  (rcu_read_lock){......}, at: [&lt;ffffffffa0002c35&gt;] tipc_l2_rcv_msg+0x5/0xd0 [tipc]
[   60.992174]  #2:  (&amp;(&amp;bclink-&gt;lock)-&gt;rlock){+.-...}, at: [&lt;ffffffffa00004be&gt;] tipc_bclink_lock+0x8e/0xa0 [tipc]
[   60.992174]

The correct the sequence of grabbing n_ptr-&gt;lock and bclink-&gt;lock
should be that the former is first held and the latter is then taken,
which exactly happened on CPU1. But especially when the retransmission
of broadcast link is failed, bclink-&gt;lock is first held in
tipc_bclink_rcv(), and n_ptr-&gt;lock is taken in link_retransmit_failure()
called by tipc_link_retransmit() subsequently, which is demonstrated on
CPU0. As a result, deadlock occurs.

If the order of holding the two locks happening on CPU0 is reversed, the
deadlock risk will be relieved. Therefore, the node lock taken in
link_retransmit_failure() originally is moved to tipc_bclink_rcv()
so that it's obtained before bclink lock. But the precondition of
the adjustment of node lock is that responding to bclink reset event
must be moved from tipc_bclink_unlock() to tipc_node_unlock().

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Signed-off-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[   60.988363] ======================================================
[   60.988754] [ INFO: possible circular locking dependency detected ]
[   60.989152] 3.19.0+ #194 Not tainted
[   60.989377] -------------------------------------------------------
[   60.989781] swapper/3/0 is trying to acquire lock:
[   60.990079]  (&amp;(&amp;n_ptr-&gt;lock)-&gt;rlock){+.-...}, at: [&lt;ffffffffa0006dca&gt;] tipc_link_retransmit+0x1aa/0x240 [tipc]
[   60.990743]
[   60.990743] but task is already holding lock:
[   60.991106]  (&amp;(&amp;bclink-&gt;lock)-&gt;rlock){+.-...}, at: [&lt;ffffffffa00004be&gt;] tipc_bclink_lock+0x8e/0xa0 [tipc]
[   60.991738]
[   60.991738] which lock already depends on the new lock.
[   60.991738]
[   60.992174]
[   60.992174] the existing dependency chain (in reverse order) is:
[   60.992174]
-&gt; #1 (&amp;(&amp;bclink-&gt;lock)-&gt;rlock){+.-...}:
[   60.992174]        [&lt;ffffffff810a9c0c&gt;] lock_acquire+0x9c/0x140
[   60.992174]        [&lt;ffffffff8179c41f&gt;] _raw_spin_lock_bh+0x3f/0x50
[   60.992174]        [&lt;ffffffffa00004be&gt;] tipc_bclink_lock+0x8e/0xa0 [tipc]
[   60.992174]        [&lt;ffffffffa0000f57&gt;] tipc_bclink_add_node+0x97/0xf0 [tipc]
[   60.992174]        [&lt;ffffffffa0011815&gt;] tipc_node_link_up+0xf5/0x110 [tipc]
[   60.992174]        [&lt;ffffffffa0007783&gt;] link_state_event+0x2b3/0x4f0 [tipc]
[   60.992174]        [&lt;ffffffffa00193c0&gt;] tipc_link_proto_rcv+0x24c/0x418 [tipc]
[   60.992174]        [&lt;ffffffffa0008857&gt;] tipc_rcv+0x827/0xac0 [tipc]
[   60.992174]        [&lt;ffffffffa0002ca3&gt;] tipc_l2_rcv_msg+0x73/0xd0 [tipc]
[   60.992174]        [&lt;ffffffff81646e66&gt;] __netif_receive_skb_core+0x746/0x980
[   60.992174]        [&lt;ffffffff816470c1&gt;] __netif_receive_skb+0x21/0x70
[   60.992174]        [&lt;ffffffff81647295&gt;] netif_receive_skb_internal+0x35/0x130
[   60.992174]        [&lt;ffffffff81648218&gt;] napi_gro_receive+0x158/0x1d0
[   60.992174]        [&lt;ffffffff81559e05&gt;] e1000_clean_rx_irq+0x155/0x490
[   60.992174]        [&lt;ffffffff8155c1b7&gt;] e1000_clean+0x267/0x990
[   60.992174]        [&lt;ffffffff81647b60&gt;] net_rx_action+0x150/0x360
[   60.992174]        [&lt;ffffffff8105ec43&gt;] __do_softirq+0x123/0x360
[   60.992174]        [&lt;ffffffff8105f12e&gt;] irq_exit+0x8e/0xb0
[   60.992174]        [&lt;ffffffff8179f9f5&gt;] do_IRQ+0x65/0x110
[   60.992174]        [&lt;ffffffff8179da6f&gt;] ret_from_intr+0x0/0x13
[   60.992174]        [&lt;ffffffff8100de9f&gt;] arch_cpu_idle+0xf/0x20
[   60.992174]        [&lt;ffffffff8109dfa6&gt;] cpu_startup_entry+0x2f6/0x3f0
[   60.992174]        [&lt;ffffffff81033cda&gt;] start_secondary+0x13a/0x150
[   60.992174]
-&gt; #0 (&amp;(&amp;n_ptr-&gt;lock)-&gt;rlock){+.-...}:
[   60.992174]        [&lt;ffffffff810a8f7d&gt;] __lock_acquire+0x163d/0x1ca0
[   60.992174]        [&lt;ffffffff810a9c0c&gt;] lock_acquire+0x9c/0x140
[   60.992174]        [&lt;ffffffff8179c41f&gt;] _raw_spin_lock_bh+0x3f/0x50
[   60.992174]        [&lt;ffffffffa0006dca&gt;] tipc_link_retransmit+0x1aa/0x240 [tipc]
[   60.992174]        [&lt;ffffffffa0001e11&gt;] tipc_bclink_rcv+0x611/0x640 [tipc]
[   60.992174]        [&lt;ffffffffa0008646&gt;] tipc_rcv+0x616/0xac0 [tipc]
[   60.992174]        [&lt;ffffffffa0002ca3&gt;] tipc_l2_rcv_msg+0x73/0xd0 [tipc]
[   60.992174]        [&lt;ffffffff81646e66&gt;] __netif_receive_skb_core+0x746/0x980
[   60.992174]        [&lt;ffffffff816470c1&gt;] __netif_receive_skb+0x21/0x70
[   60.992174]        [&lt;ffffffff81647295&gt;] netif_receive_skb_internal+0x35/0x130
[   60.992174]        [&lt;ffffffff81648218&gt;] napi_gro_receive+0x158/0x1d0
[   60.992174]        [&lt;ffffffff81559e05&gt;] e1000_clean_rx_irq+0x155/0x490
[   60.992174]        [&lt;ffffffff8155c1b7&gt;] e1000_clean+0x267/0x990
[   60.992174]        [&lt;ffffffff81647b60&gt;] net_rx_action+0x150/0x360
[   60.992174]        [&lt;ffffffff8105ec43&gt;] __do_softirq+0x123/0x360
[   60.992174]        [&lt;ffffffff8105f12e&gt;] irq_exit+0x8e/0xb0
[   60.992174]        [&lt;ffffffff8179f9f5&gt;] do_IRQ+0x65/0x110
[   60.992174]        [&lt;ffffffff8179da6f&gt;] ret_from_intr+0x0/0x13
[   60.992174]        [&lt;ffffffff8100de9f&gt;] arch_cpu_idle+0xf/0x20
[   60.992174]        [&lt;ffffffff8109dfa6&gt;] cpu_startup_entry+0x2f6/0x3f0
[   60.992174]        [&lt;ffffffff81033cda&gt;] start_secondary+0x13a/0x150
[   60.992174]
[   60.992174] other info that might help us debug this:
[   60.992174]
[   60.992174]  Possible unsafe locking scenario:
[   60.992174]
[   60.992174]        CPU0                    CPU1
[   60.992174]        ----                    ----
[   60.992174]   lock(&amp;(&amp;bclink-&gt;lock)-&gt;rlock);
[   60.992174]                                lock(&amp;(&amp;n_ptr-&gt;lock)-&gt;rlock);
[   60.992174]                                lock(&amp;(&amp;bclink-&gt;lock)-&gt;rlock);
[   60.992174]   lock(&amp;(&amp;n_ptr-&gt;lock)-&gt;rlock);
[   60.992174]
[   60.992174]  *** DEADLOCK ***
[   60.992174]
[   60.992174] 3 locks held by swapper/3/0:
[   60.992174]  #0:  (rcu_read_lock){......}, at: [&lt;ffffffff81646791&gt;] __netif_receive_skb_core+0x71/0x980
[   60.992174]  #1:  (rcu_read_lock){......}, at: [&lt;ffffffffa0002c35&gt;] tipc_l2_rcv_msg+0x5/0xd0 [tipc]
[   60.992174]  #2:  (&amp;(&amp;bclink-&gt;lock)-&gt;rlock){+.-...}, at: [&lt;ffffffffa00004be&gt;] tipc_bclink_lock+0x8e/0xa0 [tipc]
[   60.992174]

The correct the sequence of grabbing n_ptr-&gt;lock and bclink-&gt;lock
should be that the former is first held and the latter is then taken,
which exactly happened on CPU1. But especially when the retransmission
of broadcast link is failed, bclink-&gt;lock is first held in
tipc_bclink_rcv(), and n_ptr-&gt;lock is taken in link_retransmit_failure()
called by tipc_link_retransmit() subsequently, which is demonstrated on
CPU0. As a result, deadlock occurs.

If the order of holding the two locks happening on CPU0 is reversed, the
deadlock risk will be relieved. Therefore, the node lock taken in
link_retransmit_failure() originally is moved to tipc_bclink_rcv()
so that it's obtained before bclink lock. But the precondition of
the adjustment of node lock is that responding to bclink reset event
must be moved from tipc_bclink_unlock() to tipc_node_unlock().

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Signed-off-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: split link outqueue</title>
<updated>2015-03-14T18:38:32+00:00</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-03-13T20:08:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=05dcc5aa4dcced4f59f925625cea669e82b75519'/>
<id>05dcc5aa4dcced4f59f925625cea669e82b75519</id>
<content type='text'>
struct tipc_link contains one single queue for outgoing packets,
where both transmitted and waiting packets are queued.

This infrastructure is hard to maintain, because we need
to keep a number of fields to keep track of which packets are
sent or unsent, and the number of packets in each category.

A lot of code becomes simpler if we split this queue into a transmission
queue, where sent/unacknowledged packets are kept, and a backlog queue,
where we keep the not yet sent packets.

In this commit we do this separation.

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
struct tipc_link contains one single queue for outgoing packets,
where both transmitted and waiting packets are queued.

This infrastructure is hard to maintain, because we need
to keep a number of fields to keep track of which packets are
sent or unsent, and the number of packets in each category.

A lot of code becomes simpler if we split this queue into a transmission
queue, where sent/unacknowledged packets are kept, and a backlog queue,
where we keep the not yet sent packets.

In this commit we do this separation.

Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: nl compat add noop and remove legacy nl framework</title>
<updated>2015-02-09T21:20:49+00:00</updated>
<author>
<name>Richard Alpe</name>
<email>richard.alpe@ericsson.com</email>
</author>
<published>2015-02-09T08:50:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=22ae7cff509f3bb22caaa0003f67eeb93d338fed'/>
<id>22ae7cff509f3bb22caaa0003f67eeb93d338fed</id>
<content type='text'>
Add TIPC_CMD_NOOP to compat layer and remove the old framework.

All legacy nl commands are now converted to the compat layer in
netlink_compat.c.

Signed-off-by: Richard Alpe &lt;richard.alpe@ericsson.com&gt;
Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add TIPC_CMD_NOOP to compat layer and remove the old framework.

All legacy nl commands are now converted to the compat layer in
netlink_compat.c.

Signed-off-by: Richard Alpe &lt;richard.alpe@ericsson.com&gt;
Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: convert legacy nl node dump to nl compat</title>
<updated>2015-02-09T21:20:49+00:00</updated>
<author>
<name>Richard Alpe</name>
<email>richard.alpe@ericsson.com</email>
</author>
<published>2015-02-09T08:50:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4b28cb581dd0df8d8ff19151f39683f641e576ba'/>
<id>4b28cb581dd0df8d8ff19151f39683f641e576ba</id>
<content type='text'>
Convert TIPC_CMD_GET_NODES to compat dumpit and remove global node
counter solely used by the legacy API.

Signed-off-by: Richard Alpe &lt;richard.alpe@ericsson.com&gt;
Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Convert TIPC_CMD_GET_NODES to compat dumpit and remove global node
counter solely used by the legacy API.

Signed-off-by: Richard Alpe &lt;richard.alpe@ericsson.com&gt;
Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tipc: convert legacy nl link dump to nl compat</title>
<updated>2015-02-09T21:20:48+00:00</updated>
<author>
<name>Richard Alpe</name>
<email>richard.alpe@ericsson.com</email>
</author>
<published>2015-02-09T08:50:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=357ebdbfca0baa9a8d8d85307393e9ec3406affc'/>
<id>357ebdbfca0baa9a8d8d85307393e9ec3406affc</id>
<content type='text'>
Convert TIPC_CMD_GET_LINKS to compat dumpit and remove global link
counter solely used by the legacy API.

Signed-off-by: Richard Alpe &lt;richard.alpe@ericsson.com&gt;
Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Convert TIPC_CMD_GET_LINKS to compat dumpit and remove global link
counter solely used by the legacy API.

Signed-off-by: Richard Alpe &lt;richard.alpe@ericsson.com&gt;
Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
