mbox series

[net-next,00/13] sctp: refactor MTU handling

Message ID cover.1524772453.git.marcelo.leitner@gmail.com
Headers show
Series sctp: refactor MTU handling | expand

Message

Marcelo Ricardo Leitner April 26, 2018, 7:58 p.m. UTC
Currently MTU handling is spread over SCTP stack. There are multiple
places doing same/similar calculations and updating them is error prone
as one spot can easily be left out.

This patchset converges it into a more concise and consistent code. In
general, it moves MTU handling from functions with bigger objectives,
such as sctp_assoc_add_peer(), to specific functions.

It's also a preparation for the next patchset, which removes the
duplication between sctp_make_op_error_space and
sctp_make_op_error_fixed and relies on sctp_mtu_payload introduced here.

More details on each patch.

Marcelo Ricardo Leitner (13):
  sctp: remove old and unused SCTP_MIN_PMTU
  sctp: move transport pathmtu calc away of sctp_assoc_add_peer
  sctp: remove an if() that is always true
  sctp: introduce sctp_assoc_set_pmtu
  sctp: introduce sctp_mtu_payload
  sctp: introduce sctp_assoc_update_frag_point
  sctp: remove sctp_assoc_pending_pmtu
  sctp: introduce sctp_dst_mtu
  sctp: remove sctp_transport_pmtu_check
  sctp: re-use sctp_transport_pmtu in sctp_transport_route
  sctp: honor PMTU_DISABLED when handling icmp
  sctp: consider idata chunks when setting SCTP_MAXSEG
  sctp: allow unsetting sockopt MAXSEG

 include/net/sctp/constants.h |  5 ++--
 include/net/sctp/sctp.h      | 52 ++++++++++++++------------------------
 include/net/sctp/structs.h   |  2 ++
 net/sctp/associola.c         | 60 +++++++++++++++++++++++---------------------
 net/sctp/chunk.c             | 12 +--------
 net/sctp/output.c            | 28 ++++++++-------------
 net/sctp/socket.c            | 43 ++++++++++++++-----------------
 net/sctp/transport.c         | 37 ++++++++++++++-------------
 8 files changed, 105 insertions(+), 134 deletions(-)

--
2.14.3

Comments

Xin Long April 27, 2018, 10:04 a.m. UTC | #1
On Fri, Apr 27, 2018 at 3:58 AM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
> Currently MTU handling is spread over SCTP stack. There are multiple
> places doing same/similar calculations and updating them is error prone
> as one spot can easily be left out.
>
> This patchset converges it into a more concise and consistent code. In
> general, it moves MTU handling from functions with bigger objectives,
> such as sctp_assoc_add_peer(), to specific functions.
>
> It's also a preparation for the next patchset, which removes the
> duplication between sctp_make_op_error_space and
> sctp_make_op_error_fixed and relies on sctp_mtu_payload introduced here.
>
> More details on each patch.
>
> Marcelo Ricardo Leitner (13):
>   sctp: remove old and unused SCTP_MIN_PMTU
>   sctp: move transport pathmtu calc away of sctp_assoc_add_peer
>   sctp: remove an if() that is always true
>   sctp: introduce sctp_assoc_set_pmtu
>   sctp: introduce sctp_mtu_payload
>   sctp: introduce sctp_assoc_update_frag_point
>   sctp: remove sctp_assoc_pending_pmtu
>   sctp: introduce sctp_dst_mtu
>   sctp: remove sctp_transport_pmtu_check
>   sctp: re-use sctp_transport_pmtu in sctp_transport_route
>   sctp: honor PMTU_DISABLED when handling icmp
>   sctp: consider idata chunks when setting SCTP_MAXSEG
>   sctp: allow unsetting sockopt MAXSEG
>
>  include/net/sctp/constants.h |  5 ++--
>  include/net/sctp/sctp.h      | 52 ++++++++++++++------------------------
>  include/net/sctp/structs.h   |  2 ++
>  net/sctp/associola.c         | 60 +++++++++++++++++++++++---------------------
>  net/sctp/chunk.c             | 12 +--------
>  net/sctp/output.c            | 28 ++++++++-------------
>  net/sctp/socket.c            | 43 ++++++++++++++-----------------
>  net/sctp/transport.c         | 37 ++++++++++++++-------------
>  8 files changed, 105 insertions(+), 134 deletions(-)
>
> --
> 2.14.3
>
Series
Reviewed-by: Xin Long <lucien.xin@gmail.com>
David Miller April 27, 2018, 6:42 p.m. UTC | #2
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Thu, 26 Apr 2018 16:58:49 -0300

> Currently MTU handling is spread over SCTP stack. There are multiple
> places doing same/similar calculations and updating them is error prone
> as one spot can easily be left out.
> 
> This patchset converges it into a more concise and consistent code. In
> general, it moves MTU handling from functions with bigger objectives,
> such as sctp_assoc_add_peer(), to specific functions.
> 
> It's also a preparation for the next patchset, which removes the
> duplication between sctp_make_op_error_space and
> sctp_make_op_error_fixed and relies on sctp_mtu_payload introduced here.
> 
> More details on each patch.

Series applied, thanks!