mptcp: Change condition in mptcp_push_pending_frames

mptcp_next_segment will be outsourced to the modular infrastructure,
so we should no more call it directly from mptcp_push_pending_frames.

Also, it's probably not a good idea to call on mptcp_next_segment in
mptcp_push_pending_frames, which results in calling it actually twice
(the second time is in mptcp_write_xmit).

We need to move mptcp_next_segment a bit higher, because we remove the
delcaration from mptcp.h. That way we can make it static.

Acked-by: Gregory Detal <gregory.detal@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: Move call to get_available_subflow

The call to mptcp_next_segment and get_available_subflow will be merged
into one for the generic scheduler.

This patch moves the call to get_available_subflow a bit higher as well
as the rcv-buf optimization. That way the subflow-selection and rcv-buf
optimization can be implemented as part of the generic scheduler.

We add one additional check in mptcp_rcv_buf_optimization, because we do
not want to go back to subflow-selection. We just check if the current
subflow is able to send this segment.

Further, in case of tso_should_defer, we just "continue" instead of
going back to subflow-selection. That way reiterate on the while-loop.
With the new scheduler infrastructure we cannot go back to reselect and
individual subflow for a specific segment. This is all handled inside
the scheduler. mpcb->noneligible takes care of signalling to the
scheduler that this subflow should not be taken anymore.

Finally, we move the call to mptcp_find_and_set_pathmask into
__mptcp_reinject_data. This, because previously we first did the call to
mptcp_find_and_set_pathmask and then chose the subflow based on the
setted path_mask. As we merge mptcp_next_segment with
get_available_subflow into one call to the scheduler infrastructure we
cannot split this anymore. So, just call mptcp_find_and_set_pathmask in
__mptcp_reinject_data.

Acked-by: Gregory Detal <gregory.detal@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: Remove the mss_now argument from get_available_subflow

Longterm, we want to make the queuing on the subflows simpler, by
reusing tcp_write_xmit on the subflows. Queuing of segments should
simply put the segments on the subflow and call tcp_push_pending_frames.
tcp_write_xmit will then take care of the mss of the subflows.

This patch thus removes the dependency of the scheduling function
get_available_subflow from the mss and makes the call to tcp_current_mss
in mptcp_write_xmit.

Acked-by: Gregory Detal <gregory.detal@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: Group calls to mptcp_next_segment and get_available_subflow

Paving the path for the scheduler framework.
One last step before adding the scheduler framework.

Acked-by: Gregory Detal <gregory.detal@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: Add scheduler framework

No functional changes with this patch. Only the skeleton of the generic
scheduler framework.

Acked-by: Gregory Detal <gregory.detal@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: Modular scheduler

Move all functions responsible for the scheduling heuristics to
mptcp_sched.c and initialize the scheduler framework on the mpcb.

Also, instead of directly calling the functions, make a call to the
scheduler callbacks.

Acked-by: Gregory Detal <gregory.detal@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>