• Daniel Jurgens's avatar
    IB/core: Eliminate a hole in MAD agent struct · 805b754d
    Daniel Jurgens authored
    Move the security related fields above the u8s to eliminate a hole in the
    struct.
    
    pahole before:
    struct ib_mad_agent {
    ...
    u32                        hi_tid;               /*    48     4 */
    u32                        flags;                /*    52     4 */
    u8                         port_num;             /*    56     1 */
    u8                         rmpp_version;         /*    57     1 */
    
    /* XXX 6 bytes hole, try to pack */
    
    /* --- cacheline 1 boundary (64 bytes) --- */
    void *                     security;             /*    64     8 */
    bool                       smp_allowed;          /*    72     1 */
    bool                       lsm_nb_reg;           /*    73     1 */
    
    /* XXX 6 bytes hole, try to pack */
    
    struct notifier_block      lsm_nb;               /*    80    24 */
    
    /* XXX last struct has 4 bytes of padding */
    
    /* size: 104, cachelines: 2, members: 14 */
    ...
    };
    
    pahole after:
    struct ib_mad_agent {
    ...
    u32                        hi_tid;               /*    48     4 */
    u32                        flags;                /*    52     4 */
    void *                     security;             /*    56     8 */
    /* --- cacheline 1 boundary (64 bytes) --- */
    struct notifier_block      lsm_nb;               /*    64    24 */
    
    /* XXX last struct has 4 bytes of padding */
    
    u8                         port_num;             /*    88     1 */
    u8                         rmpp_version;         /*    89     1 */
    bool                       smp_allowed;          /*    90     1 */
    bool                       lsm_nb_reg;           /*    91     1 */
    
    /* size: 96, cachelines: 2, members: 14 */
    ...
    };
    Signed-off-by: default avatarDaniel Jurgens <danielj@mellanox.com>
    Reviewed-by: default avatarParav Pandit <parav@mellanox.com>
    Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
    805b754d
ib_mad.h 29.5 KB