From: David Miller <davem@davemloft.net>
To: marcelo.leitner@gmail.com
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com,
	nhorman@tuxdriver.com, vyasevich@gmail.com,
	linux-sctp@vger.kernel.org
Subject: Re: [PATCH v2] sctp: align MTU to a word
Date: Sun, 20 Mar 2016 16:31:56 -0400 (EDT)	[thread overview]
Message-ID: <20160320.163156.385019913302887750.davem@davemloft.net> (raw)
In-Reply-To: <1458400640-25448-1-git-send-email-marcelo.leitner@gmail.com>
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Sat, 19 Mar 2016 12:17:20 -0300
> SCTP is a protocol that is aligned to a word (4 bytes). Thus using bare
> MTU can sometimes return values that are not aligned, like for loopback,
> which is 65536 but ipv4_mtu() limits that to 65535. This mis-alignment
> will cause the last non-aligned bytes to never be used and can cause
> issues with congestion control.
> 
> So it's better to just consider a lower MTU and keep congestion control
> calcs saner as they are based on PMTU.
> 
> Same applies to icmp frag needed messages, which is also fixed by this
> patch.
> 
> One other effect of this is the inability to send MTU-sized packet
> without queueing or fragmentation and without hitting Nagle. As the
> check performed at sctp_packet_can_append_data():
> 
> if (chunk->skb->len + q->out_qlen >= transport->pathmtu - packet->overhead)
> 	/* Enough data queued to fill a packet */
> 	return SCTP_XMIT_OK;
> 
> with the above example of MTU, if there are no other messages queued,
> one cannot send a packet that just fits one packet (65532 bytes) and
> without causing DATA chunk fragmentation or a delay.
> 
> v2:
>  - Added WORD_TRUNC macro
> 
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Applied.
     prev parent reply	other threads:[~2016-03-20 20:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-19 15:17 [PATCH v2] sctp: align MTU to a word Marcelo Ricardo Leitner
2016-03-20 20:31 ` David Miller [this message]
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=20160320.163156.385019913302887750.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).