<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/tipc/node.c, branch v4.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.1</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-04-02T20:27:12Z</updated>
<entry>
<title>tipc: simplify link mtu negotiation</title>
<updated>2015-04-02T20:27:12Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-04-02T13:33:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ed193ece2649c194a87a9d8470195760d367c075'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>tipc: eliminate delayed link deletion at link failover</title>
<updated>2015-04-02T20:27:12Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-04-02T13:33:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dff29b1a88524fe6afe296d6c477c491d1e02af0'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>tipc: involve reference counter for node structure</title>
<updated>2015-03-29T19:40:28Z</updated>
<author>
<name>Ying Xue</name>
<email>ying.xue@windriver.com</email>
</author>
<published>2015-03-26T10:10:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8a0f6ebe8494c5c6ccfe12264385b64c280e3241'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>tipc: fix potential deadlock when all links are reset</title>
<updated>2015-03-29T19:40:27Z</updated>
<author>
<name>Ying Xue</name>
<email>ying.xue@windriver.com</email>
</author>
<published>2015-03-26T10:10:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b952b2befb6f6b009e91f087285b9a0a6beb1cc8'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>tipc: split link outqueue</title>
<updated>2015-03-14T18:38:32Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-03-13T20:08:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05dcc5aa4dcced4f59f925625cea669e82b75519'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>tipc: nl compat add noop and remove legacy nl framework</title>
<updated>2015-02-09T21:20:49Z</updated>
<author>
<name>Richard Alpe</name>
<email>richard.alpe@ericsson.com</email>
</author>
<published>2015-02-09T08:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=22ae7cff509f3bb22caaa0003f67eeb93d338fed'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>tipc: convert legacy nl node dump to nl compat</title>
<updated>2015-02-09T21:20:49Z</updated>
<author>
<name>Richard Alpe</name>
<email>richard.alpe@ericsson.com</email>
</author>
<published>2015-02-09T08:50:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b28cb581dd0df8d8ff19151f39683f641e576ba'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>tipc: convert legacy nl link dump to nl compat</title>
<updated>2015-02-09T21:20:48Z</updated>
<author>
<name>Richard Alpe</name>
<email>richard.alpe@ericsson.com</email>
</author>
<published>2015-02-09T08:50:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=357ebdbfca0baa9a8d8d85307393e9ec3406affc'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>tipc: move and rename the legacy nl api to "nl compat"</title>
<updated>2015-02-09T21:20:47Z</updated>
<author>
<name>Richard Alpe</name>
<email>richard.alpe@ericsson.com</email>
</author>
<published>2015-02-09T08:50:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bfb3e5dd8dfd84dfd13649393abab63e43267b00'/>
<id>urn:sha1:bfb3e5dd8dfd84dfd13649393abab63e43267b00</id>
<content type='text'>
The new netlink API is no longer "v2" but rather the standard API and
the legacy API is now "nl compat". We split them into separate
start/stop and put them in different files in order to further
distinguish them.

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>
</entry>
<entry>
<title>tipc: eliminate race condition at multicast reception</title>
<updated>2015-02-06T00:00:03Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2015-02-05T13:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cb1b728096f54e7408d60fb571944bed00c5b771'/>
<id>urn:sha1:cb1b728096f54e7408d60fb571944bed00c5b771</id>
<content type='text'>
In a previous commit in this series we resolved a race problem during
unicast message reception.

Here, we resolve the same problem at multicast reception. We apply the
same technique: an input queue serializing the delivery of arriving
buffers. The main difference is that here we do it in two steps.
First, the broadcast link feeds arriving buffers into the tail of an
arrival queue, which head is consumed at the socket level, and where
destination lookup is performed. Second, if the lookup is successful,
the resulting buffer clones are fed into a second queue, the input
queue. This queue is consumed at reception in the socket just like
in the unicast case. Both queues are protected by the same lock, -the
one of the input queue.

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>
</entry>
</feed>
