Jon Maloy | 30 Jul 04:40 2015
Picon

[PATCH net-next v2 00/12] More separation between link aggregation and link layer

We continue the work on separating the roles of the link aggregation and
link layers, as well as making code cleanups in general.

This second commit batch focuses on moving the orchestration of link
failover and synchronization to the node level, as well as preparing the
node lock structure for further future impovements. We also make some
changes to message delivery between link and socket layer, in order to
make this mechanism safer and less obscure.

v2: - Replaced "rc |= ..."  with " rc = ..." at several locations.
    - #5: Some improved comments in tipc_node_check_state()
    - #5 Replaced the loop skb_queue_walk_safe() in function 
         tipc_link_rcv() with a while loop. This fixes a crash. 

Jon Maloy (12):
  tipc: eliminate function tipc_link_activate()
  tipc: move all link_reset() calls to link aggregation level
  tipc: reverse call order for link_reset()->node_link_down()
  tipc: extend node FSM
  tipc: move link synch and failover to link aggregation level
  tipc: move protocol message sending away from link FSM
  tipc: merge link->exec_mode and link->state into one FSM
  tipc: move received discovery data evaluation inside node.c
  tipc: make resetting of links non-atomic
  tipc: remove implicit message delivery in node_unlock()
  tipc: use temporary, non-protected skb queue for bundle reception
  tipc: clean up link creation

 net/tipc/bearer.c   |    4 +-
 net/tipc/core.h     |    5 +
(Continue reading)

Erik Hugne | 23 Jul 13:33 2015
Picon

Node inputq handling

Hi guys.

I'm wondering if we might have a bug in how buffers on the inputq is handled
in tipc_sk_rcv:

http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/tree/net/tipc/socket.c#n1765

It says in the comment that:
"Note: may be called in multiple threads referring to the same queue"

But we are referring to data (dport) of the buffer at the head of the queue
without first atomically dequeueing that element, or dereferencing it under
lock protection.

What would happen exactly if the function is invoked concurrently on another
core?

//E

------------------------------------------------------------------------------
Ying Xue | 23 Jul 09:14 2015

[PATCH] tipc: fix the leak of tipc_link instance

Commit 8a1577c96f12 ("tipc: move link supervision timer to node
level") involves a serious side effect that link instance is not
freed after link is deleted.

Fixes: 8a1577c96f12 ("tipc: move link supervision timer to node level")
Signed-off-by: Ying Xue <ying.xue <at> windriver.com>
---
 net/tipc/link.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index b63d573..f1e177a 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
 <at>  <at>  -265,6 +265,7  <at>  <at>  void tipc_link_delete(struct tipc_link *l)
 	tipc_link_reset(l);
 	tipc_link_reset_fragments(l);
 	tipc_node_detach_link(l->owner, l);
+	kfree(l);
 }

 void tipc_link_delete_list(struct net *net, unsigned int bearer_id)
--

-- 
1.7.9.5

------------------------------------------------------------------------------
Jon Maloy | 22 Jul 03:09 2015
Picon

[PATCH net-next 00/12] More separation between link aggregation and link layer

We continue the work on separating the roles of the link aggregation and
link layers, as well as making code cleanups in general.

This second commit batch focuses on moving the orchestration of link
failover and synchronization to the node level, as well as preparing the
node lock structure for further future impovements. We also make some
changes to message delivery between link and socket layer, in order to
make this mechanism safer and less obscure.

Jon Maloy (12):
  tipc: eliminate function tipc_link_activate()
  tipc: move all link_reset() calls to link aggregation level
  tipc: reverse call order for link_reset()->node_link_down()
  tipc: extend node FSM
  tipc: move link synch and failover to link aggregation level
  tipc: move protocol message sending away from link FSM
  tipc: merge link->exec_mode and link->state into one FSM
  tipc: move received discovery data evaluation inside node.c
  tipc: make resetting of links non-atomic
  tipc: remove implicit message delivery in node_unlock()
  tipc: use temporary, non-protected skb queue for bundle reception
  tipc: clean up link creation

 net/tipc/bearer.c   |    4 +-
 net/tipc/core.h     |    5 +
 net/tipc/discover.c |  116 +-----
 net/tipc/link.c     | 1049 +++++++++++++++++++--------------------------------
 net/tipc/link.h     |   60 ++-
 net/tipc/msg.h      |   83 ++--
 net/tipc/node.c     |  655 ++++++++++++++++++++++++--------
(Continue reading)

Jon Maloy | 6 Jul 21:04 2015
Picon

[PATCH net-next v4 00/13] tipc: separate link and link aggregation layers

This is the first batch of a longer series that has two main objectives:

o Finer lock granularity during message sending and reception,
  especially regarding usage of the node spinlock.

o Better separation between the link layer implementation and the link
  aggregation layer, represented by node.c::struct tipc_node.

Hopefully these changes also make this part of the code somewhat easier
to comprehend and maintain.

