[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150226173218.7c6bb2d6@halley>
Date: Thu, 26 Feb 2015 17:32:18 +0200
From: Shmulik Ladkani <shmulik.ladkani@...il.com>
To: Eyal Birger <eyal.birger@...il.com>
Cc: David Miller <davem@...emloft.net>,
Willem de Bruijn <willemb@...gle.com>,
Eric Dumazet <edumazet@...gle.com>,
Marcel Holtmann <marcel@...tmann.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 7/7] net: move skb->dropcount to skb->cb[]
On Thu, 26 Feb 2015 12:48:14 +0200 Eyal Birger <eyal.birger@...il.com> wrote:
> After giving it some additional thought and research, I don't think
> this is necessary.
>
> The sizeof operator on struct sock_skb_cb would give a padded result
> which would take care of the structure alignment.
>
> This is under the assumption that skb->cb[] size is of a proper multiple (which
> I think is rather safe).
Yes, you are correct.
With the assumption that skb->cb and 'cb' size are properly aligned and
sized (compile time asserted, btw?), you can simply:
struct your_thing { // name it
u32 dropcount;
};
struct sock_skb_cb {
/* protocol families specifc CBs */
u8 pf_reserved[PAD];
struct your_thing sock_cb;
};
where:
#define PAD (FIELD_SIZEOF(struct sk_buff, cb) - sizeof(struct your_thing))
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists