)]}'
{
  "commit": "2e07fa9cd3bac1e28cfe3131ed86b053afb02fc9",
  "tree": "177ad0c2cbbd60c25e54b35802219634c047aa08",
  "parents": [
    "b0e380b1d8a8e0aca215df97702f99815f05c094"
  ],
  "author": {
    "name": "Arnaldo Carvalho de Melo",
    "email": "acme@redhat.com",
    "time": "Tue Apr 10 21:22:35 2007 -0700"
  },
  "committer": {
    "name": "David S. Miller",
    "email": "davem@sunset.davemloft.net",
    "time": "Wed Apr 25 22:26:21 2007 -0700"
  },
  "message": "[SK_BUFF]: Use offsets for skb-\u003e{mac,network,transport}_header on 64bit architectures\n\nWith this we save 8 bytes per network packet, leaving a 4 bytes hole to be used\nin further shrinking work, likely with the offsetization of other pointers,\nsuch as -\u003e{data,tail,end}, at the cost of adds, that were minimized by the\nusual practice of setting skb-\u003e{mac,nh,n}.raw to a local variable that is then\naccessed multiple times in each function, it also is not more expensive than\nbefore with regards to most of the handling of such headers, like setting one\nof these headers to another (transport to network, etc), or subtracting, adding\nto/from it, comparing them, etc.\n\nNow we have this layout for sk_buff on a x86_64 machine:\n\n[acme@mica net-2.6.22]$ pahole vmlinux sk_buff\nstruct sk_buff {\n\tstruct sk_buff *       next;             /*   0   8 */\n\tstruct sk_buff *       prev;             /*   8   8 */\n\tstruct rb_node         rb;               /*  16  24 */\n\tstruct sock *          sk;               /*  40   8 */\n\tktime_t                tstamp;           /*  48   8 */\n\tstruct net_device *    dev;              /*  56   8 */\n\t/* --- cacheline 1 boundary (64 bytes) --- */\n\tstruct net_device *    input_dev;        /*  64   8 */\n\tsk_buff_data_t         transport_header; /*  72   4 */\n\tsk_buff_data_t         network_header;   /*  76   4 */\n\tsk_buff_data_t         mac_header;       /*  80   4 */\n\n\t/* XXX 4 bytes hole, try to pack */\n\n\tstruct dst_entry *     dst;              /*  88   8 */\n\tstruct sec_path *      sp;               /*  96   8 */\n\tchar                   cb[48];           /* 104  48 */\n\t/* cacheline 2 boundary (128 bytes) was 24 bytes ago*/\n\tunsigned int           len;              /* 152   4 */\n\tunsigned int           data_len;         /* 156   4 */\n\tunsigned int           mac_len;          /* 160   4 */\n\tunion {\n\t\t__wsum         csum;             /*       4 */\n\t\t__u32          csum_offset;      /*       4 */\n\t};                                       /* 164   4 */\n\t__u32                  priority;         /* 168   4 */\n\t__u8                   local_df:1;       /* 172   1 */\n\t__u8                   cloned:1;         /* 172   1 */\n\t__u8                   ip_summed:2;      /* 172   1 */\n\t__u8                   nohdr:1;          /* 172   1 */\n\t__u8                   nfctinfo:3;       /* 172   1 */\n\t__u8                   pkt_type:3;       /* 173   1 */\n\t__u8                   fclone:2;         /* 173   1 */\n\t__u8                   ipvs_property:1;  /* 173   1 */\n\n\t/* XXX 2 bits hole, try to pack */\n\n\t__be16                 protocol;         /* 174   2 */\n\tvoid    (*destructor)(struct sk_buff *); /* 176   8 */\n\tstruct nf_conntrack *  nfct;             /* 184   8 */\n\t/* --- cacheline 3 boundary (192 bytes) --- */\n\tstruct sk_buff *       nfct_reasm;       /* 192   8 */\n\tstruct nf_bridge_info *nf_bridge;        /* 200   8 */\n\t__u16                  tc_index;         /* 208   2 */\n\t__u16                  tc_verd;          /* 210   2 */\n\tdma_cookie_t           dma_cookie;       /* 212   4 */\n\t__u32                  secmark;          /* 216   4 */\n\t__u32                  mark;             /* 220   4 */\n\tunsigned int           truesize;         /* 224   4 */\n\tatomic_t               users;            /* 228   4 */\n\tunsigned char *        head;             /* 232   8 */\n\tunsigned char *        data;             /* 240   8 */\n\tunsigned char *        tail;             /* 248   8 */\n\t/* --- cacheline 4 boundary (256 bytes) --- */\n\tunsigned char *        end;              /* 256   8 */\n}; /* size: 264, cachelines: 5 */\n   /* sum members: 260, holes: 1, sum holes: 4 */\n   /* bit holes: 1, sum bit holes: 2 bits */\n   /* last cacheline: 8 bytes */\n\nOn 32 bits nothing changes, and pointers continue to be used with the compiler\nturning all this abstraction layer into dust. But there are some sk_buff\nvalidation tricks that are now possible, humm... :-)\n\nSigned-off-by: Arnaldo Carvalho de Melo \u003cacme@redhat.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c45ad126327195ced36f516652cca2ba83120423",
      "old_mode": 33188,
      "old_path": "include/linux/skbuff.h",
      "new_id": "2e740550062615f559387c122518f943f07899b6",
      "new_mode": 33188,
      "new_path": "include/linux/skbuff.h"
    },
    {
      "type": "modify",
      "old_id": "1e71764be4a44bbaf858f40ab31ee198b668db51",
      "old_mode": 33188,
      "old_path": "net/core/skbuff.c",
      "new_id": "a48b086812615cb2534231e52717c4fe560e4e6c",
      "new_mode": 33188,
      "new_path": "net/core/skbuff.c"
    },
    {
      "type": "modify",
      "old_id": "fded9b2f227cf704a456a15aefb1abe4ef2fcdf3",
      "old_mode": 33188,
      "old_path": "net/ipv4/ipvs/ip_vs_xmit.c",
      "new_id": "900ce29db38276a649661702b81d2711bd7891e4",
      "new_mode": 33188,
      "new_path": "net/ipv4/ipvs/ip_vs_xmit.c"
    },
    {
      "type": "modify",
      "old_id": "87feee166da92d37a19fccd4365bbacca4362bc4",
      "old_mode": 33188,
      "old_path": "net/sctp/input.c",
      "new_id": "1ff47b18724a3e81f2ba9eb5b8aa95b0538e50dd",
      "new_mode": 33188,
      "new_path": "net/sctp/input.c"
    },
    {
      "type": "modify",
      "old_id": "afcb0093c2901e0644f91a77ce0adb0f44956d61",
      "old_mode": 33188,
      "old_path": "net/sctp/ipv6.c",
      "new_id": "5b0cdda4b44989ae74382174c5e8d9594f778c93",
      "new_mode": 33188,
      "new_path": "net/sctp/ipv6.c"
    }
  ]
}
