All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Attila Toth <panther@balabit.hu>
To: Patrick McHardy <kaber@trash.net>
Cc: Netfilter Developer Mailing List <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH] Introducing socket mark socket option
Date: Wed, 23 Jan 2008 10:05:54 +0100	[thread overview]
Message-ID: <47970372.90509@balabit.hu> (raw)
In-Reply-To: <4795FFEE.8070400@trash.net>

Patrick McHardy wrote:
>> diff --git a/include/net/sock.h b/include/net/sock.h
>> index 9023244..8e88a0e 100644
>> --- a/include/net/sock.h
>> +++ b/include/net/sock.h
>> @@ -252,6 +252,9 @@ struct sock {
>>      long            sk_rcvtimeo;
>>      long            sk_sndtimeo;
>>      struct sk_filter          *sk_filter;
>> +#ifdef CONFIG_NETFILTER
>> +    __u32            sk_mark;
>> +#endif
> 
> Please find a spot that doesn't add holes on 64 bit.
> 

It adds if I insert the member before the function pointers. If I add it 
at the end of struct sock, it is ugly but there is no hole. Pahole's output:

        /* --- cacheline 8 boundary (512 bytes) --- */
         void                       (*sk_destruct)(struct sock *); /* 
512     8 */
         __u32                      sk_mark;              /*   520     4 */

         /* size: 528, cachelines: 9 */
         /* padding: 4 */
         /* paddings: 4, sum paddings: 16 */
         /* last cacheline: 16 bytes */
};      /* definitions: 80 */



I'd prefer the following:

diff --git a/include/net/sock.h b/include/net/sock.h
index 9023244..67de401 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -262,6 +262,8 @@ struct sock {
         __u32                   sk_sndmsg_off;
         int                     sk_write_pending;
         void                    *sk_security;
+       __u32                   sk_mark;
+       /* XXX 4 bytes hole on 64 bit */
         void                    (*sk_state_change)(struct sock *sk);
         void                    (*sk_data_ready)(struct sock *sk, int 
bytes);
         void                    (*sk_write_space)(struct sock *sk);


--
Attila

  reply	other threads:[~2008-01-23  9:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <12010124971855-git-send-email->
2008-01-22 14:38 ` [PATCH] Introducing socket mark socket option Patrick McHardy
2008-01-23  9:05   ` Laszlo Attila Toth [this message]
2008-01-23 12:40 Laszlo Attila Toth
2008-01-23 14:19 ` Patrick McHardy
  -- strict thread matches above, loose matches on Subject: below --
2008-01-22 14:34 laszlo, attila, Toth <panther

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=47970372.90509@balabit.hu \
    --to=panther@balabit.hu \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@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 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.