mptcp: correctly handle the tsq-callback-list

In mptcp_tsq_flags, we check for next_cb, if we want to add the sk to
the callback-list. Well, next_cb can well be NULL if the sk is the last
one in the list.

Then, we will create a loop in the callback-list, as mptcp_tsq_flags
will set the next_cb-pointer to the socket itself (if he is the only one
in the callback-list).

This patch fixes it, by making the callback-list a struct list_head.
That way we can check with list_empty() if the socket is inside the
callback-list. Further, we replace the mptcp_sock_destruct-stuff with a
BUG_ON(), because a socket should never ever be within the callback-list
when the refcnt becomes zero.

Reported-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: Look for shortest distance in shortcut-list

We are looking for the shortcut, who has the shortest distance to our
skb, but is after our skb. Thus, shortcut->seq > our->seq. We measure
thus the distance as shortcut->seq - our->seq.

This was not done correctly previously.

Signed-off-by: Takumi Shinkai <shinkai@net.cne.okayama-u.ac.jp>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: set req->listener to NULL

Since TFO, the listener-field of a tcp-request-sock must be set to NULL.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: Improve penalization-algorithm

Allow more frequent penalization - necessary in very high BDP
environments.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
tcp: metrics: rename tcpm_addr to tcpm_daddr

As we will add also the source-address, we rename all accesses to the
tcp-metrics address to use "daddr".

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
tcp: metrics: Add source-address to tcp-metrics

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Support mptcp ofo-queue coalescing and collapsing

When we are under memory-pressure, because the truesize/payload-ratio
has been underestimated the TCP-stack does ofo-queue coalescing to bring
the stack back into normal state.

We did not have this implemented for MPTCP.
This patch supports now ofo-queue coalescing and collapsing of the ofo
and the receive-queue. The results are really good:

In uml, setting tcp_adv_win_scale to 0, to force an underestimation,
doing an iperf-session

Before:
~250Mbps

After:
~600Mbps

And, we collapsed more than 100000 packets:
TcpExtTCPRcvCollapsed           105252

Reported-by: Nils Caspar <ncaspar@me.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>

Conflicts:
	include/net/mptcp.h
mptcp: Fix Bug#23: Correctly handle congestion-window limitations

We may encounter cwnd-limitations after choosing a subflow, because we
change tso_segs afterwards. If this happens on a DATA_FIN with data, we
might reject this segment, if tso_segs becomes bigger than 1.

This patch fixes this, by correctly handling cwnd-limitations. If the
subflow is limited, we avoid reselecting this one and choose another
subflow.

Reported-by: cjqing0925 (https://github.com/cjqing0925)
Fixes: https://github.com/multipath-tcp/mptcp/issues/23
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>