mbox series

[0/3] mptcp: netlink event fixes

Message ID 20210202174754.6861-1-fw@strlen.de
Headers show
Series mptcp: netlink event fixes | expand

Message

Florian Westphal Feb. 2, 2021, 5:47 p.m. UTC
While testing upcoming mptcp reset option support i found a few
issues with netlink events.

1. When remote side is closing, the subflow close event will
be delayed until after the mptcp socket has shut down.

Schedule the worker to do a cleanup scan to avoid this.

2. When the mptcp socket is closing we can avoid sending
   individual 'subflow is closing' events; entire connection
   is going down so might as well wait for the normal mptcp-level
   close event.

3. Move the subflow close loop after dead check.
   This is not a fix, it would be fine to leave things as-is
   if you prefer -- its just that the extra conn_list walk
   can be avoided if the msk is already dead.

Florian Westphal (3):
  mptcp: schedule worker when subflow is closed
  mptcp: skip MPTCP_EVENT_SUB_CLOSED event when mptcp socket isn't
    established
  mptcp: move subflow close loop after sk close check

 net/mptcp/protocol.c | 9 +++++----
 net/mptcp/subflow.c  | 7 +++++++
 2 files changed, 12 insertions(+), 4 deletions(-)

Comments

Mat Martineau Feb. 3, 2021, 1:28 a.m. UTC | #1
On Tue, 2 Feb 2021, Florian Westphal wrote:

> While testing upcoming mptcp reset option support i found a few
> issues with netlink events.
>
> 1. When remote side is closing, the subflow close event will
> be delayed until after the mptcp socket has shut down.
>
> Schedule the worker to do a cleanup scan to avoid this.
>
> 2. When the mptcp socket is closing we can avoid sending
>   individual 'subflow is closing' events; entire connection
>   is going down so might as well wait for the normal mptcp-level
>   close event.
>

Those two fixes look good for the export branch.

> 3. Move the subflow close loop after dead check.
>   This is not a fix, it would be fine to leave things as-is
>   if you prefer -- its just that the extra conn_list walk
>   can be avoided if the msk is already dead.

This also skips the MPTCP_EVENT_SUB_CLOSED events when the whole socket is 
closed, right? That's worthwhile. It doesn't look like delaying the ssk 
close(s) will change the other calls that might happen for the PM / EOF / 
DATA_FIN stuff, so I think the patch is ok. If there's a problem we can 
drop it from the export branch.

Thanks!

Mat


>
> Florian Westphal (3):
>  mptcp: schedule worker when subflow is closed
>  mptcp: skip MPTCP_EVENT_SUB_CLOSED event when mptcp socket isn't
>    established
>  mptcp: move subflow close loop after sk close check
>
> net/mptcp/protocol.c | 9 +++++----
> net/mptcp/subflow.c  | 7 +++++++
> 2 files changed, 12 insertions(+), 4 deletions(-)
>
> -- 
> 2.26.2

--
Mat Martineau
Intel
Matthieu Baerts Feb. 3, 2021, 7:19 p.m. UTC | #2
Hi Florian, Mat,

On 02/02/2021 18:47, Florian Westphal wrote:
> While testing upcoming mptcp reset option support i found a few
> issues with netlink events.

Thank you for the patches and the reviews!

As discussed on IRC, I squashed patch 2/3 in "mptcp: add netlink event 
support":

- 51e4bae2c6c9: "squashed" patch 2/3 in "mptcp: add netlink event support"
- Results: f3a1a5d5ef41..eee71bc20e17

Then I added patches 1/3 and 3/3/ in our tree between "mptcp: split 
__mptcp_close_ssk helper" and "mptcp: pass subflow socket to a few 
helpers". I also added Mat's RvB tags:

- 95fc52697bf7: mptcp: schedule worker when subflow is closed
- 74975e28f8ec: mptcp: move subflow close loop after sk close check
- Results: eee71bc20e17..7b3ea53ce791

Tests + export are in progress!

Cheers,
Matt