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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Jul 2020 12:38:06 +0200
From:   Horatiu Vultur <horatiu.vultur@...rochip.com>
To:     David Miller <davem@...emloft.net>
CC:     <nikolay@...ulusnetworks.com>, <roopa@...ulusnetworks.com>,
        <kuba@...nel.org>, <jiri@...nulli.us>, <ivecera@...hat.com>,
        <andrew@...n.ch>, <UNGLinuxDriver@...rochip.com>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <bridge@...ts.linux-foundation.org>
Subject: Re: [PATCH net-next 01/12] switchdev: mrp: Extend switchdev API for
 MRP Interconnect

The 07/06/2020 12:26, David Miller wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> From: Horatiu Vultur <horatiu.vultur@...rochip.com>
> Date: Mon, 6 Jul 2020 11:18:31 +0200
> 
> > +/* SWITCHDEV_OBJ_ID_IN_TEST_MRP */
> > +struct switchdev_obj_in_test_mrp {
> > +     struct switchdev_obj obj;
> > +     /* The value is in us and a value of 0 represents to stop */
> > +     u32 interval;
> > +     u8 max_miss;
> > +     u32 in_id;
> > +     u32 period;
> > +};
>  ...
> > +#define SWITCHDEV_OBJ_IN_TEST_MRP(OBJ) \
> > +     container_of((OBJ), struct switchdev_obj_in_test_mrp, obj)
> > +
> > +/* SWICHDEV_OBJ_ID_IN_ROLE_MRP */
> > +struct switchdev_obj_in_role_mrp {
> > +     struct switchdev_obj obj;
> > +     u16 in_id;
> > +     u32 ring_id;
> > +     u8 in_role;
> > +     struct net_device *i_port;
> > +};
>  ...
> > +#define SWITCHDEV_OBJ_IN_ROLE_MRP(OBJ) \
> > +     container_of((OBJ), struct switchdev_obj_in_role_mrp, obj)
> > +
> > +struct switchdev_obj_in_state_mrp {
> > +     struct switchdev_obj obj;
> > +     u8 in_state;
> > +     u32 in_id;
> > +};
> 
> Please arrange these structure members in a more optimal order so that
> the resulting object is denser.  For example, in switchdev_obj_in_role_mrp
> if you order it such that:
> 
> > +     u32 ring_id;
> > +     u16 in_id;
> > +     u8 in_role;
> 
> You'll have less wasted space from padding.
> 
> Use 'pahole' or similar tools to guide you.

Thanks, I will try to use 'pahole' and see how they need to be arranged.

-- 
/Horatiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