Skip to content

Commit

Permalink
Merge branch 'tipc-socket-layer-improvements'
Browse files Browse the repository at this point in the history
Parthasarathy Bhuvaragan says:

====================
tipc: socket layer improvements

The following issues with the current socket layer hinders socket diagnostics
implementation, which led to this patch series.

1. tipc socket state is derived from multiple variables like
   sock->state, tsk->probing_state and tsk->connected. This style forces
   us to export multiple attributes to the user space, which has to be
   backward compatible.

2. Abuse of sock->state cannot be exported to user-space without
   requiring tipc specific hacks in the user-space.
   - For connection less (CL) sockets sock->state is overloaded to
     tipc state SS_READY.
   - For connection oriented (CO) listening socket sock->state is
     overloaded to tipc state SS_LISTEN.

This series is split into four:
1. Bug fixes in patch #1,2,3.
2. Minor cleanups in patch#4-5.
3. Express all tipc states using a single variable in patch#6-8.
4. Migrate the new tipc states to sk->sk_state in patch#9-16.

The figures below represents the FSM after this series:

Stream Server Listening Socket:
+-----------+       +-------------+
| TIPC_OPEN |------>| TIPC_LISTEN |
+-----------+       +-------------+

Stream Server Data Socket:
+-----------+       +------------------+
| TIPC_OPEN |------>| TIPC_ESTABLISHED |
+-----------+       +------------------+
                          ^   |
                          |   |
                          |   v
                    +--------------------+
                    | TIPC_DISCONNECTING |
                    +--------------------+

Stream Socket Client:
+-----------+       +-----------------+
| TIPC_OPEN |------>| TIPC_CONNECTING |------+
+-----------+       +-----------------+      |
                            |                |
                            |                |
                            v                |
                    +------------------+     |
                    | TIPC_ESTABLISHED |     |
                    +------------------+     |
                          ^   |              |
                          |   |              |
                          |   v              |
                    +--------------------+   |
                    | TIPC_DISCONNECTING |<--+
                    +--------------------+

NOTE:
This is just a base refractoring required for socket diagnostics.
TIPC socket diagnostics support will be introduced in a later series.

v2: - remove extra cast and parenthesis as suggested by David S. Miller in #4.
    - map new tipc state values to tcp states to address Eric Dumazet's concern,
      thus allow the usage of generic sk_* helpers. This is done in patch#10-15.
    - remove TIPC_PROBING state and replace it with probe_unacked flag in #11.
    - replace the TIPC_CLOSING state in v1 with sk_shutdown flag in #14.
    - introduce __tipc_shutdown() to avoid code duplication in #14.
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Nov 1, 2016
2 parents 169650d + f40acba commit 1c85175
Show file tree
Hide file tree
Showing 2 changed files with 242 additions and 238 deletions.
2 changes: 1 addition & 1 deletion net/tipc/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct plist;
#define TIPC_MEDIA_INFO_OFFSET 5

struct tipc_skb_cb {
void *handle;
u32 bytes_read;
struct sk_buff *tail;
bool validated;
bool wakeup_pending;
Expand Down
Loading

0 comments on commit 1c85175

Please sign in to comment.