aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2004-08-03 23:40:06 -0700
committerDavid S. Miller <davem@nuts.davemloft.net>2004-08-03 23:40:06 -0700
commit0babba3d93095b2d82bfee23ee25b52f0ca77a8d (patch)
treefb9c51cc2c49b532d313282fbe703bc8630a6f89 /include
parent33f5782fd4a67c9bcb9a7ec95f945078d302a822 (diff)
downloadhistory-0babba3d93095b2d82bfee23ee25b52f0ca77a8d.tar.gz
[PKT_SCHED]: Cache align qdisc data.
This patch has qdisc code use the same interface as the netdevice code to cache align the object private data. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/pkt_sched.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index f2e29fd92c1932..bce3aaf91235ce 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -77,6 +77,7 @@ struct Qdisc
#define TCQ_F_BUILTIN 1
#define TCQ_F_THROTTLED 2
#define TCQ_F_INGRES 4
+ int padded;
struct Qdisc_ops *ops;
u32 handle;
atomic_t refcnt;
@@ -93,10 +94,17 @@ struct Qdisc
* and it will live until better solution will be invented.
*/
struct Qdisc *__parent;
-
- char data[0];
};
+#define QDISC_ALIGN 32
+#define QDISC_ALIGN_CONST (QDISC_ALIGN - 1)
+
+static inline void *qdisc_priv(struct Qdisc *q)
+{
+ return (char *)q + ((sizeof(struct Qdisc) + QDISC_ALIGN_CONST)
+ & ~QDISC_ALIGN_CONST);
+}
+
struct qdisc_rate_table
{
struct tc_ratespec rate;