lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 27 Oct 2015 06:45:52 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	jakub.kicinski@...ronome.com
Cc:	netdev@...r.kernel.org, rolf.neugebauer@...ronome.com,
	jason.mcmullan@...ronome.com, simon.horman@...ronome.com
Subject: Re: [PATCH 2/2] net: add driver for Netronome NFP4000/NFP6000 NIC
 VFs

From: Jakub Kicinski <jakub.kicinski@...ronome.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@...ronome.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.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