[PATCH mptcp-next v2 0/2] mptcp: add statistics for mptcp socket in use

menglong8.dong@gmail.com posted 2 patches 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20220921120442.320727-1-imagedong@tencent.com
Maintainers: Mat Martineau <mathew.j.martineau@linux.intel.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
net/mptcp/protocol.c | 34 +++++++++++++++++++++++++++-------
net/mptcp/protocol.h |  1 +
net/mptcp/subflow.c  |  3 +++
3 files changed, 31 insertions(+), 7 deletions(-)
[PATCH mptcp-next v2 0/2] mptcp: add statistics for mptcp socket in use
Posted by menglong8.dong@gmail.com 1 week ago
From: Menglong Dong <imagedong@tencent.com>

In the 1th patch, we do some code cleanup with replease 'sock->sk'
with 'sk'. In the 2th patch, we add statistics for mptcp socket in
use.

Changes since v1:
- split the code cleanup into the 1th patch.
- decrease the statistics for listening mptcp socket inuse with
  mptcp_listen_inuse_dec()
- add MPTCP_DESTROIED flags to store if mptcp_destroy_common() was
  called on the msk. For fallback case, we need to decrease the
  statistics only once, and mptcp_destroy_common() can be called
  more than once.

Menglong Dong (2):
  mptcp: introduce 'sk' to replace 'sock->sk' in mptcp_listen()
  mptcp: add statistics for mptcp socket in use

 net/mptcp/protocol.c | 34 +++++++++++++++++++++++++++-------
 net/mptcp/protocol.h |  1 +
 net/mptcp/subflow.c  |  3 +++
 3 files changed, 31 insertions(+), 7 deletions(-)

-- 
2.37.2
Re: [PATCH mptcp-next v2 0/2] mptcp: add statistics for mptcp socket in use
Posted by Mat Martineau 1 week ago
On Wed, 21 Sep 2022, menglong8.dong@gmail.com wrote:

> From: Menglong Dong <imagedong@tencent.com>
>
> In the 1th patch, we do some code cleanup with replease 'sock->sk'
> with 'sk'. In the 2th patch, we add statistics for mptcp socket in
> use.
>
> Changes since v1:
> - split the code cleanup into the 1th patch.
> - decrease the statistics for listening mptcp socket inuse with
>  mptcp_listen_inuse_dec()
> - add MPTCP_DESTROIED flags to store if mptcp_destroy_common() was
>  called on the msk. For fallback case, we need to decrease the
>  statistics only once, and mptcp_destroy_common() can be called
>  more than once.
>

Hi Menglong -

Thanks for the v2. Other than Matthieu's request about MPTCP_DESTROYED, 
could you also add a selftest patch to confirm the counter is updated 
correctly?

This test script:

tools/testing/selftests/net/mptcp/diag.sh

already creates a large number of simultaneous sockets, so it might work 
well to modify the wait_msk_nr() function to also confirm the protocol 
inuse counter, and then check that the counter returns to zero after the 
sockets are closed.

> Menglong Dong (2):
>  mptcp: introduce 'sk' to replace 'sock->sk' in mptcp_listen()
>  mptcp: add statistics for mptcp socket in use
>
> net/mptcp/protocol.c | 34 +++++++++++++++++++++++++++-------
> net/mptcp/protocol.h |  1 +
> net/mptcp/subflow.c  |  3 +++
> 3 files changed, 31 insertions(+), 7 deletions(-)
>
> -- 
> 2.37.2
>
>

--
Mat Martineau
Intel
Re: [PATCH mptcp-next v2 0/2] mptcp: add statistics for mptcp socket in use
Posted by Menglong Dong 1 week ago
Hello,

On Thu, Sep 22, 2022 at 8:04 AM Mat Martineau
<mathew.j.martineau@linux.intel.com> wrote:
>
> On Wed, 21 Sep 2022, menglong8.dong@gmail.com wrote:
>
> > From: Menglong Dong <imagedong@tencent.com>
> >
> > In the 1th patch, we do some code cleanup with replease 'sock->sk'
> > with 'sk'. In the 2th patch, we add statistics for mptcp socket in
> > use.
> >
> > Changes since v1:
> > - split the code cleanup into the 1th patch.
> > - decrease the statistics for listening mptcp socket inuse with
> >  mptcp_listen_inuse_dec()
> > - add MPTCP_DESTROIED flags to store if mptcp_destroy_common() was
> >  called on the msk. For fallback case, we need to decrease the
> >  statistics only once, and mptcp_destroy_common() can be called
> >  more than once.
> >
>
> Hi Menglong -
>
> Thanks for the v2. Other than Matthieu's request about MPTCP_DESTROYED,
> could you also add a selftest patch to confirm the counter is updated
> correctly?
>
> This test script:
>
> tools/testing/selftests/net/mptcp/diag.sh
>
> already creates a large number of simultaneous sockets, so it might work
> well to modify the wait_msk_nr() function to also confirm the protocol
> inuse counter, and then check that the counter returns to zero after the
> sockets are closed.

Thanks for the explanation, I think it can work. In case of that
there are mptcp sockets existing out of the testing, we can also
record the statistics before creating mptcp socket, and compare
the statistics after the closing of mptcp socket.

I'll add the test in the next version.

Thanks!
Menglong Dong

>
> > Menglong Dong (2):
> >  mptcp: introduce 'sk' to replace 'sock->sk' in mptcp_listen()
> >  mptcp: add statistics for mptcp socket in use
> >
> > net/mptcp/protocol.c | 34 +++++++++++++++++++++++++++-------
> > net/mptcp/protocol.h |  1 +
> > net/mptcp/subflow.c  |  3 +++
> > 3 files changed, 31 insertions(+), 7 deletions(-)
> >
> > --
> > 2.37.2
> >
> >
>
> --
> Mat Martineau
> Intel