2 # This is a BitKeeper generated diff -Nru style patch.
5 # 2004/08/15 18:08:13+02:00 kaber@xxxxxxxxxxxx
6 # [PKT_SCHED]: cacheline-align qdisc data in qdisc_create()
8 # Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
11 # 2004/08/15 18:04:27+02:00 kaber@xxxxxxxxxxxx +13 -8
12 # [PKT_SCHED]: cacheline-align qdisc data in qdisc_create()
14 diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c
15 --- a/net/sched/sch_api.c 2004-08-15 18:09:36 +02:00
16 +++ b/net/sched/sch_api.c 2004-08-15 18:09:36 +02:00
20 struct rtattr *kind = tca[TCA_KIND-1];
21 - struct Qdisc *sch = NULL;
24 struct Qdisc_ops *ops;
31 - size = sizeof(*sch) + ops->priv_size;
32 + /* ensure that the Qdisc and the private data are 32-byte aligned */
33 + size = ((sizeof(*sch) + QDISC_ALIGN_CONST) & ~QDISC_ALIGN_CONST);
34 + size += ops->priv_size + QDISC_ALIGN_CONST;
36 - sch = kmalloc(size, GFP_KERNEL);
37 + p = kmalloc(size, GFP_KERNEL);
43 + sch = (struct Qdisc *)(((unsigned long)p + QDISC_ALIGN_CONST)
44 + & ~QDISC_ALIGN_CONST);
45 + sch->padded = (char *)sch - (char *)p;
47 /* Grrr... Resolve race condition with module unload */
50 if (ops != qdisc_lookup_ops(kind))
53 - memset(sch, 0, size);
55 INIT_LIST_HEAD(&sch->list);
56 skb_queue_head_init(&sch->q);