All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: netdev@vger.kernel.org
Cc: Neil Horman <nhorman@tuxdriver.com>,
	Vlad Yasevich <vyasevich@gmail.com>,
	linux-sctp@vger.kernel.org
Subject: Re: [PATCH] sctp: keep fragmentation point aligned to word size
Date: Fri, 18 Mar 2016 20:11:04 -0300	[thread overview]
Message-ID: <20160318231104.GD3387@mrl.redhat.com> (raw)
In-Reply-To: <1458337159-22792-2-git-send-email-marcelo.leitner@gmail.com>

On Fri, Mar 18, 2016 at 06:39:17PM -0300, Marcelo Ricardo Leitner wrote:
> If the user supply a different fragmentation point or if there is a
> network header that cause it to not be aligned, force it to be aligned.
> 
> Fragmentation point at a value that is not aligned is not optimal.  It
> causes extra padding to be used and has just no pros.
> 
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
>  include/net/sctp/sctp.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
> index 835aa2ed987092634a4242314e9eabb51d1e4e35..f27d38113c7926783a9bf2863e14e963ed0ad5d6 100644
> --- a/include/net/sctp/sctp.h
> +++ b/include/net/sctp/sctp.h
> @@ -426,7 +426,7 @@ static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu)
>  	if (asoc->user_frag)
>  		frag = min_t(int, frag, asoc->user_frag);
>  
> -	frag = min_t(int, frag, SCTP_MAX_CHUNK_LEN);
> +	frag = min_t(int, frag, SCTP_MAX_CHUNK_LEN) & ~3;

Will submit a v2 with a helper for this & ~3 thing

      reply	other threads:[~2016-03-18 23:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 21:39 [PATCH] sctp: keep fragmentation point aligned to word size Marcelo Ricardo Leitner
2016-03-18 23:11 ` Marcelo Ricardo Leitner [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=20160318231104.GD3387@mrl.redhat.com \
    --to=marcelo.leitner@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.