netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jakub.kicinski@netronome.com
Cc: netdev@vger.kernel.org, rolf.neugebauer@netronome.com,
	jason.mcmullan@netronome.com, simon.horman@netronome.com
Subject: Re: [PATCH 2/2] net: add driver for Netronome NFP4000/NFP6000 NIC VFs
Date: Tue, 27 Oct 2015 06:45:52 -0700 (PDT)	[thread overview]
Message-ID: <20151027.064552.1983883459752923442.davem@davemloft.net> (raw)
In-Reply-To: <20151027111603.77111ce4@jkicinski-Precision-T1700>

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Tue, 27 Oct 2015 11:16:03 +0000

> On Mon, 26 Oct 2015 18:23:07 -0700 (PDT), David Miller wrote:
>> From: Jakub Kicinski <jakub.kicinski@netronome.com>
>> Date: Fri, 23 Oct 2015 19:58:11 +0100
>> 
>> > +struct nfp_net_tx_buf {
>> > +	struct sk_buff *skb;
>> > +	dma_addr_t dma_addr;
>> > +	short int fidx;
>> > +	u16 pkt_cnt;
>> > +	u32 real_len;
>> > +};
>> 
>> This packs very poorly, and has a lot of padding holes.  Better ordering
>> would be:
>> 
>> struct nfp_net_tx_buf {
>> 	struct sk_buff *skb;
>> 	dma_addr_t dma_addr;
>> 	u32 real_len;
>> 	short int fidx;
>> 	u16 pkt_cnt;
>> };
> 
> Seems to pack fine on x86:
> 
> struct nfp_net_tx_buf {
>         struct sk_buff *           skb;                  /*     0     8 */
>         dma_addr_t                 dma_addr;             /*     8     8 */
>         short int                  fidx;                 /*    16     2 */
>         u16                        pkt_cnt;              /*    18     2 */
>         u32                        real_len;             /*    20     4 */
> 
>         /* size: 24, cachelines: 1, members: 5 */
>         /* last cacheline: 24 bytes */
> };
> 
> Are my packing skills deceiving me?  Maybe I'll try to build the driver
> for more esoteric architectures.

My bad, I misread the types.

      reply	other threads:[~2015-10-27 13:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 18:58 [PATCH 0/2] Netronome NFP4000/NFP6000 NIC VF driver Jakub Kicinski
2015-10-23 18:58 ` [PATCH 1/2] pci_ids: add Netronome Systems vendor Jakub Kicinski
2015-10-23 18:58 ` [PATCH 2/2] net: add driver for Netronome NFP4000/NFP6000 NIC VFs Jakub Kicinski
2015-10-27  1:23   ` David Miller
2015-10-27 11:16     ` Jakub Kicinski
2015-10-27 13:45       ` David Miller [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=20151027.064552.1983883459752923442.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jason.mcmullan@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=rolf.neugebauer@netronome.com \
    --cc=simon.horman@netronome.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).