Subject: Re: net 03/05: fib_rules: add oif classification

From: Patrick McHardy <[email-masked]>
Date: Tue, 01 Dec 2009 10:32:40 +0100

Jarek Poplawski wrote:
> Patrick McHardy wrote, On 11/30/2009 06:55 PM:
>   
>> diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
>> index 62bebcb..d4e875a 100644
>> --- a/include/net/fib_rules.h
>> +++ b/include/net/fib_rules.h
>> @@ -11,6 +11,7 @@ struct fib_rule {
>>  	struct list_head	list;
>>  	atomic_t		refcnt;
>>  	int			iifindex;
>> +	int			oifindex;
>>     
>
> Doesn't it "break" the cacheline fix from 01/05?

No, there's a 4 byte hole which is plugged by this:

struct fib_rule {
        struct list_head           list;                 /*     0    16 */
        atomic_t                   refcnt;               /*    16     4 */
        int                        iifindex;             /*    20     4 */
        int                        oifindex;             /*    24     4 */
        u32                        mark;                 /*    28     4 */
        u32                        mark_mask;            /*    32     4 */
        u32                        pref;                 /*    36     4 */
        u32                        flags;                /*    40     4 */
        u32                        table;                /*    44     4 */
        u8                         action;               /*    48     1 */

        /* XXX 3 bytes hole, try to pack */

        u32                        target;               /*    52     4 */
        struct fib_rule *          ctarget;              /*    56     8 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        char                       iifname[16];          /*    64    16 */
        char                       oifname[16];          /*    80    16 */
        struct rcu_head            rcu;                  /*    96    16 */
        struct net *               fr_net;               /*   112     8 */
        /* size: 120, cachelines: 2 */
        /* sum members: 117, holes: 1, sum holes: 3 */
        /* last cacheline: 56 bytes */
};      /* definitions: 1 */