From patchwork Fri Mar 18 21:39:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Ricardo Leitner X-Patchwork-Id: 599716 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qRdt66nqPz9s5g for ; Sat, 19 Mar 2016 08:39:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932566AbcCRVjy (ORCPT ); Fri, 18 Mar 2016 17:39:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48174 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932510AbcCRVjw (ORCPT ); Fri, 18 Mar 2016 17:39:52 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 03F7D81F03; Fri, 18 Mar 2016 21:39:51 +0000 (UTC) Received: from mrl.redhat.com (vpn1-4-158.gru2.redhat.com [10.97.4.158]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2ILdmUx023145; Fri, 18 Mar 2016 17:39:50 -0400 From: Marcelo Ricardo Leitner To: netdev@vger.kernel.org Cc: Neil Horman , Vlad Yasevich , linux-sctp@vger.kernel.org Subject: [PATCH] sctp: keep fragmentation point aligned to word size Date: Fri, 18 Mar 2016 18:39:17 -0300 Message-Id: <1458337159-22792-2-git-send-email-marcelo.leitner@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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; return frag; }