v2: Commit #3: - Corrected wrong initialization of node.bclink->namedq
                 causing lockdep warning and occasional crashes.
               - Minor update of log text accrording to comment from
                 Erik Hugne.
           #4: - Corrected erroneous redisribution of active link slots,
                 causing unpredicatable behavior on all links. (In reality
                 I had already fixed this, but in a later patch outside
                 this series)

v3: Updated according to feedback from Ying.
    Commit #2: -Renamed function node_actv_link() to node_active_link()
           #4: -Introduced definition of INVALID_BEARER_ID. Renamed
                array tipc_node:actv_links to tipc_node:active_bearers.
                Improved description of this array and the changes made.
           #5: -Introduced a new commit #5, to make buffer handling
                in tipc_link_xmit() more consistent, and enable correct
                handling of return value -ENOBUFS in the next commit.
           #6: -Testing on if(!rc) instead of if (l) in tipc_node_xmit().
                Made new function tipc_bearer_xmit() outline.
(Continue reading)

Ying Xue | 6 Jul 04:46 2015

[PATCH] tipc: involve tipc_find_node_rcu routine

As "node_htable" node hash list is protected by RCU read lock on read
side, it's unnecessary to grab the reference counter of node found
from the hash list with node destination address when the process of
finding node and further operating the found node is constantly covered
under RCU read lock protection area. So, under this case, we can avoid
to grab node reference counter through introducing such a new function
called tipc_find_node_rcu().

