Netdev List
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	linux-sctp@vger.kernel.org, davem@davemloft.net,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Subject: Re: [PATCH net] Revert "sctp: remove sctp_transport_pmtu_check"
Date: Mon, 19 Nov 2018 12:50:14 -0500	[thread overview]
Message-ID: <20181119175014.GC7622@hmswarspite.think-freely.org> (raw)
In-Reply-To: <722a49900dadb13e3a97a63d54561418db28e1cc.1542528887.git.lucien.xin@gmail.com>

On Sun, Nov 18, 2018 at 04:14:47PM +0800, Xin Long wrote:
> This reverts commit 22d7be267eaa8114dcc28d66c1c347f667d7878a.
> 
> The dst's mtu in transport can be updated by a non sctp place like
> in xfrm where the MTU information didn't get synced between asoc,
> transport and dst, so it is still needed to do the pmtu check
> in sctp_packet_config.
> ---
>  include/net/sctp/sctp.h | 12 ++++++++++++
>  net/sctp/output.c       |  3 +++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
> index 8c2caa3..ab9242e 100644
> --- a/include/net/sctp/sctp.h
> +++ b/include/net/sctp/sctp.h
> @@ -608,4 +608,16 @@ static inline __u32 sctp_dst_mtu(const struct dst_entry *dst)
>  				 SCTP_DEFAULT_MINSEGMENT));
>  }
>  
> +static inline bool sctp_transport_pmtu_check(struct sctp_transport *t)
> +{
> +	__u32 pmtu = sctp_dst_mtu(t->dst);
> +
> +	if (t->pathmtu == pmtu)
> +		return true;
> +
> +	t->pathmtu = pmtu;
> +
> +	return false;
> +}
> +
>  #endif /* __net_sctp_h__ */
> diff --git a/net/sctp/output.c b/net/sctp/output.c
> index 67939ad..0860122 100644
> --- a/net/sctp/output.c
> +++ b/net/sctp/output.c
> @@ -118,6 +118,9 @@ void sctp_packet_config(struct sctp_packet *packet, __u32 vtag,
>  		sctp_transport_route(tp, NULL, sp);
>  		if (asoc->param_flags & SPP_PMTUD_ENABLE)
>  			sctp_assoc_sync_pmtu(asoc);
> +	} else if (!sctp_transport_pmtu_check(tp)) {
> +		if (asoc->param_flags & SPP_PMTUD_ENABLE)
> +			sctp_assoc_sync_pmtu(asoc);
>  	}
>  
>  	if (asoc->pmtu_pending) {
> -- 
> 2.1.0
> 
> 

Acked-by: Neil Horman <nhorman@tuxdriver.com>

  reply	other threads:[~2018-11-20  4:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-18  8:14 [PATCH net] Revert "sctp: remove sctp_transport_pmtu_check" Xin Long
2018-11-19 17:50 ` Neil Horman [this message]
2018-11-19 20:44 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181119175014.GC7622@hmswarspite.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox