linux-sctp.vger.kernel.org archive mirror
 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: [PATCH net-next 2/6] sctp: reorder sctp_ulpevent and shrink msg_flags
Date: Wed, 13 Jul 2016 18:08:56 +0000	[thread overview]
Message-ID: <0d9bf4a78caa22f6c7dd84304b5ff3eed7939f1e.1468432819.git.marcelo.leitner@gmail.com> (raw)
In-Reply-To: <cover.1468432819.git.marcelo.leitner@gmail.com>

The next patch needs 8 bytes in there. sctp_ulpevent has a hole due to
bad alignment; msg_flags is using 4 bytes while it actually uses only 2, so
we shrink it, and iif member (4 bytes) which can be easily fetched from
another place once the next patch is there, so we remove it and thus
creating space for 8 bytes.

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
---
 include/net/sctp/ulpevent.h | 10 +++++-----
 net/sctp/ulpevent.c         |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index cccdcfd149736b315554d64c2a556e0ad6496fc8..aa342645dbce446186d55151c3f507cf0e165b44 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -48,15 +48,15 @@
  */
 struct sctp_ulpevent {
 	struct sctp_association *asoc;
-	__u16 stream;
-	__u16 ssn;
-	__u16 flags;
+	unsigned int rmem_len;
 	__u32 ppid;
 	__u32 tsn;
 	__u32 cumtsn;
-	int msg_flags;
 	int iif;
-	unsigned int rmem_len;
+	__u16 stream;
+	__u16 ssn;
+	__u16 flags;
+	__u16 msg_flags;
 };
 
 /* Retrieve the skb this event sits inside of. */
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index d1e38308f6159c0e4da7db966c16afc6a956b554..706f5bc9f0c3083ab455ec78b963cd609a3a95b5 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -51,7 +51,7 @@ static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event);
 
 /* Initialize an ULP event from an given skb.  */
 static void sctp_ulpevent_init(struct sctp_ulpevent *event,
-			       int msg_flags,
+			       __u16 msg_flags,
 			       unsigned int len)
 {
 	memset(event, 0, sizeof(struct sctp_ulpevent));
@@ -60,7 +60,7 @@ static void sctp_ulpevent_init(struct sctp_ulpevent *event,
 }
 
 /* Create a new sctp_ulpevent.  */
-static struct sctp_ulpevent *sctp_ulpevent_new(int size, int msg_flags,
+static struct sctp_ulpevent *sctp_ulpevent_new(int size, __u16 msg_flags,
 					       gfp_t gfp)
 {
 	struct sctp_ulpevent *event;
-- 
2.7.4


  parent reply	other threads:[~2016-07-13 18:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-13 18:08 [PATCH net-next 0/6] sctp: allow GSO frags to access the chunk too Marcelo Ricardo Leitner
2016-07-13 18:08 ` [PATCH net-next 1/6] sctp: allow others to use sctp_input_cb Marcelo Ricardo Leitner
2016-07-13 18:08 ` Marcelo Ricardo Leitner [this message]
2016-07-13 18:08 ` [PATCH net-next 3/6] sctp: allow GSO frags to access the chunk too Marcelo Ricardo Leitner
2016-07-13 18:08 ` [PATCH net-next 4/6] sctp: avoid identifying address family many times for a chunk Marcelo Ricardo Leitner
2016-07-13 18:08 ` [PATCH net-next 5/6] sctp: do not clear chunk->ecn_ce_done flag Marcelo Ricardo Leitner
2016-07-13 18:09 ` [PATCH net-next 6/6] sctp: only check for ECN if peer is using it Marcelo Ricardo Leitner
2016-07-14  1:10 ` [PATCH net-next 0/6] sctp: allow GSO frags to access the chunk too 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=0d9bf4a78caa22f6c7dd84304b5ff3eed7939f1e.1468432819.git.marcelo.leitner@gmail.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 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).