Signed-off-by: Ying Xue <ying.xue <at> windriver.com>
---
 net/tipc/bcast.c |    7 ++-----
 net/tipc/link.c  |    3 +--
 net/tipc/node.c  |   33 ++++++++++++++++++---------------
 net/tipc/node.h  |    1 +
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 45a9cee..adadeec 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
 <at>  <at>  -342,7 +342,7  <at>  <at>  void tipc_bclink_sync_state(struct tipc_node *n, struct tipc_msg *hdr)
  */
 static void bclink_peek_nack(struct net *net, struct tipc_msg *msg)
 {
-	struct tipc_node *n_ptr = tipc_node_find(net, msg_destnode(msg));
+	struct tipc_node *n_ptr = tipc_node_find_rcu(net, msg_destnode(msg));

 	if (unlikely(!n_ptr))
 		return;
 <at>  <at>  -353,7 +353,6  <at>  <at>  static void bclink_peek_nack(struct net *net, struct tipc_msg *msg)
(Continue reading)

Jon Maloy | 26 Jun 03:05 2015
Picon

[PATCH net-next v3 00/13] tipc: separate link and link aggregation layers

This is the first batch of a longer series that has two main objectives:

o Finer lock granularity during message sending and reception,
  especially regarding usage of the node spinlock.

o Better separation between the link layer implementation and the link
  aggregation layer, represented by node.c::struct tipc_node.

Hopefully these changes also make this part of the code somewhat easier
to comprehend and maintain.

v2: Commit #3: - Corrected wrong initialization of node.bclink->namedq
                 causing lockdep warning and occasional crashes.
               - Minor update of log text accrording to comment from
                 Erik Hugne.
           #4: - Corrected erroneous redisribution of active link slots,
                 causing unpredicatable behavior on all links. (In reality
                 I had already fixed this, but in a later patch outside
                 this series)

v3: Updated according to feedback from Ying.
    Commit #2: -Renamed function node_actv_link() to node_active_link()
           #4: -Introduced definition of INVALID_BEARER_ID. Renamed
                array tipc_node:actv_links to tipc_node:active_bearers.
                Improved description of this array and the changes made.
           #5: -Introduced a new commit #5, to make buffer handling
                in tipc_link_xmit() more consistent, and enable correct
                handling of return value -ENOBUFS in the next commit.
           #6: -Testing on if(!rc) instead of if (l) in tipc_node_xmit().
                Made new function tipc_bearer_xmit() outline.
(Continue reading)

Jon Maloy | 25 Jun 22:52 2015
Picon

[PATCH net-next v2 0/3] tipc: clean up socket message reception

Despite recent improvements the message receive code in socket.c
is perceived as inconsistent and hard to follow, especially regarding
the logics for message rejection. With the commits in this series
we try to remedy this situation.

Jon Maloy (3):
  tipc: let function tipc_msg_reverse() expand header when needed
  tipc: introduce new tipc_sk_return_msg() function
  tipc: clean up socket layer message reception

 net/tipc/msg.c    |  86 +++++++-------
 net/tipc/msg.h    |   6 +-
 net/tipc/socket.c | 326 +++++++++++++++++++++++++++---------------------------
 net/tipc/socket.h |   2 +-
 4 files changed, 218 insertions(+), 202 deletions(-)

--

-- 
1.9.1

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
Jon Maloy | 22 Jun 23:08 2015
Picon

[PATCH net-next 1/1] tipc: flush broadcast backlog queue when last node is lost

Commit 05dcc5aa4dcced4f59f925625cea669e82b75519
("tipc: split link outqueue") introduced a bug to the broadcast link,
preventing the backlog queue of the said to not be cleaned up when
the last target node has been removed.

This manifests itself as a warning:

WARNING: CPU: 1 PID: 216 at net/tipc/bcast.c:633 tipc_bcbearer_send+0x249/0x270 [tipc]()
[  243.998330] Modules linked in: tipc ip6_udp_tunnel udp_tunnel
[  243.999015] CPU: 1 PID: 216 Comm: tipc Not tainted 4.1.0-rc7+ #33
[  243.999751] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[  244.000360]  ffffffffa0020673 ffff88003fbeb8c8 ffffffff8163c640 0000000000000007
[  244.001235]  0000000000000000 ffff88003fbeb908 ffffffff810528c5 ffff88003fbeb918
[  244.002179]  ffff88003fbaa890 000000000000ffff ffff88003fb71948 ffff88003f7c8600
[  244.003084] Call Trace:
[  244.003482]  [<ffffffff8163c640>] dump_stack+0x45/0x57
[  244.004014]  [<ffffffff810528c5>] warn_slowpath_common+0x85/0xc0
[  244.004765]  [<ffffffff810529a5>] warn_slowpath_null+0x15/0x20
[  244.005464]  [<ffffffffa0008519>] tipc_bcbearer_send+0x249/0x270 [tipc]
[  244.006204]  [<ffffffffa000b179>] tipc_bearer_send+0x39/0x50 [tipc]
[  244.006940]  [<ffffffffa000e95e>] tipc_link_push_packets+0x12e/0x1b0 [tipc]
[  244.007745]  [<ffffffffa0008a68>] tipc_bclink_acknowledge+0x2c8/0x310 [tipc]
[  244.008494]  [<ffffffffa0017ebb>] tipc_node_link_down+0x35b/0x370 [tipc]
[  244.009241]  [<ffffffff81642887>] ? _raw_spin_unlock_bh+0x17/0x20
[  244.009952]  [<ffffffffa000cf6c>] tipc_link_reset+0xec/0x350 [tipc]
[  244.010658]  [<ffffffffa000d1e1>] tipc_link_delete+0x11/0x40 [tipc]
[  244.011355]  [<ffffffffa000d287>] tipc_link_delete_list+0x77/0xb0 [tipc]
[  244.012069]  [<ffffffffa000a254>] bearer_disable+0x54/0xd0 [tipc]
[  244.012762]  [<ffffffffa000b4c2>] tipc_nl_bearer_disable+0x72/0xa0 [tipc]
[  244.013526]  [<ffffffff8153d8b9>] genl_family_rcv_msg+0x1c9/0x3a0
(Continue reading)

Ying Xue | 18 Jun 04:56 2015

Re: [PATCH] tipc:Make the function tipc_buf_append have a return type of bool

On 06/18/2015 10:44 AM, Nicholas Krause wrote:
> This converts the function tipc_buf_append now due to this
> particular function only returning either one or zero as
> its return value.
> 
> Signed-off-by: Nicholas Krause <xerofoify <at> gmail.com>

Acked-by: Ying Xue <ying.xue <at> windriver.com>

> ---
>  net/tipc/msg.c | 12 ++++++------
>  net/tipc/msg.h |  2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/net/tipc/msg.c b/net/tipc/msg.c
> index c3e96e8..52f2978 100644
> --- a/net/tipc/msg.c
> +++ b/net/tipc/msg.c
>  <at>  <at>  -115,9 +115,9  <at>  <at>  struct sk_buff *tipc_msg_create(uint user, uint type,
>   *            out: set when successful non-complete reassembly, otherwise NULL
>   *  <at> *buf:     in:  the buffer to append. Always defined
>   *            out: head buf after successful complete reassembly, otherwise NULL
> - * Returns 1 when reassembly complete, otherwise 0
> + * Returns true when reassembly complete, otherwise false
>   */
> -int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
> +bool tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
>  {
>  	struct sk_buff *head = *headbuf;
>  	struct sk_buff *frag = *buf;
(Continue reading)

Jon Maloy | 16 Jun 06:41 2015
Picon

[PATCH net-next 0/2] tipc: clean up socket message reception

Despite recent improvements the message receive code in socket.c
is perceived as inconsistent and hard to follow, especally regarding
the logics for message rejection. The two commmits in this series
try to remedy this situation.

Jon Maloy (2):
  tipc: let function tipc_msg_reverse() expand header when needed
  tipc: clean up socket layer message reception

 net/tipc/msg.c    |  82 ++++++++-------
 net/tipc/msg.h    |   6 +-
 net/tipc/socket.c | 303 ++++++++++++++++++++++++++++--------------------------
 net/tipc/socket.h |   2 +-
 4 files changed, 209 insertions(+), 184 deletions(-)

--

-- 
1.9.1

------------------------------------------------------------------------------

Gmane